Subject: Bug#1018736: postfix: Please add a dpkg-reconfigure option to masquerade From when smarthosting

From: "Karl O. Pinc" <[email-masked]>
Date: Mon, 29 Aug 2022 13:55:00 -0500

Package: postfix
Version: 3.5.13-0+deb11u1
Severity: wishlist

Hello,

Many consumer ISPs won't relay outbound email unless it comes from the
email address associated with the account.

It would be nice if the Postfix pacakge had a configuration option so
that when a smarthost is used there is the option to masquerade
(envelope and regular header) the From address.  This gives the
"ordinary user" the ability to send outbound emails, which lets cron
and other system daemons email notifications that might otherwise be
lost in the local mail spool.  `reportbug` also works better when
outbound email is available, etc.

A sample debian/templates snippet:
----------<snip>---------------
Template: postfix/masquerade_from_address
Type: string
Default:
_Description: From address for all outbound mail:
 Many consumer ISPs will not deliver outbound email unless it comes
 from the email address(es) the ISP has assigned to the account.  You may
 designate one email address to be used as the From address in all
 email sent from this system.
 .
 Leave this value blank to prevent masquerading of outbound From addresses.
 .
 This entry affects both the envelope and header From addresses.
----------<snip>---------------

You may also want to add the following paragraph to the bottom of
Template: postfix/relayhost
----------<snip>---------------
.
Many consumer ISPs require all email to go through a relay host under
their control.  In these cases setting the relay host to your ISP's
server lets email reach the Internet.
----------<snip>---------------

Other options come to mind that would be useful when there's a
smarthost:

Using LMTP instead of SMTP.  Although perhaps this is
already taken care of because the relayhost syntax allows the choice
of port.  Maybe it wouldn't hurt to have the relayhost part of
debian/templates mention the SUBMISSION port, perhaps by example.

Configuring SASL authentication.  But SASL seems like it could be a
nest-of-worms, unless ISPs have more-or-less standardized.  (Is it
PLAIN over TLS or ....)  The utility of going down this road is not
clear to me, although it can be "nice" to have something that holds
your hand when configuring.  A simple initialization/use of a single
SASL username/password (as here:
https://www.linkedin.com/pulse/how-setup-postfix-relay-host-federico-panini)
could be nice.  But only if it would mostly-work.

Regards,
Karl

-- System Information:
Debian Release: 11.4
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-17-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages postfix depends on:
ii  adduser                3.118
ii  cpio                   2.13+dfsg-4
ii  debconf [debconf-2.0]  1.5.77
ii  dpkg                   1.20.11
ii  e2fsprogs              1.46.2-2
ii  libc6                  2.31-13+deb11u3
ii  libdb5.3               5.3.28+dfsg1-0.8
ii  libicu67               67.1-7
ii  libnsl2                1.3.0-2
ii  libsasl2-2             2.1.27+dfsg-2.1+deb11u1
ii  libssl1.1              1.1.1n-0+deb11u3
ii  lsb-base               11.1.0
ii  netbase                6.3
ii  ssl-cert               1.1.0+nmu1

Versions of packages postfix recommends:
ii  ca-certificates  20210119
ii  python3          3.9.2-3

Versions of packages postfix suggests:
ii  bsd-mailx [mail-reader]   8.1.2-0.20180807cvs-2
ii  claws-mail [mail-reader]  3.17.8-1+b1
ii  emacs-nox [mail-reader]   1:27.1+1-3.1
ii  libsasl2-modules          2.1.27+dfsg-2.1+deb11u1
ii  mailutils [mail-reader]   1:3.10-3+b1
pn  postfix-cdb               <none>
pn  postfix-doc               <none>
pn  postfix-ldap              <none>
pn  postfix-lmdb              <none>
pn  postfix-mysql             <none>
pn  postfix-pcre              <none>
pn  postfix-pgsql             <none>
ii  postfix-sqlite            3.5.13-0+deb11u1
ii  procmail                  3.22-26+deb11u1
pn  resolvconf                <none>
ii  sylpheed [mail-reader]    3.7.0-8
pn  ufw                       <none>

-- debconf information excluded