|
CentOS Linux Server Installation , FAQ, Tips and Tricks |
Postfix Mail System - Identify spam attack, clear Postfix mail queue |
||||||||||||
|
We experienced large volume of email transaction last year 2010. I look at my /var/mail/maillog and found a lots of connection from [email protected] This is not possible as my email server is not allow to relay gmail.com. Since,I confirmed that this is not an open relay. The most likely root cause will be spammer change his mail from:<[email protected]> and while using a valid SMTP AUTH connection.
Please find more information of the mail log below.
Before your proceed, you might consider to stop the email services. we are using postfix at our organization, we stop both dovecot and postfix services
Alternatively you can hold the mail queue.
Step1 : Identify user authenticating SMTP AUTH connectionTo have a quick solution of who is actually performing SMTP Auth session, let us perform the following command.
This command tell Linux to display all row of a email log maillog that have sasl_username then sort it accordingly, so it will look like this.
I found that there are lots of session using [email protected] from IP 123.123.123.123 and other IP to connect. Please take note that example.com is my valid domain, and there is a valid user called abc
Step2: Check the total sessions of SMTP AUTH of the victim connectionNext, let us check how many SMTP AUTH session has [email protected] perform.
Step3: Confirm the compromised account from <mail from: >Next, we know we know abc account sending 3000 mails for x time and recorded in /var/log/maillog, then we want to know if his account exploited by spammer at under specific time, we can perform to grep -A 10, which mean perform the content after 10 lines of line matched with Dec 20 23:17:32 mail.You will se multiple lines of output, the only answer we look for is to reconfirm if the abc's email account has been compromised and the spammer use [email protected] as sender address.
We should temporary stop the abc's email account. If you using Postfixadmin, please login to web based administration and stop his email. Or, you can change his password.
Step 5: Check Mail queueWe can have quick check on mail queue. I was not so lucky, we hit more than 10,000 email under our mailserver.
I would suggest that you move all this email to another location and perform the housekeeping later. So that your email services will not affected.
To delete ALL email under mail queue (NOT Recommended)
Since the spammer might using multiple fake sender name <mail from: >. It is a bit difficult to delete email that belongs to spammer. I found the follwing scritpts is very useful and would like to share with you. The script is from cyberciti.biz
To delete all email from a specific domain.
To delete all email from specific user
|
||||||||||||
|
|
||||||||||||
|
All trademarks are the property of their respective owners. |