Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an alias which has 20 mails accounts. So when a mail is sent to this alias, everyone receives it. But, when I set a vacation on one of those 20 mail accounts, the autoreply is sent as well. I want to exclude these cases - when the mail has not specific mail account in To: or Cc: header. The script is called vacation.pl and it's from postfixadmin.

Is there any way how to do it except for manual editing the script ?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

The short answer is "No". At least if your setup and script is similar to mine.


Today I had a closer look at the vacation.pl we use in combination with Postfixadmin.

I assume that it is the same, but one can never be sure, so be careful. In the first lines of the script it say the following about the version:

# Virtual Vacation 4.0
# $Revision: 893 $

In our case the activation of an automatic reply adds an entry like the following in the alias table of postfix:

user@example.com@autoreply.example.org,user@example.com

Which means that the email will be save to the mailbox of the User and forwarded to the autoreply-domain (autoreply.example.org).

In a transportmap there is a the following entry, which will pass the mail to the vacation service as defined in master.cf:

   autoreply.example.org    vacation:

For completeness here is the entry in my master.cf:

vacation unix - n n - - pipe
  flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} ${recipient}

This means, that the vacation.pl script is triggered after the aliases have been resolved.

So if you want to prevent automatic replies to emails, that have been sent to an alias you will need to add a function to the script, which will check the X-Original-To-Header, so you can make sure if the mail was sent to an Alias with more than one recipient.


Around line 312 a function find_real_address is defined. This function will search for the real address (user).

It could be possible to use a modified version this function in combination with the emailaddress in the X-Original-To-Header to only send an automatic reply if the emailaddress is not one of an alias with multiple recipients.


I have not tried any of the above suggestions yet, so be careful.

share|improve this answer
add comment

It all depends on where your vacation reply is generated; normally, this is done with a link to a script in the .forward file for the users' mailbox.

Since this does not work for virtual mailboxes, several alternatives exist - using a dedicated filter, transport, MDA, or milter.

And probably more.

You'll have to provide more detailed information, including at least the output from postconf -n and any map files that are relevant to this scenario.

Also include logging of a message being sent to this distribution list alias, and the resulting messages including the vacation reply.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.