How to check the logs for incoming messages?

Hi Guys. How do we check the logs for incoming messages?

I found this topic

and tried command nano /var/log/mail.log

in nano I use CTRL+_ and then CTRL_V to go to the last line.

by looking at the logs line by line I wanted to know if an email is received by looking at the log line.

Can someone share a sample log entry that says the email is received and its in the inbox of the MIAB user.

You can see mail received, just not it’s contents that way. What you would be looking for is something along the lines of

delivery 2: success: something something

1 Like

Thanks @murgero

How about an incoming message successfully delivred to a MIAB user?

What does the log line looks like for an incoming message?

It would look similar. Same file. You can also use this method to read the mailbox:

(You maildir for this would be /home/user-data/mail/username/ in this case)

Learning Maildir.

Thanks for sharing @murgero

1 Like

Just thinking - if you’re looking for messages being delivered to a specific mailbox or coming from a specific address you could try the following:

cat /var/log/mail.log | grep <email address>

As a modification:

cat /var/log/mail.log | grep -i ""

The “-i” means case-insensitive. so if an email is capitalized on one end and not the other, it should show regardless.

1 Like