Corrections to previous post below, and also an additional question...
On 2013-03-13 11:43 AM, Tanstaafl <tan...@li...> wrote:
> 1. only ONE new variable that contains all of the predetermined strings,
> and
Sorry, sent that too soon without proofing. This should have all read:
There are two advantages to this...
1. Only the new variable (with pre-determined defaults) is needed
instead of a new option and a new variable with just a comment
explaining how to modify this variable to include new strings or tweak
existing ones or even remove them if they are causing too many false
positives:,
So we'd now have (which can also optionally go into vacation.conf):
> # This is the list of strings that is checked against both the
> # envelope sender and any/all From header addresses that, if
> # matched, results in the vacation message not being sent.
> # MODIFY AT YOUR OWN RISK!
> our $noreply_pattern =
> 'bounce|do-not-reply|facebook|linkedin|list-|listserv|mailer\-daemon|majordomo|myspace|noreply|owner\-|\-(owner|request|bounces)|postmaster|request\-|twitter';
Then the new 'sub check_and_clean_from_address' function would be
something like:
> sub check_and_clean_from_address {
> my ($address) = @_;
> my $logger = get_logger();
>
> if($address =~ /^.*($noreply_pattern).*/i) ) {
> $logger->debug("sender $address contains $1 - will not send vacation message");
> exit(0);
> }
> $address = strip_address($address);
> if($address eq '') {
> $logger->error("Address $address is not valid; exiting");
> exit(0);
> }
> #$logger->debug("Address cleaned up to $address");
> return $address;
> }
>
> And finally, last question...
>
> What is the practical limit on the number of characters that can be
> included in this variable?
One other question, already asked in a prior email, is...
Am I correct in my comments, that BOTH the envelope sender and any other
From headers are tested? Or does this check_and_clean_from_address
function only test the envelope sender? If so (and I think it might),
then we may need to have two new variables:
$noreply_pattern_envelope
$noreply_pattern_header
and appropriate comment changes.
> So, before I enable these changes, what do you think? If this looks
> correct, I'll enable it and test it live for the next few weeks on my
> server...
>
> Thanks again Rudi!
|