Skip to content

Instantly share code, notes, and snippets.

@dynax60
Created October 30, 2014 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dynax60/94618e3407a6f180baf8 to your computer and use it in GitHub Desktop.
Save dynax60/94618e3407a6f180baf8 to your computer and use it in GitHub Desktop.
What sender was for specified recipient? (need amavis)
# find . -name "mail.log*" -mtime -90 | xargs grep amavis | grep myaddr@mydomain.ru | perl -MData::Dumper -ne '/\[([^\]]+)\] \<([^\>]+)\>/; ++$a->{$2}->{$1}; }{ print Dumper($a)'
$VAR1 = {
'sock@test.domain.ru' => {
'192.168.116.2' => 27
},
'vcenter@domain.ru' => {
'192.168.130.110' => 11
},
'satisfactoryr@mail.ru' => {
'186.118.238.61' => 1
},
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment