procmail
[Top] [All Lists]

Re: Adjusting FROM_DAEMON

2009-04-17 18:22:51
mark david mcCreary wrote:
On Apr 17, 2009, at 1:46 PM, RGBall wrote:

mark david mcCreary wrote:
I'm running mailing lists with Smartlist, and running into valid emails addresses that get caught by the FROM_DAEMON regexp.

For example, markdavid(_at_)hushmail(_dot_)com, or 
mark91010-mail(_at_)yahoo(_dot_)com(_dot_)

Looks like FROM_DAEMON expands to (^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^((_dot_)%(_at_)a-z0-9])?(Post(ma(st(er)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|r(esponse|oot)|(bbs\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istrator)?|MMGR))(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\(.*\).*)?)?$([^>]|$))|^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^((_dot_)%(_at_)a-z0-9])?(LIST(SERV|proc)|NETSERV|bounce|autoanswer|echo|mirror)(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\(.*\).*)?)?$([^>]|$)

so my first thought is to tweak this regular expression, and then replace FROM_DAEMON with my new version in the Procmail recipe. That way I won't have to touch the Procmail source code.

If you have any wisdom your want to share on this endeavor, or have tweaked this yourself, I'm all ears.

In the years I ran Smartlist I never had a failure like that (the other way around, yes). What makes you think that this regexp is triggered on those addresses and, if you are going to mess with it, which part of the regexp is matching those addresses?

When I had to get into the guts of Smartlist's rules I spent a fair amount of time adding debugging log output to make very certain I was where I thought I was and why; it paid off more than once.



Rich

Thanks for the feedback. I've had complaints about messages disappearing, and when I investigate, it's this recipe that's grabbing them.


TODAY=`date "+%Y-%m-%d %T"`
SENDER=`$formail -rtzx To:`

#  weighted scoring to determine if it's a from a mailer_daemon
#  The E flag executes only if the preceding receipe did not
#

:0 h
* $$daemon_bias
* -100^0 ^FROM_DAEMON|\
         ^(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )\
          ([^>]*[^((_dot_)%(_at_)a-z0-9])?(\
           LIST(SERV|proc)|NETSERV|bounce|autoanswer|echo|mirror\
)(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\(.*\).*)?)?$([^>]|$)
* 1^0
{ }

:0 Ehwi : log.lock
| $echo -e "$list\t$TODAY\tSubmit\t$SENDER" >>$mailer_daemon_dropped



And I've run some tests by hand, and the logs say

test-ind-plain    2009-04-16 22:14:34    Submit    
markdavid(_at_)hushmail(_dot_)com
test-ind-plain    2009-04-17 18:08:27    Submit    
markdavid(_at_)hushmail(_dot_)com
test-ind-plain 2009-04-17 18:21:28 Submit mark91010-mail(_at_)yahoo(_dot_)com


So it may not be FROM_DAEMON, but something in that rather complicated regexp is snaring the email.
The difficulty is that regexp is looking at a bunch of header information so without the full headers of the test message(s) it isn't possible to even start to determine what is getting caught. From your expansion of the FROM_DAEMON headers like Resent-from:, Sender:, X-Envelope-From:, etc. are all getting looked at not just the From: address.

The place to start is with the full email of something that always gets caught, then break the above rule into two individually scored ones (FROM_DAEMON as one, the rest is the other) to see which one triggers. That should get you closer.

Rich

Now which part of the regexp, I do not know at this time. The word mail seems to be the common element at the moment, but I've also had complaints from people with email addresses like administrator(_at_)xyz(_dot_)com(_dot_) I don't have as much sympthay for them, but these other examples it's tough to argue with.

So I think I am close to the spot that needs tweaking, but exactly what to do next is unclear.

mark




____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>