Debugging Postfix

View Mail Logs

  1. To see which emails are being tried to send via Postfix:
  2. # journalctl -u postfix -f
  3. or
  4. # tail -f /var/log/mail.log

Check the Configuration

  1. To check the syntax of the Postfix configuration file:
  2. # postfix check
  3. If you need to review the configuration, this command shows only the used parameters:
  4. # postconf -n

Show the Mail Queue

  1. # mailq
  2. or
  3. # postqueue -p

Flush the Mail Queue

During testing, emails may remain stuck in the queue because of incorrect relay parameters or temporary connectivity issues.
  1. To retry delivery of queued emails:
  2. # postqueue -f

Delete the Mail Queue

  1. To delete all queued emails:
  2. # postsuper -d ALL
  3. To delete a specific queued email with ID:
  4. # postsuper -d QUEUE_ID