SMTP Monitoring to find origin of messages

Posted on 2014-08-05
Last Modified: 2014-08-07

I have a issue and do not really find a feasible solution to my problem. I hope that maybe someone has a good pointer on how to tackle this issue.

Basically the problem is that I have a Linux server with postfix. I also have logwatch installed and get a daily report. There are maybe about 200 mail accounts on this server.  Most of them are not to active but logwatch says that 7k messages are send. So I do suspect maybe some of the programs hosted on this server has some exploit that allows some outside person to maybe send messages using my server by exploding a possible faulty script.
I wonder if there is any way to find something like this with some monitoring script or reporting script. Any tips on how to tackle a situation like this so that I can tighten the server and ensure nobody is using my machine to possible send spam.

Best wishes,
Question by:Thomanji
    LVL 16

    Assisted Solution

    One thing you might consider is that the email origination on the inbound emails is spoofed to your mail server domain, so when the 'dumb' report runs, it merely collects all the data in the "from" field on your emails and is making it look like (just in the report) you sent a bunch of crappy email.

    Say your domain is and I craft an email from "" to "" all the time knowing both accounts are active.  If you don't have recursive spoof detection enabled/installed on your perimeter, your mail server (postfix especially) will accept it and store it.  This is  a pretty common spam tactic to confuse simple spam traps.  Someone has probably harvested your user list.

    The best solution would be to route the domain through a spam service, spam appliance, or install and configure spam assassin or @SSp on your network.
    LVL 13

    Accepted Solution

    If you're not sure what causes the messages to be created, some kind of "brute force attack" could help. Chances are good that the mails are transferred w/o SSL encryption - so I would try to set Wireshark onto the network traffic, set up with an appropriate capture filter (to intercept SMTP traffic only, and maybe more smart conditions, i.e. to catch only the relevant header lines).

    That way you're capable of reading the entire mail traffic and spot the suspect messages - but be prepared to read thru a huge heap of data, depending on the amount of data your users shove thru the server.

    Author Comment

    Thanks guys this is good info.
    choward16980: I do have a sam system implementer using AMAVIS-NEW, Spamassassin, DKIM, Razor2, OS_Fingerprint, ClamAV, SFP and even DMARC so I would hope this stuff does some detecting of these spoofs.

    frankhelk: Wireshark sounds very interesting so I can see if anything is going on. I will play with this and see what is is capable of doing.
    LVL 16

    Assisted Solution

    I read this website 6 months back when I suspected our IIS server of being vulnerable.  It gave me the willies and seemed like more work than the actual creating of the website...

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Microsoft Outlook is not just an email client but it is full featured Personal Information Manager. But sometimes Outlook gets disconnected and you simply can’t access it. What steps can you perform before calling IT support? In this article we will…
    Microsoft has released various new features which are capable of handling various tasks. One of these tasks is ‘Migration from pop3 to Exchange Server’. Pop3 data stores various data along mailboxes like contacts, tasks, etc. So, it becomes the need…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now