Gentoo Archives: gentoo-user

From: Laurence Perkins <lperkins@×××××××.net>
To: "gentoo-user@l.g.o" <gentoo-user@l.g.o>
Subject: RE: [gentoo-user] Local mail delivery agent (MDA) wanted
Date: Wed, 15 Dec 2021 20:21:34
Message-Id: MW2PR07MB4058057A592ADD9F96526287D2769@MW2PR07MB4058.namprd07.prod.outlook.com
In Reply to: Re: [gentoo-user] Local mail delivery agent (MDA) wanted by Grant Taylor
1 >
2 >
3 >-----Original Message-----
4 >From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
5 >Sent: Tuesday, December 14, 2021 3:34 PM
6 >To: gentoo-user@l.g.o
7 >Subject: Re: [gentoo-user] Local mail delivery agent (MDA) wanted
8 >
9 >On 12/13/21 3:12 PM, Frank Steinmetzger wrote:
10 >>> Using strace, I found out that mail from mailx puts those mail into
11 >>> /var/spool/clientmqueue/, one file per mail, but not in a maildir structure.
12 >
13 >Yes, the /var/spool/clientmqueue is the mail queue for outgoing messages from clients. Hence the name "client m(ail) queue".
14 >
15 >> OK, I found out that this is the usual outgoing queue which needs to
16 >> be processed by sendmail, probably through another cronjob or a
17 >> process that itself checks that directory periodically.
18 >
19 >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.
20 >
21 >>> In many places I read that system mail—by default—goes into
22 >>> /var/spool/mail/<user>, but until now I’ve yet to observe this behavior.
23 >
24 >/var/spool/mail/<user> and /var/mail/<user> are the quintessential locations for mbox based inbound email storage.
25 >
26 >Note: There are a number of other fancy client mail storage routines that don't use files in this path.
27 >
28 >> It’s really not easy to find a description of the default setup of
29 >> olden days (or I’m simply using the wrong search terms). Because when
30 >> you search for something like unix local mail setup, most results are
31 >> about setting up an SMTP server. In hindsight—perhaps that is simply
32 >> the way to go. :-/
33 >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.
34 >
35 >There /may/ be an alternate "mail" command that does all of this in one function. But I'd be surprised to learn about such.
36 >
37 >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.
38 >
39 >The originating MUA can frequently be substituted at will with "mail", "mailx", and "nail" being three CLI based that come to mind immediately.
40 >
41 >The MTA can frequently be one of many with Sendmail, Postfix, Courier, Exim coming to mind.
42 >
43 >The LDA can easily be one of the following; procmail, maildrop, Courier,
44 > and something super simple I don't remember the name of because I've not used it in so long.
45 >
46 >
47 >
48 >--
49 >Grant. . . .
50 >unix || die
51 >
52 >
53
54 So one thing that's annoyed me for a while is that there are several things which will pull in nullmailer to accept local mails, but don't pull in anything to do local delivery (And I'm not sure if nullmailer can even pass things to local delivery) so your local delivery mails by default just stack up in the nullmailer outbound queue unless you configure it to pass them off to an external mail system.
55
56 Since the most commonly used of these programs are things like cron where local delivery is probably the only thing most users would care about it might be nice if the default configuration were one that does that, and then those who want local mail relayed elsewhere still don't have any significant extra setup work to do.
57
58 LMP

Replies

Subject Author
Re: [gentoo-user] Local mail delivery agent (MDA) wanted Grant Taylor <gtaylor@×××××××××××××××××××××.net>