[exim] Find all mail aliases used on server

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Juan Bernhard
Date:  
À: exim-users
Sujet: [exim] Find all mail aliases used on server
Hello list, I have a mail server with a lot of unused aliases, and I
need an easy way to do a list of aliases that actually received some
mail, to eliminate the other ones.
So, I thought that the easy way was to see if the log has an entry with
the redirect router (something like grep 'R=system_aliases'
/var/log/maillog), but its doesn't.

When a mail are processed by the redirect router, show this:

2016-02-02 13:25:24 [16459] 1aQdlc-0004HT-OV <= sender@???
H=sbg-out.example.com [10.10.161.69]:60625 I=[10.10.161.64]:25 P=esmtp
S=22700 M8S=0 id=007a01d15dd6$242564f0$6c702ed0$@??? T="RE: Licencia"
from <sender@???> for mail_alias@???
2016-02-02 13:25:24 [16460] 1aQdlc-0004HT-OV => recipient1
<mail_alias@???> F=<sender@???> P=<sender@???>
R=localuser T=local_delivery S=22819 QT=0s DT=0s
2016-02-02 13:25:24 [16460] 1aQdlc-0004HT-OV => recipient3
<mail_alias@???> F=<sender@???> P=<sender@???>
R=localuser T=local_delivery S=22819 QT=0s DT=0s
2016-02-02 13:25:24 [16460] 1aQdlc-0004HT-OV => recipient2
<mail_alias@???> F=<sender@???> P=<sender@???>
R=localuser T=local_delivery S=22819 QT=0s DT=0s
2016-02-02 13:25:24 [16460] 1aQdlc-0004HT-OV Completed QT=0s

This is my router config:
system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
file_transport = address_file
pipe_transport = address_pipe

and this is my log config:
log_file_path = :syslog
log_selector = +all


I can see that the router localuser was used, but I can't find any clue
in the first line, that this mail was redirected in the first place...
should the router system_aliases should log something like "[...]
R=system_aliases [...]" in some place?

Or if you have another easy way to find out witch aliases were used,
please share :)

Regards,
Juan.