This article describes how to configure Postfix to blindly accept all emails, meaning receive email without checking the recipient. This setup is useful as a backup or archive mail destination.

Create the Virtual Mail User Account

Create user vmail1. Create a new user, we will call it vmail. Change the Login Shell to /sbin/nologin, this user account should not be used for logging in. Learn how to use the User Manager application here.
User Manager2. Take note of the User ID and Home Directory of vmail.
User Manager3. Click the Groups tab and now note down the Group ID of vmail. We’ll be needing all of them later.

Configuring Postfix and Dovecot

Service Configuration1. Edit the file /etc/postfix/ and add the lines below.
virtual_transport = dovecot
virtual_mailbox_domains = $mydomain
Service Configuration2. Edit the file /etc/dovecot.conf and add the lines below.
userdb static {
  args = uid=501 gid=501 home=/home/vmail/%u allow_all_users=yes

socket listen {
  master {
    path = /var/run/dovecot/auth-master
    mode = 0600
    user = vmail
    group = vmail

uid, gid and home should contain the user id, group id and home directory respectively of the vmail user account.

NoteComment out all the other passdb and userdb sections except for those specified above to ensure that nothing will conflict with our virtual accounts setting.
Service Configuration3. Restart the Postfix or MailScanner service if you have installed it. Do the same for Dovecot. Learn how to start and stop services here.
NoteIf you encounter any problems, check the log file at /var/log/maillog.

Visit the forum to ask for help or to give a comment.

Posted on 2/13/2010 and last updated on 3/21/2010
Filed under Postfix