This is mostly a postfix question, but I'm sure someone has dealt with this when setting up dspam, so here it goes:
I want postfix to do two things: 1) Add the X-Original-To header before doing any alias mapping 2) Send the email to DSpam if and only if it is not outgoing AND the sender is local or SASL authenticated. The problem I have is that because dspam must know the recipient username (so it can store the spam info in his/her home directory), postfix cannot send dspam the email to "groupaddr...@domain.com" but must first de-alias it to "user1, user2, user3" etc. This means that the X-Original-To header must be added before sending to dspam. That part is fine, I can do that with a transport defined with the O flag: dspam unix - n n - 10 pipe flags=RO user=dspam argv=/usr/bin/dspam --deliver=innocent,spam --user $user -i -f $sender -- $recipient If I put this transport as a -o content_filter=dspam in the smtp line in master.cf, then ALL mail goes through dspam and gets the X-Original-To header, not just incoming mail. Ok, so instead I have in main.cf: smtpd_client_restrictions = check_sender_access pcre:/etc/postfix/dspam_filter, where dspam_filter is: /@domain.com/ FILTER dspam:dspam this has a few problems: A) I am sending all incoming emails to dspam, even one from local users and SASL authenticated user. If I put smtpd_client_restrictions = permit_mynetworks, check_sender_access pcre:/etc/postfix/dspam_filter, then email from inside the network doesn't go through Dspam, but it doesn't get the X-Original-To: header because that is part of the dspam transport. If I add the X-Original-To: header later, then that header is wrong when emails do go through dspam since the address has been de-aliased by this time it gets past Dspam. More seriously, with this setup, If I send an email to: localus...@domain.com, foreignus...@away.com then that matches my dspam_filter and dspam scans the email going out to foreignus...@away.com and I in my /var/spool/dspam/data folder I get a foreignuser1 folder with signature and log, etc. I must be missing a much better way to set this up. I'm running postfix 2.5.5 and using virtual domains and using dovecot's deliver as the final transport to deliver mail to people's inbox. Googling seems to show lots of people with setups where output mail goes through dspam and the X-Original-To header is not always set correctly. Is there a way to have dspam skip scanning certain emails so I can have postfix always send email (incoming or outgoing) to dspam? Thanks, Ben ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Dspam-user mailing list Dspam-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspam-user