-1

I'm trying to install Postfix with Dovecot and MySQL on CentOS 5. I'm new to this and I'm struggling on this more than 2 weeks. I followed this instruction https://www.linode.com/docs/email/postfix/email-with-postfix-dovecot-and-mysql-on-centos-5

But I don't get 220 line for my telnet command.

Here is my main.cf

sendmail_path = /usr/sbin/sendmail.postfix    
newaliases_path = /usr/bin/newaliases.postfix    
mailq_path = /usr/bin/mailq.postfix    
setgid_group = postdrop    
html_directory = no    
manpage_directory = /usr/share/man    
sample_directory = /usr/share/doc/postfix-2.3.3/samples

readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
myhostname = mail.mobz.ca
mynetworks = 127.0.0.0/8
message_size_limit = 30720000
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
virtual_create_maildirsize = yes
virtual_maildir_extended = 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 $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

/var/log/maillog doesn't contain any error.

netstat -plnt | grep master outputs

tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      5505/master

I don't know where to move from here. Please any hint on this?

Thanks in advance.

Updates:

I have found error in my maillog:

Sep  3 19:31:40 vps postfix/smtpd[5512]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:31:40 vps postfix/cleanup[5509]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:31:40 vps postfix/smtpd[5512]: warning: private/proxymap socket: service dict_proxy_open: Success
Sep  3 19:31:40 vps postfix/cleanup[5509]: warning: private/proxymap socket: service dict_proxy_open: Connection reset by peer
Sep  3 19:31:40 vps postfix/master[5505]: warning: process /usr/libexec/postfix/proxymap pid 10871 exit status 1
Sep  3 19:31:40 vps postfix/master[5505]: warning: /usr/libexec/postfix/proxymap: bad command startup -- throttling
Sep  3 19:32:40 vps postfix/proxymap[10872]: fatal: /etc/postfix/mysql-virtual_forwardings.cf: bad string length 0 < 1: dbname =
Sep  3 19:32:41 vps postfix/smtpd[5512]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:32:41 vps postfix/cleanup[5509]: warning: premature end-of-input on private/proxymap socket while reading input attribute name
Sep  3 19:32:41 vps postfix/cleanup[5509]: warning: private/proxymap socket: service dict_proxy_open: Connection reset by peer
Sep  3 19:32:41 vps postfix/smtpd[5512]: warning: private/proxymap socket: service dict_proxy_open: Success
Sep  3 19:32:41 vps postfix/master[5505]: warning: process /usr/libexec/postfix/proxymap pid 10872 exit status 1
Sep  3 19:32:41 vps postfix/master[5505]: warning: /usr/libexec/postfix/proxymap: bad command startup -- throttling
  • 2
    What telnet command are you using, and from where are you running the command? – EEAA Sep 3 '14 at 2:42
  • I'm running it from localhost - telnet localhost 25 – Vahan Sep 3 '14 at 10:48
  • Just wondered why my question is downvoted. No metter how I work hard on my question somebody should downvote :-) At least help me to improve my question by commenting why it is downvoted. – Vahan Sep 3 '14 at 10:50
  • Please try to debug postfix behavior, either via debug_peer_list or turning on verbose switch. If you still in doubt, put the output in that question. – masegaloeh Sep 3 '14 at 11:45
  • Thanks, @masegaloeh. Now I'll have at least something to try :) – Vahan Sep 3 '14 at 13:50
2

The key here is fatal error message in your maillog. The error message

fatal: /etc/postfix/mysql-virtual_forwardings.cf: bad string length 0 < 1: dbname =

indicated that your /etc/postfix/mysql-virtual_forwardings.cf was messed up. It's confirmed when I look the tutorial you followed (linode web).

The format of mysql maps in /etc/postfix/mysql-virtual_forwardings.cf is very very wrong. You mustn't place multiple parameter in one line. Looks like the formatting engine in linode messed up the tutorial or the author forgot to check whether the syntax was OK or not.

user = mail_admin password = mail_admin_password dbname = mail query = SELECT destination FROM forwardings WHERE source=’%s’ hosts = 127.0.0.1

To check the right format, please consult the official documentation. You must put separate config in separated line

user = mail_admin 
password = mail_admin_password 
dbname = mail 
query = SELECT destination FROM forwardings WHERE source='%s'
hosts = 127.0.0.1

And don't forget to check ALL mysql maps for correct syntax.

  • Thanks. It looks like was the problem. Shouldn't 'hosts = 127.0.0.1' go to new line too? That way I don't get any postfix error, only dovecot warnings, which will I debug further. – Vahan Sep 4 '14 at 2:29

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.