On Tue, Jul 23, 2019 at 12:15:26PM +0200, Klemens Nanni wrote: > On Tue, Jul 23, 2019 at 11:00:04AM +0200, Gilles Chehade wrote: > > there is no schema today that should default to 587, unless > > submission:// is introduced as an alias to smtp+tls AND port 587. > Alright; this way we guarantee not to break any setup as the default of > 25 for everything is kept, except `smtps' which now picks 465. > > I also tweaked the wording, which seems well enough to me to ask for OKs. >
One last change and the diff is ok gilles@: /* need to specify an explicit port for LMTP */ if (relay->flags & RELAY_LMTP) relay->port = 0; This becomes unnecessary with your diff since you assign port to 0 for lmtp:// already. > Index: smtpd.conf.5 > =================================================================== > RCS file: /cvs/src/usr.sbin/smtpd/smtpd.conf.5,v > retrieving revision 1.210 > diff -u -p -r1.210 smtpd.conf.5 > --- smtpd.conf.5 22 Dec 2018 08:54:02 -0000 1.210 > +++ smtpd.conf.5 23 Jul 2019 10:07:47 -0000 > @@ -250,9 +250,14 @@ Normal SMTP session with mandatory START > Plain text SMTP session without TLS. > .It lmtp > LMTP session. > +.Ar port > +is required. > .It smtps > -SMTP session with forced TLS on connection. > +SMTP session with forced TLS on connection, default port is 465. > .El > +Unless noted, > +.Ar port > +defaults to 25. > .Pp > The > .Ar label > Index: to.c > =================================================================== > RCS file: /cvs/src/usr.sbin/smtpd/to.c,v > retrieving revision 1.36 > diff -u -p -r1.36 to.c > --- to.c 22 Jul 2019 23:01:48 -0000 1.36 > +++ to.c 23 Jul 2019 10:07:47 -0000 > @@ -305,16 +305,17 @@ text_to_relayhost(struct relayhost *rela > const char *name; > int tls; > uint16_t flags; > + uint16_t port; > } schemas [] = { > /* > * new schemas should be *appended* otherwise the default > * schema index needs to be updated later in this function. > */ > - { "smtp://", RELAY_TLS_OPPORTUNISTIC, 0 > }, > - { "smtp+tls://", RELAY_TLS_STARTTLS, 0 > }, > - { "smtp+notls://", RELAY_TLS_NO, 0 > }, > - { "lmtp://", RELAY_TLS_NO, RELAY_LMTP > }, > - { "smtps://", RELAY_TLS_SMTPS, 0 > } > + { "smtp://", RELAY_TLS_OPPORTUNISTIC, 0, > 25 }, > + { "smtp+tls://", RELAY_TLS_STARTTLS, 0, > 25 }, > + { "smtp+notls://", RELAY_TLS_NO, 0, > 25 }, > + { "lmtp://", RELAY_TLS_NO, RELAY_LMTP, > 0 }, > + { "smtps://", RELAY_TLS_SMTPS, 0, > 465 } > }; > const char *errstr = NULL; > char *p, *q; > @@ -346,6 +347,7 @@ text_to_relayhost(struct relayhost *rela > > relay->tls = schemas[i].tls; > relay->flags = schemas[i].flags; > + relay->port = schemas[i].port; > > /* need to specify an explicit port for LMTP */ > if (relay->flags & RELAY_LMTP) > -- Gilles Chehade @poolpOrg https://www.poolp.org patreon: https://www.patreon.com/gilles