Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a SSL certificate setup for postfix and Dovecot. I am able to read mail from Dovecot using a TLS connection but I cannot send any mail using smtps. I can only do it through smtp (port 25). When I attempt to send it through smtps it connects to postfix but then it just hangs until it times out. What could be causing this?

These are my smtpd settings for postfix in the main.cf file:

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = yes
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_cert_file=/opt/ssl.crt
smtpd_tls_key_file=/opt/ssl.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache 
share|improve this question
add comment

2 Answers 2

You need to uncomment the smtps line in your /etc/postfix/master.cf

What you've current got looks like the following. Try uncommenting the first two lines and restarting Postfix. You should see that Postfix is now listening on port 465. You may also need to open that port on your firewall.

#smtps     inet  n       -       n       -       -       smtpd
#  -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
share|improve this answer
    
I have this uncommented already. Postfix is listening on port 465. In the mail log it shows that a connection is attempted but nothing occurs afterwards. –  john Jul 19 '11 at 6:22
    
Add a -v to the end of that first line and restart Postfix. That should increase the logging level. Have you configured Postfix to use your ssl cert? –  kashani Jul 19 '11 at 6:37
    
Yes check my original post. –  john Jul 19 '11 at 6:45
    
I added the -v to the line and I am seeing this error: match_list_match: MY REMOTE IP: no match –  john Jul 19 '11 at 6:51
add comment

I've seen similar behaviour if there's something odd with the SSL certificate. Double-check that the Postfix settings are correct for the SSL certificate.

EDIT: For starters: does Postfix have permission to access /opt/ssl.* files?

And you could try to comment out these lines and restart Postfix after that.

tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache 
share|improve this answer
    
I have added my settings to my main post. Is there anything wrong with them? –  john Jul 19 '11 at 6:44
    
I have tried your suggestions but no luck :( –  john Jul 19 '11 at 6:54
    
What if you increase smtpd_tls_loglevel and then try to read logs? –  Janne Pikkarainen Jul 19 '11 at 6:57
    
I added the -v to smtpd_tls_loglevel and I am seeing these errors: match_list_match: MY REMOTE IP: no match match_list_match: ?U??: no match MY REMOTE IP: 402 4.5.2 Error: command not recognized –  john Jul 19 '11 at 7:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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