On 12/13/21 3:12 PM, Frank Steinmetzger wrote:
Using strace, I found out that mail from mailx puts those mail into /var/spool/clientmqueue/, one file per mail, but not in a maildir structure.

Yes, the /var/spool/clientmqueue is the mail queue for outgoing messages from clients. Hence the name "client m(ail) queue".

OK, I found out that this is the usual outgoing queue which needs to be processed by sendmail, probably through another cronjob or a process that itself checks that directory periodically.

Sendmail is quintessentially a daemon that's running all the time. As such it usually does it's own scheduling and does not depend on external scheduling.

In many places I read that system mail—by default—goes into
/var/spool/mail/<user>, but until now I’ve yet to observe this behavior.

/var/spool/mail/<user> and /var/mail/<user> are the quintessential locations for mbox based inbound email storage.

Note: There are a number of other fancy client mail storage routines that don't use files in this path.

It’s really not easy to find a description of the default setup of olden
days (or I’m simply using the wrong search terms). Because when you search
for something like unix local mail setup, most results are about setting up
an SMTP server. In hindsight—perhaps that is simply the way to go. :-/
You will quite likely need a Mail Transfer Agent to receive the email, either via command (mail(x) / sendmail / etc) or read from a queue location like /var/spool/clientmqueue and then deliver the messages to where they belong.

There /may/ be an alternate "mail" command that does all of this in one function. But I'd be surprised to learn about such.

Most of the surprise is because it would be combining three distinct parts of the email flow: the Mail User Agent (a.k.a. MUA) generating the original outgoing message, the Message Transfer Agent (a.k.a. MTA) to receive the original message and do something with it, and the Local Delivery Agent (a.k.a. LDA) to put the message in the proper location.

The originating MUA can frequently be substituted at will with "mail", "mailx", and "nail" being three CLI based that come to mind immediately.

The MTA can frequently be one of many with Sendmail, Postfix, Courier, Exim coming to mind.

The LDA can easily be one of the following; procmail, maildrop, Courier, and something super simple I don't remember the name of because I've not used it in so long.



--
Grant. . . .
unix || die

Reply via email to