The default settings on the local mac or amazon linux are to send mail to the cron executable via the sendmail
command when the cron fails to execute.(And each user can check the contents of the mail by using the mailx
command.)
There have been some questions about this behavior of "sending mail to local users," and perhaps a series of knowledge, I have not been able to find the source information.specifically:
/var/mail/username
. Is there a name in this file format and storage location convention?/var/mail/username
. Is there a name in this file format and storage location convention?
Part of the directory structure determined by FHS.
Although it may vary by distribution, /var/mail
is usually a symbolic link to /var/spool/mail
, and /var/spool
is used as a place to store "queues" such as mail and print jobs.
/var/spool
Spool is an abbreviation for Simultaneous Peripheral Operation On-Line, originally an IBM term.It is originally a buffer for efficient data transmission to slow peripherals.In other words, it appears to be used as a buffer for FIFO (First In First Out) called a "queue."
(omitted)
Also, for mail servers using sendmail, there is the same file as each user name under /var/spool/mail.This is what we call a mailbox.Any mail sent to the user will be saved here.After that, you can read it with the mail command or read it into the mailer with POP3.Recently, some servers seem to use qmail as an MTA, but in that case, it is common to send mail directly to each user's home directory without using /var/spool/mail.
Does the mail storage directory file format for local users have a name?
yes.
It is referred to as the "mbox format.mbox-Wikipedia
Another option is Maildir format, which is saved as a single mail file.Maildir-Wikipedia
For example, Postfix has options such as mbox or Maildir.Postfix configuration parameters
"The ""local user's mail storage directory file format"" is also used to receive mail from an external server."
yes.
I'm not sure if there is a fixed term in the saved directory (/var/mail
or /var/spool/mail
), but I think it's commonly called a mail spool directory.The file format there is called mbox.Some MTAs also allow you to create mbox-formatted files in your home directory without placing them in a common spool directory.
In addition to the mbox format, there is also Maildir
It is typically used for both local distribution and external reception.
© 2024 OneMinuteCode. All rights reserved.