On 2012-02-21 2:39 PM, Tanstaafl <tan...@li...> wrote:
> On 2012-02-21 1:07 PM, David Goodwin<da...@co...> wrote:
>>>> Maybe add an elseif in there, so something like:
>>>>
>>>> if($address =~
>>>> /^(noreply|postmaster|mailer\-daemon|listserv|majordomo|owner\-|request\-|bounces\-)/i
>>>> ||
>>>> $address =~ /\-(owner|request|bounces)\@/i ) {
>>>> $logger->debug("sender $address contains $1 - will not send
>>>> vacation message");
>>>> exit(0);
>> }
>>>> elseif($address = /^*(linkedin|facebookmail|twitter|myspace)*/i) {
>>>> $logger->debug("sender $address contains $1 - will not send
>>>> vacation message");
>>>> exit(0);
>>>> }
>>
>>
>> The above ought to work. I've added a missing ) on line 4 ($address =~ /.…….@/i )<--
>> and a missing } after the 'exit(0)'.
>
> Cool, I'll give it a shot...
Ok, applied the change, sent a test message to someone that I know who
has vacation enabled (just to make sure normal vacations work properly),
and got the following error:
Feb 21 14:47:59 myhost postfix/pipe[8670]: BBD4F9A0CC2:
to=<validuser#med...@au...>,
orig_to=<val...@me...>, relay=vacation, delay=0.92,
delays=0.29/0.01/0/0.63, dsn=5.3.0, status=bounced (Command died with
status 255: "/var/spool/vacation/vacation.pl". Command output: elseif
should be elsif at /var/spool/vacation/vacation.pl line 530. ^* matches
null string many times in regex; marked by <-- HERE in m/^* <-- HERE
(linkedin|facebook|twitter|myspace)*/ at /var/spool/vacation/vacation.pl
line 530. syntax error at /var/spool/vacation/vacation.pl line 530, near
") {" Global symbol "$address" requires explicit package name at
/var/spool/vacation/vacation.pl line 534. Global symbol "$address"
requires explicit package name at /var/spool/vacation/vacation.pl line
534. Global symbol "$address" requires explicit package name at
/var/spool/vacation/vacation.pl line 535. Global symbol "$address"
requires explicit package name at /var/spool/vacation/vacation.pl line
536. Global symbol "$address" requires explicit package name at
/var/spool/vacation/vacation.pl line 540. syntax error at
/var/spool/vacation/vacation.pl line 541, near "}" Execution of
/var/spool/vacation/vacation.pl aborted due to compilation errors. )
So, looks like it didn't like my wildcard?
|