Testing emails in your local vm


testing emails can be tricky because you dont really want to send emails to real users. So we really need to turn emails service on and off as and when needed.

To stop postfix:
– stop postfix in rc.x so that it doesnt boot up with postfix started.
– /etc/init.d/postfix stop (to stop postfix if it is running now)

when you need postfix, delete queue first

check mail queue with “mailq”. then delete all the queues:
# postsuper -d ALL
# postsuper -d ALL deferred

now start postfix “/etc/init.d/postfix start” and do all your testing. when done, remember to turn postfix off again with “/etc/init.d/postfix stop”

Like it.? Share it:

Comments are closed.