• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question grep Emails via phpmailer / sendmail

mdde

Regular Pleskian
Hi,

i noticed some brute Force attack against some Wordpress and the Outgoing Email Limit (Subscription) turned on at same time.

I want to ask if theres a similar command as following, to track down Emails (Email Header, or Sender/ Receipient) send via SENDMAIL or PHPMailer??

Code:
# grep '[email protected]' /usr/local/psa/var/log/maillog

Thank you for any help :)
 
Last edited:
They all would come through localhost.
I'm monitoring these localhost mails in the log

In zabbix it would look like this
Code:
vfs.file.regcount[/usr/local/psa/var/log/maillog,": uid=[0-9]*"]

That's "grep 'uid=[0-9]*' /var/log/maillog".
But come to think of it... I haven't seen that message for a long time...
It has changed in Plesk Onyx
It doesn't work that way anymore as these are now sent by a user with an id in the 10000 range.

So I think this will be the expression in Plesk 17.5.3:
"egrep 'uid=10[0-9][0-9]' /var/log/maillog".

The "grep 'bellsouth.net' /var/log/maillog" is also an interesting one to detect spam.....
I have never seen a valid mail going to that domain and they almost always are spammed.

This is also an interesting command to execute...
zgrep uid=10[0-9][0-9] /etc/passwd /var/log/maillog* | grep -o 'from=.*' | sort | uniq -c | sort -n

It tells you which site is sending the most mail
 
Last edited:
Many spams won't reach their destination and stay in your mail queue for some while. When you look into your mail queue and examine the mail headers it is often possible to identify the sending website.
 
Back
Top