How to read all mails sent from my server
How to read all mails sent from my server
Currently, almost all mail sent from my server are all saved in receiver junk mail. I am thinking. Is it because my server is sending spam mail? I refer to this post How to check if server is sending out spam?. I can check all email sent from my server by entering this command.
cat /var/log/maillog | grep 'to=<[a-z0-9_.-]+@[da-z.-]+.[a-z.]{2,6}>' -o
cat /var/log/maillog | grep 'to=<[a-z0-9_.-]+@[da-z.-]+.[a-z.]{2,6}>' -o
I did send a few email by myself but the above command doesn't list out anything. If I cat /var/log/maillog, below is what I got. Not sure how to read this.
cat /var/log/maillog
...
Jul 3 12:38:32 abcde-id467301 spamd[16679]: spamd: connection from localhost [::1]:37410 to port 783, fd 5
Jul 3 12:38:32 abcde-id467301 spamd[16300]: prefork: child states: I
Jul 3 12:38:32 abcde-id467301 dovecot: pop3-login: Aborted login (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<XaTr4hBwNNJ/AAAB>
Jul 3 12:38:33 abcde-id467301 dovecot: lmtp(10026): Connect from local
Jul 3 12:38:33 abcde-id467301 dovecot: lmtp(10026): Disconnect from local: Successful quit
...
Any suggestions to check spam mail? Thanks.
1 Answer
1
By default, on a cPanel server, emails are sent using EXIM. So the email log (for received and sent emails) is located at /var/log/exim_mainlog. There you can see detailed info about whatever emails were sent to or by your server.
/var/log/exim_mainlog
A lot of factors can lead to your emails being delivered to junk. Just to name a few:
- your server's ip address is blacklisted (you can check it using tools like http://mxtoolbox.com/)
- you do not have a proper hostname defined for your server
- you do not have a proper reverse DNS for your server
- SPF and/or DKIM are not configured properly
Try sending an email from your server to a Gmail address for example, a Gmail address that you own. Then go to Gmail and even if the email landed on Junk, please check the email headers. There you get info about what checks have been made, what Spam score you got for your email and so on. That would be a good starting point for you to figure out why the sent emails land in Spam/Junk.
Since you have provided very little information, is hard to guess or provide a proper answer...
I see No DMARC Record found. Guess need to follow this one to add DMARC record? inmotionhosting.com/support/email/fighting-spam/dmarc-setup
– Pak Ho Cheung
yesterday
Yeah you should configure SPF/DKIM/DMARC properly. Also server’s hostname should be the same as the reverse dns entry on server’s ip address
– Bogdan Stoica
yesterday
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
you need to find where your outbound mail is being logged. That isn't it. Both spamd and dovecot work on mail you receive, not send.
– Terry Carmen
Jul 3 at 18:53