2,187
edits
(→Configuration: Added "Allowed/Denied Senders/Receivers") |
(→Troubleshooting: Added "Find Email To/From Email/IP Address") |
||
Line 84: | Line 84: | ||
Some text for the email | Some text for the email | ||
. | . | ||
</pre> | |||
=== Find Email To/From Email/IP Address === | |||
Use the following script to extract all traffic for a particular email or IP address | |||
<source lang="bash"> | |||
#!/bin/bash | |||
# Search for all mail for an IP address or mail address | |||
# Usage maillog-analyse <search-for-this> <in-this-log> | |||
# EG ./maillog-analyse 69.57.250.252 /var/log/maillog | |||
# EG ./maillog-analyse somejoe@domain.com /var/log/maillog.2 | |||
#echo "Searching for traffic for $1 in $2" | |||
for i in `grep -i $1 $2 | awk '{print $6}' | sed 's/\://'` | |||
do grep -i $i $2 | |||
done | |||
</source> | |||
So, if you save the script as <code>maillog-analyse</code>, run as follows to send to the output to a file | |||
<pre> | |||
./maillog-analyse 125.57.250.252 /var/log/maillog.1 >maillog-filtered | |||
./maillog-analyse someone@domain.com /var/log/maillog >maillog-filtered | |||
</pre> | </pre> | ||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:Applications]] | [[Category:Applications]] |