Le 15/10/2015 10:17, Richard Mealing a écrit :

cat /var/log/maillog | grep "Junk" | cut -d ">" -f1 | cut -d "<" -f2 | while read rubbish ; do grep $rubbish /var/log/maillog ; done | grep postfix | cut -d ":" -f4 | while read messageid ; do grep $messageid /var/log/maillog ; done | grep smtpd


Hello

I got a good result with:

cat /var/log/maillog | grep "Junk" | cut -d ">" -f1 | cut -d "<" -f2 | while read rubbish ; do grep $rubbish /var/log/maillog ; done | grep postfix | cut -d ":" -f4 | while read messageid ; do grep $messageid /var/log/maillog ; done | grep smtpd | awk '{print $NF}' |cut -d "[" -f2 |sed 's/\]//g'

It give me the IP addresses :)

I now search how I can this loop in live all the time, to make fail2ban check the result log file, or maybe i will ask logrotate to generate the log when rotating.

Thanks :)

--
Nicolas Repentin
<[email protected]>

------------------------------------------------------------------------------
_______________________________________________
Fail2ban-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fail2ban-users

Reply via email to