[2018-01-21]

Troubleshooting your mail server

General troubleshooting tips

  • Run “postfix check” to make Postfix look for obvious configuration errors. If it returns no output then no problem was found.
  • Read your /var/log/mail.log and look for warnings and errors.

Postfix keeps unwanted emails in the queue

Check that you do not keep soft_bounce enabled. If “postconf soft_bounce” shows “yes” then run “postconf soft_bounce=no”. To remove all emails from your queue (dangerous!) run “postsuper -d ALL”.

I get “Permission denied” from Dovecot in the mail.log file

You have the permissions wrong. Run:

chown -R vmail:vmail /var/vmail

Postfix says: “Mail loops back to myself”

Postfix tried to send an email to the internet because it did not feel responsible for the recipient’s domain. However DNS records pointed it back to itself. So either your DNS record for a certain domain is wrong (unlikely) or your Postfix refuses to receive email for the given domain (very likely). Check that the recipient’s domain is listed in the “virtual_domains” table in the MySQL database. And verify that your CF files are working correctly

4 thoughts on “Troubleshooting your mail server

  • 2018-02-22 at 09:01
    Permalink

    Not sure if this is covered in somewhere and I missed it. But I followed the guide to upgrade from an embarrassingly old server (Lenny) and was taken aback when my X-Original-To header was missing! I ended up rolling back to pipe style delivery in dovecot.

    In any case thanks for this wonderful guide and keeping it updated over the years! Made going back through setup a much easier.

    Reply
  • 2018-04-16 at 12:51
    Permalink

    Hello Mr. Haas,
    And first of all, many thanks for the detailed explanations, which not only allowed me to build a (mostly) functioning mail server but to understand more about its inner workings.
    Every test along the tutorial works fine, and I can connect, send and receive via roundcube.
    However, if I try to add my account to Thunderbird, K9 or even Outlook, I can’t get any to work, whatever parameters I might try.
    Strangely, I don’t even appear to get any entries regarding the supposedly failed attempts at connection in the entirety of /var/log (grep -r user@domain . shows nothing). Ports are open and Dovecot is listening on them…
    tcp6 0 0 :::443 :::* LISTEN 596/apache2
    tcp6 0 0 :::4190 :::* LISTEN 566/dovecot
    tcp6 0 0 :::993 :::* LISTEN 566/dovecot
    tcp6 0 0 :::995 :::* LISTEN 566/dovecot
    tcp6 0 0 :::11332 :::* LISTEN 510/rspamd: main pr
    tcp6 0 0 :::11333 :::* LISTEN 510/rspamd: main pr
    tcp6 0 0 :::110 :::* LISTEN 566/dovecot
    tcp6 0 0 :::143 :::* LISTEN 566/dovecot

    I’ve even tried using the IP address as the mail server instead of the FQDN in case there was some resolving problem, but to no avail.
    I’m admittedly stuck, if anyone had ideas, I would be thankful.

    Reply
    • 2018-04-16 at 13:54
      Permalink

      Regarding the above, I was fixated on dovecot due to previous problems, but it’s postfix who shall I think receive the connecting request, and here is what I got in the mail.log after another unsuccessful attempt :
      Apr 16 15:12:54 ip-172-31-5-3 postfix/smtpd[1071]: disconnect from unknown[redacted] ehlo=1 auth=0/1 quit=1 commands=2/3
      The auth data is the same as the one used successfully with roundcube.

      Reply
  • 2018-09-19 at 20:51
    Permalink

    For a while now it seems I can only send mail with either Roundcube or Thunderbird. Any other client (be it mutt, sylpheed, evolution, claws, …) fails to establish a connection to the webmail domain, with no indication as to why in the server logs. Do you have a clue how I might debug this?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *