Created
March 27, 2021 22:06
-
-
Save tasoseng/849e97cea58bb3c831730980b87f35c1 to your computer and use it in GitHub Desktop.
find all mails a user has received, $1 = To: email (sendmail)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
export IFS=' | |
' | |
TO=$1 | |
for ID in $(grep to=\<"$1"\> /var/log/everything | awk '{print $6}'| tr -d : ); do | |
FROM=$(grep "$ID" /var/log/everything | grep from= | cut -f2 -d\<|cut -f1 -d\>) | |
echo $FROM '->' $TO | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment