Ok, its been almost a week, and this is working perfectly...
Rudi, did you get a chance to look at this yet? It (just the one new
variable, only one test performed in the 'sub
check_and_clean_from_address' function) is so much simpler than what we
had before (a new option and new variable, and 3 tests in the 'sub
check_and_clean_from_address' function)...
Thanks again for your help!
Charles
Quoting the relevant part of my last email on this, showing what I am
using now)...
On 2013-03-13 11:43 AM, Tanstaafl <tan...@li...> wrote:
<snip>
> Wouldn't it make more sense to adjust the defaults for the custom
> pattern to include all of the values in the immediately prior two tests,
> and change this to just the one test, instead of basically having three
> separate tests (one to test the local part, the next to test the domain
> part, and finally our new custom one to test the whole thing?
>
> And if this is ultimately the desired goal, we could rename the
> variables one last time, and end up with something like:
>
> # 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.
> 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;
>> }
|