Skip to content

Instantly share code, notes, and snippets.

@slopjong
Last active August 29, 2015 14:01
Show Gist options
  • Save slopjong/ee34eb0eb4d57608a10e to your computer and use it in GitHub Desktop.
Save slopjong/ee34eb0eb4d57608a10e to your computer and use it in GitHub Desktop.

Postfix doesn't deliver to virtual mailbox

Note: myhost.myserver.com is a placeholder for the real domain used in the config file

Question 1:

transport_maps is missing, dumb question: should I add it? What does the file content exactly look like?

Question 2:

mailbox_command wrong?

Question 3:

master.cf says

Specify in main.cf one or more of the following:

mailbox_transport = lmtp:inet:localhost

virtual_transport = lmtp:inet:localhost


None of both is in main.cf, is xxxx_transport a requirement?


**File: /etc/passwd**

... virtual:x:1002:1002::/var/spool/vmail:/bin/false ...


**File: /etc/group**

... virtual:x:1002: ...


**File: /etc/hosts**

... 86.68.12.51 myhost.myserver.com myhost ...


**$ postconf -n**

append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes config_directory = /etc/postfix inet_interfaces = all inet_protocols = all mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir mailbox_size_limit = 0 mydestination = myhost.myserver.com, localhost.localdomain, , localhost mydomain = myhost.myserver.com myhostname = myhost.myserver.com mynetworks = 86.68.12.0/24 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = myhost.myserver.com readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous smtpd_tls_cert_file = ... smtpd_tls_key_file = ... smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_gid_maps = static:1002 virtual_mailbox_base = /var/spool/vmail virtual_mailbox_domains = /etc/postfix/db/virtual_mailbox_domains virtual_mailbox_maps = hash:/etc/postfix/db/virtual_mailbox_maps virtual_uid_maps = static:1002


**File: /etc/postfix/db/virtual_mailbox_domains**

... adomain.com ...


**File: /etc/postfix/db/virtual_mailbox_maps**

... [email protected] adomain.com/admin/ ...


**$ tree /var/spool/vmail**

-- adomain.com |-- admin | |-- courierimapkeywords | |-- courierimapsubscribed | |-- courierimapuiddb | |-- cur | |-- new | -- tmp


**File: /etc/postfix/master.cf**

smtp inet n - - - - smtpd #smtp inet n - - - 1 postscreen #smtpd pass - - - - - smtpd #dnsblog unix - - - - 0 dnsblog #tlsproxy unix - - - - 0 tlsproxy #submission inet n - - - - smtpd

-o syslog_name=postfix/submission

-o smtpd_tls_security_level=encrypt

-o smtpd_sasl_auth_enable=yes

-o smtpd_client_restrictions=permit_sasl_authenticated,reject

-o milter_macro_daemon_name=ORIGINATING

#smtps inet n - - - - smtpd

-o syslog_name=postfix/smtps

-o smtpd_tls_wrappermode=yes

-o smtpd_sasl_auth_enable=yes

-o smtpd_client_restrictions=permit_sasl_authenticated,reject

-o milter_macro_daemon_name=ORIGINATING

#628 inet n - - - - qmqpd pickup fifo n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - n 300 1 oqmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp

-o smtp_helo_timeout=5 -o smtp_connect_timeout=5

showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache


**File: /var/log/mail.warn**

May 17 09:57:47 myhost postfix/master[13917]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling May 17 09:57:47 myhost postfix/master[13917]: warning: process /usr/lib/postfix/virtual pid 14039 exit status 1 May 17 09:57:47 myhost postfix/qmgr[13950]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description May 17 09:57:47 myhost postfix/qmgr[13950]: warning: private/virtual socket: malformed response May 17 09:57:46 myhost postfix/virtual[14039]: fatal: unable to use my own hostname May 17 09:57:46 myhost postfix/virtual[14039]: warning: valid_hostname: numeric hostname: 86.68.12.51


**File: /var/log/mail.err**

May 17 09:57:46 myhost postfix/virtual[14039]: fatal: unable to use my own hostname


**File: /var/log/mail.info**

May 17 09:57:47 myhost postfix/error[14043]: 302722F9C8041: to=[email protected], relay=none, delay=1.1, delays=0.05/1/0/0, dsn=4.3.0, status=deferred (unknown mail transport error) May 17 09:57:47 myhost postfix/master[13917]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling May 17 09:57:47 myhost postfix/master[13917]: warning: process /usr/lib/postfix/virtual pid 14039 exit status 1 May 17 09:57:47 myhost postfix/qmgr[13950]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description May 17 09:57:47 myhost postfix/qmgr[13950]: warning: private/virtual socket: malformed response May 17 09:57:46 myhost postfix/virtual[14039]: fatal: unable to use my own hostname May 17 09:57:46 myhost postfix/virtual[14039]: warning: valid_hostname: numeric hostname: 86.68.12.51 May 17 09:57:46 myhost postfix/qmgr[13950]: 302722F9C8041: from=[email protected], size=454, nrcpt=1 (queue active) May 17 09:57:46 myhost postfix/cleanup[14037]: 302722F9C8041: message-id=[email protected] May 17 09:57:46 myhost postfix/pickup[13951]: 302722F9C8041: uid=0 from= May 17 09:57:41 myhost postfix/master[13917]: daemon started -- version 2.9.6, configuration /etc/postfix May 17 09:57:41 myhost postfix/master[11315]: terminating on signal 15 May 17 09:57:41 myhost authdaemond: Installation complete: authuserdb May 17 09:57:41 myhost authdaemond: Installing libauthuserdb May 17 09:57:41 myhost authdaemond: modules="authuserdb", daemons=5 May 17 09:57:41 myhost authdaemond: stopping authdaemond children

Note: myhost.example.com is a placeholder for the real domain used in the config file
======================================================================
/etc/hosts
86.68.12.51 myhost.example.com myhost
======================================================================
$ postconf -n
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = myhost.example.com, localhost.localdomain, , localhost
mydomain = myhost.example.com
myhostname = myhost.example.com
mynetworks = 86.68.12.0/24 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = myhost.example.com
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_tls_cert_file = <filepath_to_pem>
smtpd_tls_key_file = <filepath_to_key>
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_gid_maps = static:1002
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_domains = /etc/postfix/db/domains
virtual_mailbox_maps = hash:/etc/postfix/db/valias
virtual_uid_maps = static:1002
---------
=> transport_maps is missing, dumb question: should I add it?
=> what does the file content _exactly_ look like?
=> the mail server worked fine a while back (and before an update)
transport_maps = hash:/etc/postfix/db/transport
---------
=> mailbox_command is missing, do I need it?
---------
=> master.cf says
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
None of both is in main.cf, as the mail server worked some time ago
(but before update) is xxxx_transport a requirement?
======================================================================
valias
[email protected] example.com/admin/
======================================================================
/var/log/mail.warn
May 16 08:11:50 myhost postfix/qmgr[25727]: warning: private/virtual socket: malformed response
May 16 08:11:49 myhost postfix/virtual[26393]: fatal: unable to use my own hostname
May 16 08:11:49 myhost postfix/virtual[26393]: warning: valid_hostname: numeric hostname: 86.68.12.51
May 16 08:09:01 myhost postfix/local[26204]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
May 16 07:51:50 myhost postfix/master[25686]: warning: process /usr/lib/postfix/virtual pid 23999 exit status 1
May 16 07:51:50 myhost postfix/qmgr[25727]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description
May 16 07:51:50 myhost postfix/qmgr[25727]: warning: private/virtual socket: malformed response
May 16 07:51:50 myhost postfix/master[25686]: warning: process /usr/lib/postfix/virtual pid 24000 exit status 1
May 16 07:51:50 myhost postfix/qmgr[25727]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description
May 16 07:51:50 myhost postfix/qmgr[25727]: warning: private/virtual socket: malformed response
May 16 07:51:50 myhost postfix/master[25686]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling
May 16 07:51:50 myhost postfix/master[25686]: warning: process /usr/lib/postfix/virtual pid 23998 exit status 1
May 16 07:51:50 myhost postfix/qmgr[25727]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description
May 16 07:51:50 myhost postfix/qmgr[25727]: warning: private/virtual socket: malformed response
======================================================================
/var/log/mail.err
May 16 08:26:49 myhost postfix/virtual[29779]: fatal: unable to use my own hostname
May 16 08:26:49 myhost postfix/virtual[29778]: fatal: unable to use my own hostname
May 16 08:11:49 myhost postfix/virtual[26393]: fatal: unable to use my own hostname
May 16 07:51:49 myhost postfix/virtual[23999]: fatal: unable to use my own hostname
May 16 07:51:49 myhost postfix/virtual[24000]: fatal: unable to use my own hostname
May 16 07:51:49 myhost postfix/virtual[23998]: fatal: unable to use my own hostname
May 16 07:41:49 myhost postfix/virtual[22442]: fatal: unable to use my own hostname
May 16 07:41:49 myhost postfix/virtual[22441]: fatal: unable to use my own hostname
May 16 07:36:49 myhost postfix/virtual[22199]: fatal: unable to use my own hostname
======================================================================
/var/log/mail.log
May 16 08:26:50 myhost postfix/error[29782]: B96A32F9C8042: to=<[email protected]>, relay=none, delay=67471, delays=67470/1/0/0.01, dsn=4.3.0, status=deferred (unknown mail transport error)
May 16 08:26:50 myhost postfix/error[29780]: F2BAD2F9C8046: to=<[email protected]>, relay=none, delay=67417, delays=67416/1/0/0.01, dsn=4.3.0, status=deferred (unknown mail transport error)
May 16 08:26:50 myhost postfix/master[25686]: warning: process /usr/lib/postfix/virtual pid 29779 exit status 1
May 16 08:26:50 myhost postfix/qmgr[25727]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description
May 16 08:26:50 myhost postfix/qmgr[25727]: warning: private/virtual socket: malformed response
May 16 08:26:50 myhost postfix/master[25686]: warning: /usr/lib/postfix/virtual: bad command startup -- throttling
May 16 08:26:50 myhost postfix/master[25686]: warning: process /usr/lib/postfix/virtual pid 29778 exit status 1
May 16 08:26:50 myhost postfix/qmgr[25727]: warning: transport virtual failure -- see a previous warning/fatal/panic logfile record for the problem description
May 16 08:26:50 myhost postfix/qmgr[25727]: warning: private/virtual socket: malformed response
May 16 08:26:49 myhost postfix/virtual[29779]: fatal: unable to use my own hostname
May 16 08:26:49 myhost postfix/virtual[29779]: warning: valid_hostname: numeric hostname: 86.68.12.51
May 16 08:26:49 myhost postfix/virtual[29778]: fatal: unable to use my own hostname
May 16 08:26:49 myhost postfix/virtual[29778]: warning: valid_hostname: numeric hostname: 86.68.12.51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment