How to Configure Postfix and Dovecot with Virtual Domain Users in Linux – Part 2

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

89 Responses

  1. Innus says:

    Hi, knowledgeable once. Can you please answer one of my question

    drwsrws--T  4  vmail                vmail 4096 Mar 14 17:15 .
    drwxr-xr-x 16   vmail                vmail 4096 Mar 14 13:15 ..
    drwxrws--T  4 fvmail                vmail 4096 Mar 14 17:11
    drwxrws--T  3   vmail               vmail 4096 Mar 14 17:15

    I want mailbox structure like this where and are domain which contain permission of root directory and inside domain for example , I want user permission like this

    drwxrws--T 4    vmail                            vmail 4096 Mar 14 17:11 .
    drwsrws--T 4    vmail                            vmail 4096 Mar 14 17:15 ..
    drwx--S--- 3       fzinnus123.fzela         vmail 4096 Mar 14 17:10 fzinnus123
    drwx--S--- 3       fzinnus123.fzela         vmail 4096 Mar 14 17:11 fzsaran123

    where fzinnus123 and fzsaran123 are users for domain.

    I tried a lots but unable to get in mycase my using virtual users

  2. Doug says:

    I love these kinds of articles, do any of them work?

    For all us newer users, this article would be fantastic if….Just post the complete config file for postfix/dovecot….Do the mods, file creation, databases, etc and done.

  3. Sandun says:


    I have configured a local email server according to your article. I am having a problem when connecting through thunderbird. It keeps saying the password is incorrect. But the password is correct. The dovecot.log gives the authentication failed error. Could you please help me on this?

  4. Tuboy Thers says:

    Hello Gabriel Cánepa, well done on the tutorial, I managed to follow it through and though I had to tweak a bit to get things going I finally did it and it’s working fine, I can receive messages!

    But I am afraid I cannot send such, sending to other addresses which doesn’t belong to the local host such,, etc. fails, as if the server is trying to connect them using SMTP.

    Here are few errors which might help you straight what I mean out:

    Sep 28 12:51:40 us00 postfix/smtp[2491]: connect to[]:25: Connection timed out
    Sep 28 12:51:40 us00 postfix/smtp[2491]: A25613F0E5: to=, relay=none, delay=227, delays=72/0.03/155/0, dsn=4.4.1, status=deferred (connect to[]:25: Connection timed out)

    Sep 28 12:51:35 us00 postfix/smtp[2490]: A42F93F0AC: to=, relay=none, delay=2358, delays=2208/0.02/150/0, dsn=4.4.1, status=deferred (connect to[]:25: Connection timed out)
    Sep 28 12:51:35 us00 postfix/smtp[2493]: 1692A3F0D8: to=, relay=none, delay=2278, delays=2128/0.04/150/0, dsn=4.4.1, status=deferred (connect to[]:25: Connection timed out)

    Please bare in mind that these two are email addresses hosted externally.

    I have followed all settings in the tutorial, my MX record is pointing to:mx.domain.tld, PTR to mx.domain.tld and mx.domain.tld A Record.

    I am honestly not sure what shall I tweak or do to make sure emails are going back and forth.

    Hopefully you can help!

  5. derek says:

    Centos 7.5, pointing dovecot log file to /var/log/dovecot.log with suggested permissions results with the following error.

    Jul 02 21:03:48 dovecot[5708]: Can’t open log file /var/log/dovecot.log: Permission denied

    Event chmod 777 /var/log/dovecot.log didn’t help

  6. Vicente says:

    The problem with de line argv=/usr/libexec/dovecot/deliver is the indentation. I have the error message “bad field count” until i put 2 spaces before the argv=.

  7. Le Dang Long says:

    help me! when i go to step

    Before you save changes, add the following lines at the bottom of the file:

    [[email protected] conf.d]# postfix check
    /usr/sbin/postconf: fatal: file /etc/postfix/ line 129: bad field count

    • Ravi Saive says:


      Go the line 129 in file and check for any extra spaces or use correct spacing..

      dovecot   unix  -       n       n       -       -       pipe
          flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
      • Adem Aksoy says:

        There needs to be space before “flags” (or after pipe). If you are copying and pasting, you need to add it manually.

        dovecot unix – n n – – pipe
        flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}

  8. SAJAL says:

    Hello Gabriel A. Cánepa,

    Me too have the same issue, Please comment on this. I have doubt the path “argv=/usr/libexec/dovecot/deliver” in line 134. Is it matching with your tutorial ? Actually that line needs a bit explanation, please consider. thanking you in advance….

    /usr/sbin/postconf: fatal: file /etc/postfix/ line 134: bad field count
    postfix/postlog: warning: inet_protocols: disabling IPv6 name/address support: Address family not supported by protocol
    postfix/postfix-script: fatal: cannot execute /usr/sbin/postconf!

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.