I have a learning environment, based on Linux CentOS, with Postfix and SquirrelMail running, but my assignment is more in general.
I need to find in the maillog e-mails received by a certain user within a certain time frame, based only on his Linux username.
I see my maillog, but I am not experienced in reading maillog and I have two concerns:
Whether or not these patterns that I see in the log are something reliable, i.e. whether a log for incoming e-mail will always have
Jan 2 20:31:17 tmcent01 postfix/local: B58C4330038: to=<email@example.com>, orig_to=<postmaster>, relay=local, delay=9.7, delays=9.6/0.03/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
How does a Linux username correspond to the e-mail name of the user? It is not it always a match (username@domain), is it? We could have alias for it, how can I take this in consideration when composing the Regex for the
My first two attempts were a strike-out.
sudo grep "to=<jsmith@" /var/log/maillog | grep 1[2-4]:[0-5][0-9]:[0-5][0-9] sudo grep -w "jsmith" /var/log/maillog | grep 1[2-4]:[0-5][0-9]:[0-5][0-9]