| |||||||||||||||||||||||||||||||
|
sending mail on to other servers, adding disclaimers to the footer of certain emails, passing certain emails through to procmail to handle, SPAM filter, virus filter, etc. Every email that comes through also gets sent to a general email address via always_bcc. This basically gets passed to a script which inserts the mail into a CRM database if the mail was sent to or from one of our customers. So, always_bcc sends to crmimport. If postfix passes an email that contains that address, it then passes it to procmail which then in turn passes it to a script to handle. I have a procmail rule that basically reads, anything coming to accounts, then pass it off to another script to handle. This works, but the problem is that when an email is sent to accounts, always_bcc comes into play and sends via bcc to crm. The procmail rule that handles accounts picks this up again which causes duplicate emails. I just have no idea how I can get around this. I will post my relevant parts of some files: main.cf: smtp inet n - n - - smtpd -o always_bcc=crmimport -o cleanup_service_name=disclaimer-cleanup procmail unix - n n - 10 pipe flags=hu user=mail argv=/usr/bin/procmail dspam unix - n n - 10 lmtp disclaimer-cleanup unix n - n - 0 cleanup -o always_bcc=crmimport -o header_checks=pcre:$config_directory/headers_disclaimer /etc/postfix/transport: /^expenses$/ procmail:expenses /^crmimport$/ procmail:crmimport /etc/procmailrc: :0w * ^To:.*expenses * !.*crmimport * ^Subject:[ \t]*\/[^ ].* | /usr/local/sbin/somescript.sh # Catch all rule for crmimport to pickup all remaining messages [ .. ] So basically, any rule that gets sent off to procmail and gets caught in a procmail rule will get generated twice. Seeing that always_bcc doesn't change the To: header, it's always going to catch the same procmail rule. Any help appreciated. Thanks. Ben.
| ||||||||||||||||||||||||||||||
© 2004-2008 readlist.com