How to get list of bounced email addresses from exim_mainlog?

Brooky A

Member
Sep 16, 2015
24
5
53
UK
cPanel Access Level
Root Administrator
Hi All,

I was hoping it may be possible to get a list of bounced email addresses from the exim log. Does anyone know how I can parse it to do this?

Thanks!!!! :)
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
4,871
601
273
cPanel Access Level
Root Administrator
Hey there! There isn't one command that would give you all the bounces from the logs as they will bounce for different reasons. For example, sending a message to an address that doesn't exist looks like this:

2021-03-25 19:36:21 H=(host.domain.com) [::1]:35794 F=<[email protected]> A=dovecot_login:[email protected] rejected RCPT <[email protected]>: No Such User Here

So you could run a command similar to this to get all of those emails:

Code:
grep -i "no such user here" /var/log/exim_mainlog
You'd need to run commands based on the type of bounce you're looking for, and then combine that output together to get a good list.

I'm sorry I don't have an easier method to accomplish that.
 
  • Like
Reactions: Brooky A