OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
question about nested headerchecks

From: Anne Ramey (annerblast.com)
Date: Tue Oct 18 2005 - 13:57:19 CDT


  I'm having a problem with my logic trying to filter using header
checks. What I want to do is send a message to a filter if the return
path is my domain *and* the header my filter adds is not already
present. I'm thinking this would do it, but my messages are never
getting sent to the filter

if /Return-Path:\s*<\S*mydomain.com>.*/
          if !/X-Copyrighted-Material:.*/ FILTER dmsg:
          endif
  endif

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
header_checks = regexp:/etc/postfix/header_checks
html_directory = /etc/postfix/htmls
inet_interfaces = all
local_recipient_maps = $alias_maps unix:passwd.byname
mail_owner = postfix
mailbox_command = /usr/bin/procmail -a "$EXTENSION" -d "$USER"
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 13312000
mydestination = $myhostname, localhost.$mydomain, $mydomain, ncees.emji.net
mydomain = ncees.org
myhostname = mail.ncees.org
mynetworks = $config_directory/relay-domains
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
owner_request_special = no
queue_directory = /var/spool/postfix
readme_directory = /etc/postfix/README_FILES
recipient_delimiter = +
sample_directory = /etc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject
smtpd_sasl_auth_enable = yes
transport_maps = mysql:/etc/postfix/transport.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/virtual.cf

in my master.cf:
dmsg unix - n n - - pipe
   flags=Rq user=filter argv=/etc/postfix/filter/add_disclaimer.sh -f
${sender} -- ${recipient}

what is in my header_checks for testing is
if /Return-Path:\s*<annerncees.org>.*/
         if !/X-Copyrighted-Material:.*/ FILTER dmsg:
         endif
  endif

if I send a message from that address on that server, my return path is
correct , but it never gets sent to the fitler.

Anne