Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.36 KB

postfix-commands.md

File metadata and controls

37 lines (25 loc) · 1.36 KB

Useful Postfix commands for debugging and monitoring

Sending and receiving mails

Handling pending queue

  • see messages in queue: mailq or postqueue -p
    • Delete messages in mailq: postsuper -d ALL

Checking logs or debugging any email

  • inspecting particular message in queue: postcat -vq XXX_MESSAGE_ID
  • Seeing error logs:
    • tail -f /var/log/mail.err
    • /var/log/mail.log | grep error
  • for generating summary of logs: pflogsumm /var/log/mail.log -d today
  • Checking logs for particular email: cat /var/log/mail.log | grep user@email.com

Configuration related

cd ~/
postconf -d >postfix.defaults
postconf >postfix.conf
diff -u postfix.defaults postfix.conf | grep -v '^ '|grep -v '^@' |grep -v '^---' | grep -v '^+++'
  • Change host name via (updates system hostname): sudo hostnamectl set-hostname mail.mydomain.com