Whre are (unsent) emails stored?

Status
Not open for further replies.

Bostjan

Contributor
Joined
Mar 24, 2014
Messages
122
I've noticed that I wasn’t receiving any emails from root account from FreeNAS. Such as notifications of start/finsh scrub, …

After some digging I’ve found out that my email sever (was using it just for FreeNAS) wasn’t working.




………………………………
Here is the question.

Is there a way to see what emails would have been send and weren’t? Are they saved somewhere?
………………………………



I’m not proficient in FreeBSD, please provide as much command as you can.


Thanks.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,079
Here is the question.

Is there a way to see what emails would have been send and weren’t? Are they saved somewhere?
There would normally be a text file in /var/mail/root but I don't know, the way FreeNAS is configured, it may delete the mail from that file once it thinks it has been sent.
 
Joined
Dec 29, 2014
Messages
1,135
There would normally be a text file in /var/mail/root but I don't know, the way FreeNAS is configured, it may delete the mail from that file once it thinks it has been sent.

That would be the case if it is delivering it to root's mailbox. Normally on a box running sendmail, those temporary files would in /var/spool/mqueue. There would be a qfSOMETHING (queue file with info about the message), and a dfSOMETHING (data file with the message body and some other stuff). I did some casual checking, but it doesn't look like FreeNAS is using sendmail. Whatever is doing the mail queuing is writing its temporary files in /var/tmp. Nothing is listening on port 25, so I don't know. I figured that out from the following sequence.
Code:
root@freenas2:/var/spool/mqueue # touch /tmp/fubar
root@freenas2:/var/spool/mqueue # echo test | mail -s test somebody@somplace.com # altered, obviously
root@freenas2:/var/spool/mqueue # find / -type d -newer /tmp/fubar -print
/var/tmp


I think my interest in what MTA (mail transport agent) FreeNAS is using is waning...
 
Status
Not open for further replies.
Top