Re: conditionally add boilerplate in message with more than one recipient
"Vieri Di Paola" <[email protected]>
| Newsgroups | gmane.mail.mimedefang |
|---|---|
| Message-ID | <trinity-2fc066e5-00a5-4ba8-9ebd-28bdac026b28-1474729330058@3capp-mailcom-bs01> |
> From: "Richard Laager" <[email protected]> >> OK, got it. However, I want all the filtering stuff in the filter*() functions to be applied to the "resent" message to ORG, except the boilerplate. I guess it's not >> possible because resend_message resends the ORIGINAL message and won't be processed. >> > When the message is resent, you'll see it again in another run of the > filter. That's your opportunity to do what you need for the ORG > recipient. Craft your filter very careful in light of this! I'm sorry but I'm obviously doing something wrong but just don't know what. I'm not seeing the message again in another run of the filter. I did a simple test such as: sub filter_end { my($entity) = @_; my($d1) = scalar(@Recipients); my($d2) = $Recipients[0]; my($d3) = ""; if (scalar(@Recipients) == 2) { $d3 = $Recipients[1]; } md_syslog('info', "debug_resendmsg_d1_${d1}_${Subject}"); md_syslog('info', "debug_resendmsg_d2_${d2}_${Subject}"); md_syslog('info', "debug_resendmsg_d3_${d3}_${Subject}"); if ($d1 == 2 && $d2 eq '<[email protected]>' && $d3 eq '<[email protected]>') { <------>md_syslog('info', "debug_resendmsg_match_${Subject}"); <------>if (resend_message($d3)) { <------> delete_recipient($d3); <------> md_syslog('info', "debug_resendmsg_resent_and_deleted_$d3"); <------>} } [continues...] I then sent an email to "[email protected], [email protected]", grepped the log and found: # tail -n 10000 /var/log/messages | grep debug_resendmsg mimedefang.pl[16650]: DFB4B35E3265: debug_resendmsg_d1_2_test 1 mimedefang.pl[16650]: DFB4B35E3265: debug_resendmsg_d2_<[email protected]>_test 1 mimedefang.pl[16650]: DFB4B35E3265: debug_resendmsg_d3_<[email protected]>_test 1 mimedefang.pl[16650]: DFB4B35E3265: debug_resendmsg_match_test 1 mimedefang.pl[16858]: DFB4B35E3265: debug_resendmsg_sendmail: /usr/sbin/sendmail -f<[email protected]> -odd -Ac -oi -- <[email protected]> mimedefang.pl[16650]: DFB4B35E3265: debug_resendmsg_resent_and_deleted_<[email protected]> If I remove the custom "if" clause from filter_end() and send another e-mail then this is what I get in the log (no call to resend_message): mimedefang.pl[22093]: 7274235E33E7: debug_resendmsg_d1_2_test 2 mimedefang.pl[22093]: 7274235E33E7: debug_resendmsg_d2_<[email protected]>_test 2 mimedefang.pl[22093]: 7274235E33E7: debug_resendmsg_d3_<[email protected]>_test 2 So since I'm getting the same number of lines on the log regarding "debug_resendmsg_d{1,2,3}" then I'm assuming I'm getting just one run through the filter. BTW I also tried running this command manually and it worked fine (I could send an e-mail correctly): /usr/sbin/sendmail -f<[email protected]> -odd -Ac -oi -- <[email protected]> Like I said before, I'm using Postfix but the sendmail interface seems to work fine. What am I doing wrong? Vieri _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang