Hi Rudy,
Ok, many thanks for that!
I applied the correction, and was still getting an error:
> 2012/02/22 10:41:37 DEBUG> /var/spool/vacation/vacation.pl:548 main:: - Script argument SMTP recipient is : 'validuser#med...@au...' and smtp_sender : 'val...@Me...'
> 2012/02/22 10:41:37 DEBUG> /var/spool/vacation/vacation.pl:578 main:: - Converted autoreply mailbox back to normal style - from validuser#med...@au... to val...@me...
> 2012/02/22 10:41:37 DEBUG> /var/spool/vacation/vacation.pl:588 main:: - Email headers have to: 'First Last <val...@me...>' and From: 'First Last <val...@Me...>'
> 2012/02/22 10:41:38 ERROR> /var/spool/vacation/vacation.pl:536 main::check_and_clean_from_address - Address is not valid; exiting
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|majordomo|mediapost|myspace|noreply|owner|plus.google|postmaster|request|twitter)/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 tested, and it seems to work just as I want. I even subbed a test
account to linkedin, and the confirmation email did not generate a
vacation message and it properly identified the LinkedIn string as the
reason...
So, I think I will keep this modification permanently...
Last question: is there any particular reason to test a combination of
the local part and the host part? Or would this modification seem
appropriate to incorporate into the core code? I'll be happy to submit a
patch if the devs think so...
Also, if there is a good reason for NOT doing it the way I'm doing it,
please by all means tell me! ;)
Thanks again Rudy...
Charles
|