I am using Postfix & Dovecot on a VPS (Ubuntu 15.04 64 bits) at OVH in France for a small user base (a big dozen of users, mostly my family, less than a thousand email/day, including spam) for two DNS domains, let's call them starynk.net & melt.org (the actual ones are slightly different, but you could guess them easily). Most of the emails are to starynk.net, and a very few email addresses on melt.org might be aliases to @starynk.net

postfix package is version 2.11.3-1ubuntu1, dovecot-core package is 1:2.2.9-1ubuntu5

I followed carefully the instructions on http://www.binarytides.com/install-postfix-dovecot-debian/ and it works (at last!) because I can send & receive mails on my home Debian Linux PC (which is not the VPS server at OVH) to my address [email protected]

I guess that the significant configuration is in my /etc/postfix/main.cf :

# grep virtual /etc/postfix/main.cf 
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_domains = /etc/postfix/virtual_mailbox_domains

with the file /etc/postfix/virtual_mailbox_domains containing:

# file /etc/postfix/virtual_mailbox_domains by Basile
starynk.net OK
melt.org OK

I want to add some alias emails for starynk.net (e.g: [email protected] -> [email protected] ....) and for melt.org (e.g. [email protected] -> [email protected])

Of course, editing /etc/aliases then running newaliases does not work.

I guess that I need virtual alias domains so I probably need to add somewhere in /etc/postfix/main.cf (but is the order important there?) a line like

 virtual_alias_domains = starynk.net melt.org
 virtual_alias_maps = hash:/etc/postfix/virtualaliases

(is that correct? is that compatible with the existing settings?)

and finally put in that new /etc/postfix/virtualaliases file lines like

## file /etc/postfix/virtualaliases by Basile
[email protected]: [email protected]
[email protected]: [email protected]
[email protected]: [email protected], [email protected] 
[email protected]: [email protected]

When I run as root postmap /etc/postfix/virtualaliases it looks I am getting warnings for every entry:

postmap: warning: /etc/postfix/virtualaliases, line 2: record is in "key: value" format; is this an alias file?
postmap: warning: /etc/postfix/virtualaliases, line 3: record is in "key: value" format; is this an alias file?
postmap: warning: /etc/postfix/virtualaliases, line 4: record is in "key: value" format; is this an alias file?
postmap: warning: /etc/postfix/virtualaliases, line 5: record is in "key: value" format; is this an alias file?

but then, what is the newaliases command to run after editing the file above? Can it accept pipe notation as documented in Postfix' aliases(5) ?

At last, how to test the configuration of a Postfix system? is there a Postfix command (which I would use to test my new Postfix configuration) explaining what happens to an email to [email protected] without having to send an actual email ?

not working yet!

I am doing service postfix restart after the postmap command but it does not work:

<[email protected]>: host
mail.starynk.net[private/dovecot-lmtp] said: 550 5.1.1
<[email protected]> User doesn't exist:
[email protected] (in reply to RCPT TO command)


 Reporting-MTA: dns; mail.starynk.net
 X-Postfix-Queue-ID: 4BDE761BFE
 X-Postfix-Sender: rfc822; [email protected]
 Arrival-Date: Thu, 31 Dec 2015 10:08:07 +0100 (CET)

 Final-Recipient: rfc822; [email protected]
 Original-Recipient: rfc822;[email protected]
 Action: failed
 Status: 5.1.1
 Remote-MTA: dns; mail.starynk.net
 Diagnostic-Code: smtp; 550 5.1.1 <[email protected]> User doesn't
   exist: [email protected]

working (sortof)

I finally managed to have something working. My /etc/postfix/virtualaliases file has lines like:

# file /etc/postfix/virtualaliases by Basile without colons or commas
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected] [email protected] 
[email protected] [email protected]

(of course I have to run postmap /etc/postfix/virtualaliases after every change)

but I still don't understand how could I have some alias to a Unix command pipe, and I am surprised by the lack of commas (which virtual(5) is suggesting)

  • Have you tried without virtual_alias_domains? In my setup i have only virtual_alias_maps configured and i have several domains. See docs for an explanation of those two.
    – Joe
    Dec 31, 2015 at 10:13

1 Answer 1


If you use virtual_alias_maps = hash:/my/file as written in the postfix man page, you have to create the database with postmap /my/file everytime you change /my/file.

I don't know any function ir feature of postfix, which provides a "dry-run" action. You should test it in a VM locally, using a local dns and mailserver.

It won't affect any other configuration option.

  • But virtual_alias_maps won't interfere with other settings, including virtual_mailbox_domains ? Dec 30, 2015 at 21:18
  • No. Every configuraton option accepts its own database. It also possible to connect it to an ldap server or a mysql database. The default type is a postmap.
    – user149441
    Dec 30, 2015 at 21:20
  • Setting one option does not affect another one as long as there are no config errors. (Trying to redirect a alias whoes domain is not listed.)
    – user149441
    Dec 30, 2015 at 21:21
  • @EllDevender: it would be nice if you could edit your answer.... Dec 31, 2015 at 8:56
  • @EllDevender: I did the modification, and it does not work. How should I debug the issue? Dec 31, 2015 at 8:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .