OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Delivery of spam into subdirectory?

From: Jens Kutilek (jk-listsisitrain.de)
Date: Mon Feb 07 2005 - 08:42:42 CST


Hi,

I'm using Postfix 2.1.5 on Debian Sarge. Incoming mail for virtual
domains is filtered through SpamAssassin (3.0) and tagged accordingly.
The relevant part of master.cf:

smtp inet n - n - - smtpd
   -o content_filter=filter:dummy
   -o receive_override_options=no_address_mappings
smtp unix - - n - - smtp
filter unix - n n - 10 pipe
   flags=Rq
   user=filter
   argv=/usr/local/sbin/spamfilter.sh
   -f ${sender} -- ${recipient}

spamfilter.sh pipes the message to spamd and inputs it to Postfix again
using the sendmail interface.

Now I want mail marked as spam to be delivered into a subdirectory
".Junk" of the destination maildir. I tried it this way:

(main.cf)
header_checks = regexp:/etc/postfix/header_checks

header_checks)
/^X-Spam-Flag: YES$/ FILTER spamdeliver:dummy

(master.cf)
spamdeliver unix - n n - - pipe
   flags=Rq user=vmail argv=/usr/local/sbin/spamdeliver.sh ${recipient}

spamdeliver.sh basically does something like "cat >
$mailspool/$domain/$popbox/.Junk/new/$file".

It works fine for real postboxes, but the problem are forwarder
adresses. E.g. usenetkutilek.de forwards to the remote address
jensexample.com. Mail marked as spam is not sent to the remote mx, but
delivered locally to .../example.com/jens/.Junk.

How can I solve this? I guess the spam is separated (via header_checks)
at the wrong point in the delivery process ... ?

Cheers,
Jens.