0

I just installed Dovecot and Postfix on a CentOS VPS I have, and am now trying to get it to work. Receiving mail works fine, as does fetching the mailbox with Thunderbird on Windows (using SASL for authentication), but when I'm trying to SEND mail (with Thunderbird again), it almost instantly comes up with a message about the SMTP connection timing out. If I try other ports (other than 465 for the SSL/TLS secured connection), it takes longer but still times out (so I think the port is correct, but something is refusing my connection).

Result of postfix -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
body_checks = regexp:/etc/postfix/body_checks
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
disable_dns_lookups = no
header_checks = regexp:/etc/postfix/header_checks
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 104857600
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = miikkavirtanen.net
myhostname = miikkavirtanen.net
mynetworks = 192.168.0.0/24, 127.0.0.0/8, 10.0.0.0/24
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relay_domains =
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/pki/tls/certs/server.crt
smtpd_tls_key_file = /etc/pki/tls/certs/server.key
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
Ben Pilbrow
  • 12,041
  • 5
  • 36
  • 57
Dragory
  • 157
  • 1
  • 8

1 Answers1

1

A knee-jerk reaction: check (with telnet) if your ISP doesn't block outgoing mail ports (25 and 465).

Make sure your firewall allows outgoing connections to TCP ports 25 and 465.

Paweł Brodacki
  • 6,511
  • 20
  • 23
  • I can send mail through other mailservers from Thunderbird, such as GMail, so I think that's not the problem. But I'll try disabling the firewall - my ISP shouldn't block any ports (they don't tend to do that here in Finland). – Dragory May 15 '11 at 11:48
  • In that case we need logs, plenty of logs. Identify the IP to which you cannot connect, put its IP into debug_peer_list and let's see what the logs say (http://www.postfix.org/DEBUG_README.html#logging). And I would telnet to the remote port just in case. If you can and postfix cant, then there's a troll in some wire that can distinguish between a telnet to port 25 and postfix connection to port 25. Otherwise we get helpful data. – Paweł Brodacki May 15 '11 at 11:59
  • Yeah, I can telnet to port 25. Not sure if Postfix can - it seems to timeout the connection between my E-Mail client and Postfix, not between Postfix and the destination. The logs don't say anything when I'm trying to send the mail, either (but there ARE logs of e.g. receiving mail (which works)). – Dragory May 15 '11 at 12:55
  • Hm... Telnet to localhost port 25 and check if postfix is listening there? Smart money is the program is using network connection, not running postfix binary directly. – Paweł Brodacki May 15 '11 at 12:58
  • Hmm... how should I know it's running? It displays the "connected" message, and tells me the escape character, but that's it. Also, for some reason, telnet doesn't accept any commands (like "quit") anymore. But I can still check mail and get the inbox with Thunderbird, so doesn't that mean Postfix IS running? – Dragory May 15 '11 at 13:26
  • If you can telnet to port 25 it seems that something listens there. You can use some tutorial on sending mail through port 25 (e.g. this one: http://www.activexperts.com/activemail/telnet/) to check if you can send mail to a local account. If you can, then the postfix is running. Postfix is an MTA (server-to-server). Thunderbird is a MUA for a server-to-user interactions, and for mail reception it does not interact with a server on port 25 (SMTP), but uses local mail directories, POP or IMAP to get your mail. It may use local postfix to send mail, but it may connect to some remote server too. – Paweł Brodacki May 15 '11 at 13:39