On 2012-02-22 7:37 PM, Christian Boltz <pos...@cb...> wrote:
> Am Mittwoch, 22. Februar 2012 schrieb Tanstaafl:
>> So, seeing that this is most likely caused by something weird with the
>> elsif, I decided to just replace the whole shebang with my new string
>> line, like so:
>>> sub check_and_clean_from_address {
>>>
>>> my ($address) = @_;
>>> my $logger = get_logger();
>>>
>>> if($address =~
>>> /^(bounce|daemon|facebook|linkedin|listserv|mailer|majord
>>> omo|mediapost|myspace|noreply|owner|plus.google|postmaster
>>> |request|twitter)/i ) {
> This checks for addresses _starting with_ the texts in the list - I
> doubt you want that for myspace or plus.google ;-)
Far be it from me to argue with someone who obviously has much more
programming knowledge, but my (one tiny little) test seems to say
otherwise... maybe you can point out where my understanding is falling
short?
Here is the excerpt from vacation.log for my test:
2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:548 main:: -
Script argument SMTP recipient is :
'ValidUser#med...@au...dia-brokers.c
om' and smtp_sender :
's-X...@bo...'
2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:578 main:: -
Converted autoreply mailbox back to normal style - from
ValidUser#media-brokers.com@autore
ply.media-brokers.com to Val...@me...
2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:588 main:: -
Email headers have to: 'First Last <Val...@me...>' and
From: 'LinkedIn E
mail Confirmation <ema...@li...>'
2012/02/22 11:23:36 DEBUG> /var/spool/vacation/vacation.pl:531
main::check_and_clean_from_address - sender LinkedIn Email Confirmation
<ema...@li...
> contains LinkedIn - will not send vacation message
As you can see, the envelope sender definitely doesn't start with
'linkedin', and in the last line it says it is not sending because it
'contains LinkedIn'...
> If you want to check for the domain part, you should use something like
Actually, what I want is to test the *entire* envelope sender address -
ie, I don't want to differentiate between the local and host parts, if
the string is contained on *either*, I want the test to return true.
> if ($address =~ /@(myspace|plus\.google|linkedin)/i {
>
> Note that a dot has to be escaped as \. - otherwise it's interpreted as
> "any character". In other words: "plus.google" of course matches
> "plus.google", but it also matches "plus4google".
Ok, thanks, fixed that in my current setup...
One other question - am I correct that the string 'facebook' would also
be a positive match for something coming from 'facebookmail.com', since
facebookmail contains facebook?
> Please specify the domains as exact as possible - I'd guess
> plus\.google\.com would be better than just plus\.google.
> If you specify the whole domain everywhere, you can (and should) add a $
> to the regex (which matches the end of the string - in other words:
> plus\.google\.com$ will not match "plus.google.com.is.funny.com"
> (without the $, it would match)
I honestly don't care about that use case...
I am *much* more concerned about *not* replying when I *shouldn't* than
I am about *replying* when it *should*...
Understand - I am one of those who sees vacation responder systems as
*evil* - albeit a necessary one for businesses.
I make it very clear to my users that our vacation system is configured
in such a way as to *always* err on the side of safety, and that a
vacation message should *not* be replied upon for business critical
situations - if money is on the line, pick up the phone.
> VIRTUAL_VACATION/tests/ has some test mails and a test script.
Interesting, I'll give it a look, thanks...
> It would be nice to have more test mails there - can you provide the
> linkedin mail (with all headers), please?
Attached...
>> Also, if there is a good reason for NOT doing it the way I'm doing it,
>> please by all means tell me! ;)
> In general, vacation.pl has a quite difficult job: it must reply to all
> mails - except if it must NOT reply to a mail ;-) In other words: false
> positives and false negatives are both bad, and the goal is to limit
> those to a very small percentage. This also means that checks need to be
> as specific as possible.
I understand what you are saying, and agree that the *defaults* should
always be as safe and precise as possible, but as I said above, I - and
there are *many* others like me - look at vacation responders
differently... I do *not* consider a non-reply when it maybe should have
replied as all that bad... if avoidable, sure, but not even *remotely*
as bad as replying when it shouldn't. On top of that, I prefer simple,
and having a single check that examines the entire envelope sender just
seems simpler/cleaner to me.
> IMHO we should have a separate check for the domain part. Reasons:
> - easier to read regex (avoid monster regex whenever possible)
> - easier when adding more "do not reply" domains
> - the domain part check could even use an array instead of a regex,
> which makes customization easier
Totally agree, especially if there could be a GUI option for managing
these domain strings...
> If there are cases where the combination of localpart and domain is
> relevant, then I'll of course accept such a check. However I can't
> imagine that this happens with real-world mails (feel free to prove me
> wrong ;-) and therefore prefer separate checks for localpart and domain.
Agree as well...
Another thought - maybe my new simpler check for the entire envelope
sender address (once we are all sure it is working like I want/expect)
could be added as an optional (commented out) 'paranoid' section, with
comments explaining the differences, and that it may/will be more prone
to false positives (ie, not sending a reply when it maybe should)?
Thanks for taking the time to discuss this with me Christian... I'll be
keeping a close watch on the vacation.log for the next few days/weeks,
to make sure everything is working like I want.
|