Question
- How to enable Postfix debug mode?
- How to disable Postfix debug mode?
Answer
Via the postconf utility
-
Login to the server over SSH
-
Execute the following (specifying the required IP addresses and/or recipient domain names to monitor instead
203.0.113.2
andexample.com
):# postconf debug_peer_level=4
# postconf debug_peer_list=203.0.113.2,example.com
Note: No spaces between values in
debug_peer_list
are allowed.To disable debug via postconf, run the following command:
# postconf debug_peer_list=""
By editing the master.cf file
-
To enable Postfix debug mode via the master.cf file, you should open the
/etc/postfix/master.cf
config file by using your favorite command-line text editor -
Add -v (for verbose) right after smtpd, as shown in the following example:
==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (no) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd -vNote: To disable this Postfix debug mode, simply remove the -v you have added, save the changes and restart Postfix
- Save the changes to the file
-
Apply the changes by restarting Postfix via this command:
# systemctl restart postfix
Note: Postfix restart will lead to email service downtime for a while. Consider doing it during less active working hours.