Skip to content
This repository was archived by the owner on Jul 2, 2020. It is now read-only.

Debugging Postfix

Timotheus Pokorra edited this page Nov 15, 2016 · 5 revisions

Links

Useful links:

Useful commands:

mailq
postfix flush
postqueue -i <MAILID>

Error: emails stuck in queue

/var/log/maillog shows:

timed out while receiving the initial server greeting

This happens when sending emails should connect to amavis.

After a reboot of the whole machine, the emails were sent.

Test if email would be accepted, does destination resolution work

with telnet:

telnet localhost 25
  mail from:test@example.org
  rcpt to:invalid@example.org # OK because it is an external domain
  rcpt to:invalid@localdomain.org # Recipient address rejected: User unknown in local recipient table
  rcpt to:valid@localdomain.org # OK if that email address exists locally

You can also test if forwarding emails to another server works, see http://www.pokorra.de/2016/05/configuring-postfix-to-distribute-emails-to-other-servers/

Test processing mail headers

with telnet:

telnet localhost 25
  # important: paste line by line, not all in one go!
  HELO client.example.com
  MAIL FROM:mail@example.org
  RCPT TO:timotheus.pokorra@mydomain.de
  DATA
  X-Spam-Status: Yes
  Spam-Status: Yes
  Subject: Test message
  
  This is a test message.
  .
  QUIT

Clone this wiki locally