SMTP not working / FIXED (see 'edits')

1 post / 0 new
#1 Sun, 04/15/2012 - 17:43
Brook

SMTP not working / FIXED (see 'edits')

I can't seem to get SMTP (from my email client) to work, I've spent hours searching the forums and looking through the guides but still stuck on it.

///EDIT:
The problem seems to be related to the self-signed certificate, because if I turn off SSL in my email client it sends ok... see this thread: http://forums.vpslink.com/howtos/8991-how-build-mail-server-into-link-1-...
///

It's a clean Virtualmin install (I haven't changed any postfix settings) and interestingly, I get the exact same response for my server when doing:


$ telnet virtualmin.com 25

Trying 108.60.199.107...
Connected to virtualmin.com.
Escape character is '^]'.
220 www.cloud.virtualmin.com ESMTP Postfix
((hangs at the above line for a few minutes, then..))
421 4.4.2 www.cloud.virtualmin.com Error: timeout exceeded
Connection closed by foreign host.

Here is the result from:

$ tail -50 /var/log/maillog

Apr 15 21:24:30 hostname dovecot: pop3-login: Login: user=, method=PLAIN, rip=::ffff:90.222.86.66, lip=::ffff:54.42.59.105, TLS
Apr 15 21:24:30 hostname dovecot: POP3(info@mydomain.org): Disconnected: Logged out top=0/0, retr=0/0, del=0/1, size=1036
Apr 15 21:24:56 hostname postfix/smtpd[21732]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:24:56 hostname postfix/smtpd[21732]: lost connection after EHLO from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:24:56 hostname postfix/smtpd[21732]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:24:56 hostname postfix/smtpd[21732]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:11 hostname postfix/smtpd[21732]: lost connection after EHLO from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:11 hostname postfix/smtpd[21732]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:34 hostname postfix/smtpd[21732]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:34 hostname postfix/smtpd[21732]: lost connection after EHLO from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:34 hostname postfix/smtpd[21732]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:35 hostname postfix/smtpd[21732]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:37 hostname postfix/smtpd[21732]: lost connection after EHLO from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:37 hostname postfix/smtpd[21732]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:53 hostname postfix/smtpd[21732]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:53 hostname postfix/smtpd[21732]: lost connection after EHLO from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:53 hostname postfix/smtpd[21732]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:54 hostname postfix/smtpd[21732]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:56 hostname postfix/smtpd[21732]: lost connection after EHLO from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:25:56 hostname postfix/smtpd[21732]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:29:10 hostname postfix/anvil[21132]: statistics: max connection rate 4/60s for (smtp:90.222.86.66) at Apr 15 21:19:53
Apr 15 21:29:10 hostname postfix/anvil[21132]: statistics: max connection count 4 for (smtp:90.222.86.66) at Apr 15 21:19:10
Apr 15 21:29:11 hostname postfix/smtpd[21500]: timeout after UNKNOWN from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:29:11 hostname postfix/smtpd[21500]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:32:16 hostname postfix/smtpd[21958]: connect from rock.mydomain.net[69.162.88.210]
Apr 15 21:37:16 hostname postfix/smtpd[21958]: timeout after CONNECT from rock.mydomain.net[69.162.88.210]
Apr 15 21:37:16 hostname postfix/smtpd[21958]: disconnect from rock.mydomain.net[69.162.88.210]
Apr 15 21:39:10 hostname postfix/anvil[21132]: statistics: max connection rate 1/60s for (smtp:69.162.88.210) at Apr 15 21:32:16
Apr 15 21:39:10 hostname postfix/anvil[21132]: statistics: max connection count 1 for (smtp:69.162.88.210) at Apr 15 21:32:16
Apr 15 21:39:10 hostname postfix/anvil[21132]: statistics: max cache size 1 at Apr 15 21:32:16
Apr 15 21:39:20 hostname postfix/smtpd[22288]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 21:42:20 hostname postfix/smtpd[22478]: connect from hostname.mydomain.org[127.0.0.1]
Apr 15 21:43:33 hostname postfix/postfix-script: stopping the Postfix mail system
Apr 15 21:43:33 hostname postfix/master[14029]: terminating on signal 15
Apr 16 02:43:34 hostname postfix/postqueue[22624]: warning: Mail system is down -- accessing queue directly
Apr 15 21:43:48 hostname postfix/postfix-script: starting the Postfix mail system
Apr 15 21:43:48 hostname postfix/master[22683]: daemon started -- version 2.3.3, configuration /etc/postfix
Apr 15 21:43:53 hostname postfix/smtpd[22741]: connect from hostname.mydomain.org[127.0.0.1]
Apr 15 21:48:53 hostname postfix/smtpd[22741]: timeout after CONNECT from hostname.mydomain.org[127.0.0.1]
Apr 15 21:48:53 hostname postfix/smtpd[22741]: disconnect from hostname.mydomain.org[127.0.0.1]
Apr 15 22:18:30 hostname postfix/postfix-script: refreshing the Postfix mail system
Apr 15 22:18:30 hostname postfix/master[22683]: reload configuration /etc/postfix
Apr 15 22:19:42 hostname postfix/smtpd[27640]: connect from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 22:22:00 hostname postfix/postfix-script: refreshing the Postfix mail system
Apr 15 22:22:00 hostname postfix/master[22683]: reload configuration /etc/postfix
Apr 15 22:22:00 hostname postfix/anvil[27642]: statistics: max connection rate 1/60s for (smtp:90.222.86.66) at Apr 15 22:19:42
Apr 15 22:22:00 hostname postfix/anvil[27642]: statistics: max connection count 1 for (smtp:90.222.86.66) at Apr 15 22:19:42
Apr 15 22:22:00 hostname postfix/anvil[27642]: statistics: max cache size 1 at Apr 15 22:19:42
Apr 15 22:24:43 hostname postfix/smtpd[27640]: timeout after CONNECT from 5ade5642.bb.sky.com[90.222.86.66]
Apr 15 22:24:43 hostname postfix/smtpd[27640]: disconnect from 5ade5642.bb.sky.com[90.222.86.66]hostname

And:


# netstat -tap

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:mysql *:* LISTEN 21993/mysqld
tcp 0 0 *:sunrpc *:* LISTEN 2869/portmap
tcp 0 0 *:980 *:* LISTEN 2918/rpc.statd
tcp 0 0 100-9-31-64.static.r:domain *:* LISTEN 18829/named
tcp 0 0 99-9-31-64.static.re:domain *:* LISTEN 18829/named
tcp 0 0 10.4.9.198:domain *:* LISTEN 18829/named
tcp 0 0 host.mysite_______in:domain *:* LISTEN 18829/named
tcp 0 0 host:domain *:* LISTEN 18829/named
tcp 0 0 *:ssh *:* LISTEN 3195/sshd
tcp 0 0 host.mysite________g:irisa *:* LISTEN 25018/lookup-domain
tcp 0 0 host.mysite______:postgres *:* LISTEN 18729/postmaster
tcp 0 0 *:smtp *:* LISTEN 22683/master
tcp 0 0 host.mysite__________.:rndc *:* LISTEN 18829/named
tcp 0 0 *:unisql-java *:* LISTEN 9796/perl
tcp 0 704 100-9-31-64.static.reve:ssh 119.10.114.193:35190 ESTABLISHED -
tcp 0 0 host:ssh 5ade5642.bb.sky.com:55468 ESTABLISHED 19705/sshd
tcp 0 0 host:ssh 5ade5642.bb.sky.com:51194 ESTABLISHED 7606/sshd
tcp 0 1152 host:ssh 5ade5642.bb.sky.com:65013 ESTABLISHED 31794/sshd
tcp 0 0 *:imaps *:* LISTEN 13035/dovecot
tcp 0 0 *:pop3s *:* LISTEN 13035/dovecot
tcp 0 0 *:pop3 *:* LISTEN 13035/dovecot
tcp 0 0 *:imap *:* LISTEN 13035/dovecot
tcp 0 0 *:http *:* LISTEN 12287/httpd
tcp 0 0 *:ftp *:* LISTEN 18376/proftpd
tcp 0 0 *:ssh *:* LISTEN 3195/sshd
tcp 0 0 localhost6.localdomain:rndc *:* LISTEN 18829/named
tcp 0 0 *:https *:* LISTEN 12287/httpd

And:


$ postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, my.hostname.org
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sender_bcc_maps = hash:/etc/postfix/bcc
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

Is this default behavior and I need to turn it on or edit some configuration file first? (I had to turn dovecot on - so am wondering whether the same applies to smtp).

Thanks in advance for any help.

/////Edit 2:

I finally found a thread and got it to work using the below - have to test it with additional domains yet tho... does it look ok? (It was Eric's advice in another thread)

==============
POSTFIX SET-UP
==============

> vi /etc/postfix/master.cf
- Uncomment these lines:

submission inet n - n - - smtpd
-o smtpd_enforce_tls=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject

Then restart:
- /etc/init.d/postfix restart

Then check port 465 is open:
- netstat -an | grep :465

Then:
- What you'll need to do then is choose one of your domains, and enable SSL for it.
You can do that in Edit Virtual Server -> Enabled Features, and check "SSL Website Enabled".
Once you do that, go into Server Configuration -> Manage SSL Certificates, and click "Copy to Postfix".

///EDIT3:
I set up an email for a different domain but unfortunately it does not work :(
I have to go to bed now though (it's 4 am eek!) - hope someone has some ideas while I'm gone.
////

///EDIT4:
OK, got it. Virtualmin does not allow more than one SSL site per IP so I couldn't create a new cert for the additional domain (wonder how cPanel gets around it? (They provide a cert per domain)), however you just need to set the outgoing mail server as mail.the-domain-with-the-cert.com and it should work fine. Wonder if there are any gotcha's tho?
/////