Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was playing around with php and mail() on an OSX system and I ended up in a loop that generated a bunch of "junk" in my postfix system.

I want to be a good, clean, neat computer user, so I am trying to clean up the junk and get the system back to the way it was before I did anything.

Here's what I did so far:

cat /dev/null > /var/log/mail.log

What else should I do?


share|improve this question
up vote 0 down vote accepted

To be honest, I think a good computer user should leave evidence behind of what they've done. Deleting log files isn't to be encouraged but that's not the question here.

Have listed a few items below to remove old mail from q and delete the old logs. Please note that these files are almost certainly recoverable so if you are attempting to hide your tracks from anyone with any skill this isn't the way to do that.

Check that the queue is empty.

postqueue -p

If it isn't empty then delete the contents of the mailq(this will delete all messages so use with caution)

postsuper -D ALL

Postfix will also log to /var/log/syslog on a debian box by default - I presume it will do the same to a similar file on OSX. Check also that there are no mail.log.1.gz or syslog.0 type files. These are the log files from yesterday compressed to save space.

share|improve this answer
Thank you. So, does this mean that aside from these three things: /var/log/mail.log, /var/log/syslog, and the queue that is managed by postsuper -d ALL, there is nothing else that sending mail using postfix touches on the system? – MikeC8 Apr 21 '11 at 19:53
That should be the case, however, you have to remember that there will have been files created and deleted which are recoverable. If the mail was sent using php or similar this could be logged, there could also be connection attempts in any iptables/firewall log as well but this all depends on your config. – vsltd Apr 22 '11 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .