Re: smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
On Tue, Mar 19 2019 15:28:48 -0600, Todd C. Miller wrote: > On Tue, 19 Mar 2019 23:24:24 +0200, Lauri Tirkkonen wrote: > > > I might be blind, but 'grep -r send-mail /usr/ports/pobj/nmh-1.7.1' > > comes up empty for me after 'make extract' in /usr/ports/mail/nmh? > > It looks like spost.c is historical code that is not actually packaged > in the distribution (though it is in the nmh repo). I did 'make fetch' in /usr/ports, extracted the results by hand (I avoided 'make extract' because that would try to compile and install dependencies), and did grep -rw send-mail on the directory where I extracted the distfiles. As far as I can tell there is nothing in ports that uses "send-mail" as argv[0] to anything. The false positives are: - 364 occurrences in emacs-26.1/; these are references to 'send-mail-function', 'send-mail-with-sendmail', 'message-send-mail', 'message-send-mail-hook', etc. - 362 occurrences in xemacs-packages/; similar to above. - 11 occurrences in gettext-0.19.8.1/; references to 'po-send-mail' in po-mode.el - 11 occurrences in mgetty-1.1.37/; options called 'success-send-mail' and 'failure-send-mail', in faxrunq/faxrunqd - 1 occurrence in git-2.21.0/Documentation/RelNotes/1.6.0.txt; typo of 'git-send-mail', when it means to say 'git-send-email'. -- Lauri Tirkkonen | lotheac @ IRCnet
Re: smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
On Tue, 19 Mar 2019 23:24:24 +0200, Lauri Tirkkonen wrote: > I might be blind, but 'grep -r send-mail /usr/ports/pobj/nmh-1.7.1' > comes up empty for me after 'make extract' in /usr/ports/mail/nmh? It looks like spost.c is historical code that is not actually packaged in the distribution (though it is in the nmh repo). - todd
Re: smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
On Tue, Mar 19 2019 15:16:10 -0600, Todd C. Miller wrote: > On Tue, 19 Mar 2019 22:15:17 +0200, Lauri Tirkkonen wrote: > > > thanks. that means no need for smtpctl and mailer.conf to check for it > > any more. > > Not so fast. There are still things in ports that use send-mail. > I haven't grepped the ports tree but the nmh port at least uses > "send-mail" for argv[0] in its spost utility. I might be blind, but 'grep -r send-mail /usr/ports/pobj/nmh-1.7.1' comes up empty for me after 'make extract' in /usr/ports/mail/nmh? -- Lauri Tirkkonen | lotheac @ IRCnet
Re: smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
On Tue, 19 Mar 2019 22:15:17 +0200, Lauri Tirkkonen wrote: > thanks. that means no need for smtpctl and mailer.conf to check for it > any more. Not so fast. There are still things in ports that use send-mail. I haven't grepped the ports tree but the nmh port at least uses "send-mail" for argv[0] in its spost utility. It probably got that from mail(1) originally. - todd
Re: smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
On Tue, Mar 19 2019 14:18:06 -0600, Theo de Raadt wrote: > Have you verified there are *no other programs* in the entire greater > ecosystem > using that name? I have not. But eg. FreeBSD and NetBSD don't support these names in mailer.conf either: https://github.com/freebsd/freebsd/blob/master/etc/mail/mailer.conf https://github.com/NetBSD/src/blob/trunk/etc/mailer.conf so I'm not really worried about that. -- Lauri Tirkkonen | lotheac @ IRCnet
Re: smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
Have you verified there are *no other programs* in the entire greater ecosystem using that name? > On Tue, Mar 19 2019 07:26:41 -0600, Todd C. Miller wrote: > > On Tue, 19 Mar 2019 10:33:07 +0200, Lauri Tirkkonen wrote: > > > > > ping - doesn't look removed yet :) > > > > Committed. > > thanks. that means no need for smtpctl and mailer.conf to check for it > any more. > > diff --git a/etc/mailer.conf b/etc/mailer.conf > index fff9e7adbd1..9c752022261 100644 > --- a/etc/mailer.conf > +++ b/etc/mailer.conf > @@ -3,7 +3,6 @@ > # Execute the "real" sendmail program, which is now smtpd by default > # > sendmail /usr/sbin/smtpctl > -send-mail/usr/sbin/smtpctl > mailq/usr/sbin/smtpctl > makemap /usr/sbin/smtpctl > newaliases /usr/sbin/smtpctl > diff --git a/usr.sbin/mailwrapper/mailer.conf.5 > b/usr.sbin/mailwrapper/mailer.conf.5 > index 288ff4f4c2e..2c303dedbdc 100644 > --- a/usr.sbin/mailwrapper/mailer.conf.5 > +++ b/usr.sbin/mailwrapper/mailer.conf.5 > @@ -67,7 +67,6 @@ MTA suite: > .Bd -literal > # Emulate sendmail using smtpd > sendmail /usr/sbin/smtpctl > -send-mail/usr/sbin/smtpctl > mailq/usr/sbin/smtpctl > makemap /usr/sbin/smtpctl > newaliases /usr/sbin/smtpctl > @@ -80,7 +79,6 @@ MTA suite in place of > .Bd -literal > # Execute the "real" sendmail program > sendmail /usr/local/libexec/sendmail/sendmail > -send-mail/usr/local/libexec/sendmail/sendmail > mailq/usr/local/libexec/sendmail/sendmail > makemap /usr/local/libexec/sendmail/makemap > newaliases /usr/local/libexec/sendmail/sendmail > diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c > index 4b44d9dd30a..9ebef45f159 100644 > --- a/usr.sbin/smtpd/smtpctl.c > +++ b/usr.sbin/smtpd/smtpctl.c > @@ -1116,8 +1116,7 @@ sendmail_compat(int argc, char **argv) > gid_tgid; > int i, r; > > - if (strcmp(__progname, "sendmail") == 0 || > - strcmp(__progname, "send-mail") == 0) { > + if (strcmp(__progname, "sendmail") == 0) { > /* >* determine whether we are called with flags >* that should invoke makemap/newaliases. > > -- > Lauri Tirkkonen | lotheac @ IRCnet >
smtpctl, mailer.conf: drop send-mail (was: mail(1): use "sendmail" as argv[0] for sendmail)
On Tue, Mar 19 2019 07:26:41 -0600, Todd C. Miller wrote: > On Tue, 19 Mar 2019 10:33:07 +0200, Lauri Tirkkonen wrote: > > > ping - doesn't look removed yet :) > > Committed. thanks. that means no need for smtpctl and mailer.conf to check for it any more. diff --git a/etc/mailer.conf b/etc/mailer.conf index fff9e7adbd1..9c752022261 100644 --- a/etc/mailer.conf +++ b/etc/mailer.conf @@ -3,7 +3,6 @@ # Execute the "real" sendmail program, which is now smtpd by default # sendmail /usr/sbin/smtpctl -send-mail /usr/sbin/smtpctl mailq /usr/sbin/smtpctl makemap/usr/sbin/smtpctl newaliases /usr/sbin/smtpctl diff --git a/usr.sbin/mailwrapper/mailer.conf.5 b/usr.sbin/mailwrapper/mailer.conf.5 index 288ff4f4c2e..2c303dedbdc 100644 --- a/usr.sbin/mailwrapper/mailer.conf.5 +++ b/usr.sbin/mailwrapper/mailer.conf.5 @@ -67,7 +67,6 @@ MTA suite: .Bd -literal # Emulate sendmail using smtpd sendmail /usr/sbin/smtpctl -send-mail /usr/sbin/smtpctl mailq /usr/sbin/smtpctl makemap/usr/sbin/smtpctl newaliases /usr/sbin/smtpctl @@ -80,7 +79,6 @@ MTA suite in place of .Bd -literal # Execute the "real" sendmail program sendmail /usr/local/libexec/sendmail/sendmail -send-mail /usr/local/libexec/sendmail/sendmail mailq /usr/local/libexec/sendmail/sendmail makemap/usr/local/libexec/sendmail/makemap newaliases /usr/local/libexec/sendmail/sendmail diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 4b44d9dd30a..9ebef45f159 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1116,8 +1116,7 @@ sendmail_compat(int argc, char **argv) gid_tgid; int i, r; - if (strcmp(__progname, "sendmail") == 0 || - strcmp(__progname, "send-mail") == 0) { + if (strcmp(__progname, "sendmail") == 0) { /* * determine whether we are called with flags * that should invoke makemap/newaliases. -- Lauri Tirkkonen | lotheac @ IRCnet
Re: mail(1): use "sendmail" as argv[0] for sendmail
On Tue, 19 Mar 2019 10:33:07 +0200, Lauri Tirkkonen wrote: > ping - doesn't look removed yet :) Committed. - todd
Re: mail(1): use "sendmail" as argv[0] for sendmail
On Mon, Mar 04 2019 09:01:40 -0700, Todd C. Miller wrote: > On Mon, 04 Mar 2019 16:38:37 +0100, Gilles Chehade wrote: > > > I wish we had an historian who could enlighten us as to why both exist. > > That code actually predates sendmail and was in the original revision > when delivermail was still in use. Sendmail itself never checked > its argv[0] for "send-mail" as far as I know. > > At this point I consider it a historical oddity that is safe to > remove. ping - doesn't look removed yet :) -- Lauri Tirkkonen | lotheac @ IRCnet
Re: mail(1): use "sendmail" as argv[0] for sendmail
Todd C. Miller wrote: > On Mon, 04 Mar 2019 16:38:37 +0100, Gilles Chehade wrote: > > > I wish we had an historian who could enlighten us as to why both exist. > > That code actually predates sendmail and was in the original revision > when delivermail was still in use. Sendmail itself never checked > its argv[0] for "send-mail" as far as I know. > > At this point I consider it a historical oddity that is safe to > remove. Sounds right.
Re: mail(1): use "sendmail" as argv[0] for sendmail
On Mon, 04 Mar 2019 16:38:37 +0100, Gilles Chehade wrote: > I wish we had an historian who could enlighten us as to why both exist. That code actually predates sendmail and was in the original revision when delivermail was still in use. Sendmail itself never checked its argv[0] for "send-mail" as far as I know. At this point I consider it a historical oddity that is safe to remove. - todd
Re: mail(1): use "sendmail" as argv[0] for sendmail
On Fri, Mar 01, 2019 at 03:16:26PM +0200, Lauri Tirkkonen wrote: > For some reason mail(1) is using "send-mail" as argv[0] for sendmail. > /etc/mailer.conf and smtpctl handle this identically to "sendmail", so > it seems a bit redundant. This diff makes mail(1) use "sendmail" as > argv[0], possibly allowing that duplication to be removed later from > mailer.conf and smtpctl. > > Noticed while porting mail(1) to Unleashed (where we also have > mailwrapper, but no default configuration for "send-mail"). > I wish we had an historian who could enlighten us as to why both exist. smtpctl handles send-mail because mail uses send-mail and I suspect that some hackers use mua from the seventies that also use send-mail. if we could confirm that there's no harm in the following diff, then the send-mail case in mailer.conf and smtpctl could bite the dust afaic > diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c > index 8f127ac837f..723f9da0a53 100644 > --- a/usr.bin/mail/send.c > +++ b/usr.bin/mail/send.c > @@ -371,7 +371,7 @@ mail1(struct header *hp, int printheaders) > (void)savemail(expand(cp), mtf); > > /* Setup sendmail arguments. */ > -*ap++ = "send-mail"; > +*ap++ = "sendmail"; > *ap++ = "-i"; > *ap++ = "-t"; > cp = hp->h_from ? hp->h_from : value("from"); > -- > Lauri Tirkkonen | lotheac @ IRCnet > -- Gilles Chehade @poolpOrg https://www.poolp.org tip me: https://paypal.me/poolpOrg
mail(1): use "sendmail" as argv[0] for sendmail
For some reason mail(1) is using "send-mail" as argv[0] for sendmail. /etc/mailer.conf and smtpctl handle this identically to "sendmail", so it seems a bit redundant. This diff makes mail(1) use "sendmail" as argv[0], possibly allowing that duplication to be removed later from mailer.conf and smtpctl. Noticed while porting mail(1) to Unleashed (where we also have mailwrapper, but no default configuration for "send-mail"). diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index 8f127ac837f..723f9da0a53 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -371,7 +371,7 @@ mail1(struct header *hp, int printheaders) (void)savemail(expand(cp), mtf); /* Setup sendmail arguments. */ -*ap++ = "send-mail"; +*ap++ = "sendmail"; *ap++ = "-i"; *ap++ = "-t"; cp = hp->h_from ? hp->h_from : value("from"); -- Lauri Tirkkonen | lotheac @ IRCnet