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've set up postfix on my VPS so that I can send/receive emails. Accessing emails through SquirrelMail works fine - I can both send and receive emails. However, using an email client (Thunderbird) I can receive emails fine, but get the following error message when I try to send them:

Sending of message failed.
The message could not be sent because the connection to SMTP server [server] timed out. Try again or contact your network administrator.

I have looked at similar problems on here and other forums, but none of the suggestions have worked for me. I don't really know what information will be needed so have included various bits below, but if you need anything else I can try and give it!

tail /var/log/maillog:

Aug 23 22:59:05 redsquirsoft postfix/smtpd[15406]: connect from cpc2-telf10-2-0-cust377.wolv.cable.virginmedia.com[my.ip.add.ress]
Aug 23 23:00:50 redsquirsoft postfix/smtpd[14820]: lost connection after UNKNOWN from cpc2-telf10-2-0-cust377.wolv.cable.virginmedia.com[my.ip.add.ress]
Aug 23 23:00:50 redsquirsoft postfix/smtpd[14820]: disconnect from cpc2-telf10-2-0-cust377.wolv.cable.virginmedia.com[my.ip.add.ress]

telnet mydomain.com 25:

Connected to mydomain.com.
Escape character is '^]'.
220 vpshostingdomain.com ESMTP Postfix
ehlo mydomain.com
250-vpshostingdomain.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: <username@mydomain.com>
250 2.1.0 Ok

/etc/postfix/main.cf:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
mydomain = mydomain.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
     PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
     ddd $daemon_directory/$process_name $process_id & sleep 5
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.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
mynetworks = 127.0.0.0/8
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
home_mailbox = Maildir/
mailbox_command =
smtpd_tls_security_level = may
smtpd_tls_key_file = my .key file
smtpd_tls_cert_file = my .crt file
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_cache
tls_random_source = dev:/dev/urandom
smtpd_tls_auth_only = yes
smtpd_relay_restrictions = permit_sasl_authenticated

/etc/sasl2/smtpd.conf:

pwcheck_method: saslauthd
mech_list: plain login

As I said, I don't really know what other information will be needed so please just let me know if there's anything else you need, and thanks in advance for the help! :)

UPDATE 1

/etc/postfix/master.cf:

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#submission inet n       -       n       -       -       smtpd
#  -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       -       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
#628      inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
#maildrop  unix  -       n       n       -       -       pipe
#  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# The Cyrus deliver program has changed incompatibly, multiple times.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
#uucp      unix  -       n       n       -       -       pipe
#  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# ====================================================================
#
# Other external delivery methods.
#
#ifmail    unix  -       n       n       -       -       pipe
#  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
#
#bsmtp     unix  -       n       n       -       -       pipe
#  flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
#
#scalemail-backend unix -       n       n       -       2       pipe
#  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
#  ${nexthop} ${user} ${extension}
#
#mailman   unix  -       n       n       -       -       pipe
#  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
#  ${nexthop} ${user}

UPDATE 2

Wireshark:

...........R...}J.eO....U.\...,..9...y..X....H...
.......9.8.......5.........E.D.3.2...........A...../.........
.....
...=...#.!...mydomain.com.
.................#..220 vpshostingdomain.com ESMTP Postfix
502 5.5.2 Error: command not recognized
502 5.5.2 Error: command not recognized
502 5.5.2 Error: command not recognized
share|improve this question
    
From the telnet session, what happened after 250 DSN, did you try to type MAIL FROM: <user@domain> on the next line? Also please post /etc/postfix/master.cf –  Aaron Tate Aug 24 '13 at 8:14
    
@fenix I didn't try that on telnet, just tried it now and I got 250 2.1.0 Ok from that. I have also updated the question to include the master.cf file as requested (I've left comments in that in case there is something that has been commented out by mistake) –  Crazyloonybin Aug 24 '13 at 8:51
    
Ok, next step will probably be to disable TLS & SSL (if enabled), install wireshark on the system where thunderbird is installed, start it running on that adapter and apply the filter "smtp && ip.addr == x.x.x.x" where x.x.x.x = your mailserver. Then attempt to send a test message, in wireshark there will be a list of packets, right click the first packet and click "Follow TCP Stream", post the sanitised results. –  Aaron Tate Aug 24 '13 at 9:51
    
@fenix right, I did that, still got the timeout error in Thunderbird. I got the first packet from Wireshark (source = mailserver IP, dest = my local IP) and clicked on "Follow TCP Stream" which I have pasted above. Never used Wireshark before so don't know whether the random characters at the start were needed or should have been sanitised sorry! –  Crazyloonybin Aug 24 '13 at 11:21
    
Looks like a client problem, What Authentication method and Connection Security is configured for your outgoing server? –  Aaron Tate Aug 24 '13 at 12:02

1 Answer 1

Maybe your ISP blocks SMTP connections? Like in this Question (first answer): Postfix, SASL, MySQL Issues

share|improve this answer

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.