procmailrc to match body
Julianony M <[email protected]> Sat, 31 Jan 2015 15:13:32 -0600
| Newsgroups | gmane.mail.procmail |
|---|---|
| Message-ID | <CAK6qzc=xeRFma1W7taA3yJRaH3Rbjo70ks1QvEeoh40kw38Y3w@mail.gmail.com> |
I wrote a set of procmailrc recipes to "quarantine" certain category of incoming mails to my site. It works with 3 simple steps: when a mail meets certain criteria, it triggers a "quarantine" process by (1) holding the mail while send a confirmation mail to the sender; (2) when the confirmation mail is replied by the sender, the mail gets delivered normally; (3) when the confirmation mail is bounced, the mail is trashed. So far everything worked well. Lately I noticed a minor problem with my recipes to recognize certain bounced mails (a small proportion of all bounced). My recipe to catch bounces is like: :0 * ^FROM_DAEMON|^FROM_MAILER * ^To:.*([email protected]) { :0 B * ^.*Verify the mail you sent: \/[0-9a-zA-Z\.]+ { MATCHED="$MATCH" :0 fw | cat "$MAILDIR/QUARRENTEEN/$MATCHED" >> $SPAM; :0 a | echo 'bounced, go to spam' > "$MAILDIR/QUARRENTEEN/$MATCHED" } :0 e /var/mail/Mail-error } which works well for most except one type of bounces from certain mail daemon, with multi-parts: ----------start quote--------------------- From: Mail Delivery Subsystem <[email protected]> Subject: Returned mail: see transcript for details (omitted) [ Part 2: "Delivery Status" ] (omitted) [ Part 3: "Included Message" ] Date: Wed, 28 Jan 2015 14:05:32 -0600 From: [email protected] To: [email protected] Subject: Verify the mail you sent: 20150128.140532KAMGTNXTV This mail hub is withholding a mail just received from you: - sent to <[email protected]> - with the Subject: "Find lost or stolen items from your iPhone." This is to verify that the mail from your mailbox is not a spam. Please confirm by replying this mail (no need to write anything; only be sure to include this mail in the reply, and leave the Subject line and mail body as they are): Verify the mail you sent: 20150128.140532KAMGTNXTV Your mail will be automatically delivered when the system receives this confirmation from you. Thank you. ----------------end quote----------------------- which fell into "Mail-error". It appears the body match failed. Any advice how the recipe should be modified in order to catch this? Thanks, joe ____________________________________________________________ procmail mailing list Procmail homepage: http://www.procmail.org/ [email protected] http://mailman.rwth-aachen.de/mailman/listinfo/procmail