I'm trying to set up a Dovecot and Postfix mailserver. My wishes for the server:

  • SMTP (secure if is it an option?)
  • Both IMAPS and SMTP must require an user from MySQL, same table.
  • Mails are stored as maildir in /home/mail/domain/account

That's it so far I think, however I succeeded to mess something somewhere. Right now I'm stuck at receiving mails, which I believe is the first part.

I get this this in mail.

Sep  1 22:04:38 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Sep  1 22:04:38 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: connect from xxx.yyy.dk[xx.xx.200.10]
Sep  1 22:04:38 Debian-60-squeeze-64-minimal dovecot: auth(default): new auth connection: pid=9490
Sep  1 22:04:39 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: 06A5118F4F19: client=xxx.yyy.dk[xx.xx.200.10]
Sep  1 22:04:39 Debian-60-squeeze-64-minimal postfix/cleanup[9493]: 06A5118F4F19: message-id=<090BEFE4-DEE6-4A94-80F3-F9574044358E@yyy.dk>
Sep  1 22:04:39 Debian-60-squeeze-64-minimal postfix/qmgr[9342]: 06A5118F4F19: from=<zzz@yyy.dk>, size=11227, nrcpt=1 (queue active)
Sep  1 22:04:39 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: disconnect from xxx.yyy.dk[xx.xx.200.10]
Sep  1 22:04:39 Debian-60-squeeze-64-minimal postfix/qmgr[9342]: warning: connect to transport private/dovecot: No such file or directory
Sep  1 22:04:39 Debian-60-squeeze-64-minimal postfix/error[9494]: 06A5118F4F19: to=<uuu@hhh.dk>, relay=none, delay=0.14, delays=0.13/0.01/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)

This line in mail.warn

Sep  1 22:04:38 Debian-60-squeeze-64-minimal postfix/smtpd[9490]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled

Please, not just a link to a tutorial, have tried the whole day to figure this one out. Thanks.

I have this main.cnf

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
#delay_warning_time = 4h
myhostname = xxx.dk
myorigin = xxx.dk
mydestination = localhost, localhost.localdomain
relayhost =
mynetworks =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

# Virtual mailbox settings
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_base = /home/mail
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
# SASL Authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
message_size_limit = 30720000
virtual_alias_domains =
smtpd_sasl_authenticated_header = yes
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $send$

This is the relevant line in master.cf I think

maildrop unix - n n - - pipe 
flags=DRhu user=mail argv=/usr/lib/dovecot/deliver -d ${recipient}

This happens if I execute /usr/lib/dovecot/deliver I think I can execute it.

# /usr/lib/dovecot/deliver
Fatal: destination user parameter (-d user) not given


# /usr/lib/dovecot/deliver -d emil

(nothing happens then). Neither cases provided any folders in /home/mail

  • In the log your transport is given as dovecot but in your master.cf you showed maildrop. This does not match. Which is the correct one? Or which transport is returned by mysql-virtual_transports.cf? – mailq Sep 2 '11 at 20:43

The NIS error is irrelevant. You likely have an entry nis in your postfix/dynamicmaps.cfg, which you can remove/comment out because you are not using NIS (I hope).

What happens with your mail is that Postfix can't connect to your Dovecot server. What is the relevant line in your postfix/master.cfg?

  • The one with dovecot in the first column. If there is none then this is the problem. If there is one then you didn't provide the full path to deliver. – mailq Sep 2 '11 at 10:01
  • These are the lines in dynamicmaps.cf: tcp /usr/lib/postfix/dict_tcp.so dict_tcp_open (line break) mysql /usr/lib/postfix/dict_mysql.so dict_mysql_open This is the relevant in master.cf i think maildrop unix - n n - - pipe (line break) flags=DRhu user=mail argv=/usr/lib/dovecot/deliver -d ${recipient} — sorry for the format, I'm not sure if I can post this reply any better? – Emil Sep 2 '11 at 10:09
  • @Emil: You can always edit your original question to add info, like I did now. Can you execute /usr/lib/dovecot/deliver? – Sven Sep 2 '11 at 10:30

I have found this tutorial which I'm following now, it's very good and descriptive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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