Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 and it's from postfixadmin.

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

share|improve this question
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 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:,

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

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

For completeness here is the entry in my

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

This means, that the 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

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

I was looking for the same thing, I'm running my email server using Webmin, the autoreply mails are executed using the script /etc/webmin/virtual-server/

By reading it I find this block:

if ($header{'x-mailing-list'} ||
$header{'list-id'} ||
$header{'precedence'} =~ /junk|bulk|list/i ||
$header{'to'} =~ /Multiple recipients of/i ||
$header{'from'} =~ /majordomo/i ||
$fromline =~ /majordomo/i) {
    # Do nothing if post is from a mailing list
    exit 0;

So I added an other condition $header{'to'} =~ /my_alias_name_here/i || that way it will never send autoreply to any email sent to that alias.

This is a quick hack, maybe I'll have some time later to make it list all the alias from the server. If you did it before please share the script :)

share|improve this answer

Your Answer


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.