Server Fault is a question and answer site for system and network administrators. 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 have a server running sendmail. It started sending out tons of spam. I went it, shutdown sendmail cleaned out the queue (removed everything in /var/spool/mqueue).

How-ever, as soon as I restart sendmail the queue starts filling up again with spam mails.

How can I find out where they are coming from?


share|improve this question
Did you check the log file? – Khaled Aug 15 '12 at 6:53
if you mean /var/log/maillog yes, as soon as I restart sendmail it starts showing all the spam messages trying to go out. But I can't seem to find what is injecting the messages into the queue to stop it – Kevin Aug 15 '12 at 7:02
Did not you find a line like Connect from ...? – Khaled Aug 15 '12 at 7:03
Always the obvious one! I blocked incoming port 25, turned on sendmail and it looks like its ok. Thanks so much for the suggestion. It looks like either the server was reconfigured to be an open relay, or was never properly installed. In either case I know how to fix it now. Thanks so much for the help! – Kevin Aug 15 '12 at 7:11

Check mailq -Ac — this is a separate queue for a locally submitted mail. I suppose a website on this server was compromised and this spam is going from this website.

share|improve this answer
Yep, I found more in there as well. I cleaned those out. I checked all the files modified in the last 7 days but haven't found a culprit yet as to how the mail was injected. But thanks for the suggestion – Kevin Aug 15 '12 at 7:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.