piperino
docker-compose exec postfix-mailcow postconf -n | grep -i header
gives me:
header_checks = regexp:/opt/postfix/conf/list_unsub_header
smtp_header_checks = pcre:/opt/postfix/conf/anonymize_headers.pcre
smtpd_sasl_authenticated_header = yes
smtpd_tls_received_header = yes
and
docker-compose logs postfix-mailcow | grep prepend
gives:
postfix-mailcow-1 | Feb 27 21:58:44 442c313eb6bb postfix/cleanup[483]: 75E6B13C1B04: prepend: header Content-Type: text/html; charset=utf-8 from mail-qt1-f181.google.com[209.85.160.181]; from=<anupam.convodigital@gmail.com> to=<contact@mydomain.com> proto=ESMTP helo=<mail-qt1-f181.google.com>: List-Unsubscribe: mailto:unsubscribe@mydomain.com?subject=unsubscribe
postfix-mailcow-1 | Feb 27 22:16:21 442c313eb6bb postfix/cleanup[483]: 834C613C0A61: prepend: header Content-Transfer-Encoding: quoted-printable from mail-pf1-f171.google.com[209.85.210.171]; from=<madison@teamrisems.com> to=<updates@mydomain.com> proto=ESMTP helo=<mail-pf1-f171.google.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 27 22:26:51 442c313eb6bb postfix/cleanup[602]: D1A8513C1A2C: prepend: header Content-Transfer-Encoding: quoted-printable from mail-yb1-f174.google.com[209.85.219.174]; from=<team@dobleskemarketing.com> to=<news@mydomain.com> proto=ESMTP helo=<mail-yb1-f174.google.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 27 22:27:45 442c313eb6bb postfix/cleanup[602]: 1366613C1A4F: prepend: header Content-Transfer-Encoding: 7bit from mail176.acems1.com[192.92.97.176]; from=<bounce-3156164-132-221260-contact=mydomain.com@mail172.acems1.com> to=<contact@mydomain.com> proto=ESMTP helo=<mail176.acems1.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 27 22:27:45 442c313eb6bb postfix/cleanup[602]: 1366613C1A4F: prepend: header Content-Transfer-Encoding: quoted-printable from mail176.acems1.com[192.92.97.176]; from=<bounce-3156164-132-221260-contact=mydomain.com@mail172.acems1.com> to=<contact@mydomain.com> proto=ESMTP helo=<mail176.acems1.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 27 22:44:04 442c313eb6bb postfix/cleanup[794]: 695B713C18EF: prepend: header Content-Transfer-Encoding: quoted-printable from mout.kundenserver.de[217.72.192.74]; from=<nayef@hellosugarsmile.de> to=<contact@mydomain.com> proto=ESMTP helo=<mout.kundenserver.de>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 27 23:48:34 442c313eb6bb postfix/cleanup[1501]: 9848313C0079: prepend: header Content-Transfer-Encoding: quoted-printable from mail-io1-f54.google.com[209.85.166.54]; from=<ashfaque@theideaforges.com> to=<updates@mydomain.com> proto=ESMTP helo=<mail-io1-f54.google.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 27 23:58:54 442c313eb6bb postfix/cleanup[1659]: D903F13C18D6: prepend: header Content-Transfer-Encoding: quoted-printable from mout.perfora.net[74.208.4.197]; from=<peytonriley@infinitumsolar.info> to=<contact@mydomain.com> proto=ESMTP helo=<mout.perfora.net>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 28 00:02:40 442c313eb6bb postfix/cleanup[1729]: 7C56A13C1ABD: prepend: header Content-Transfer-Encoding: quoted-printable from mail-qk1-f172.google.com[209.85.222.172]; from=<anupam.convodigital@gmail.com> to=<contact@mydomain.com> proto=ESMTP helo=<mail-qk1-f172.google.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 28 00:17:44 442c313eb6bb postfix/cleanup[1862]: C340313C17F6: prepend: header Content-Transfer-Encoding: quoted-printable from mout.kundenserver.de[212.227.126.133]; from=<simon@marketingfilmsmedia.info> to=<updates@mydomain.com> proto=ESMTP helo=<mout.kundenserver.de>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
postfix-mailcow-1 | Feb 28 08:41:47 442c313eb6bb postfix/cleanup[6307]: 3EE2A13C1BC1: prepend: header Content-Transfer-Encoding: quoted-printable from mta-07-3.privateemail.com[198.54.118.214]; from=<samuel@bestpldomains.com> to=<updates@mydomain.com> proto=ESMTP helo=<MTA-07-3.privateemail.com>: List-Unsubscribe: mailto:<unsubscribe@mydomain.com>?subject=unsubscribe>"
[unknown] Aha! I thought it was for outgoing emails, like when you send an email from mailcow and it shows to the recipient an âunsubscribeâ button đ
[unknown]
Adding line /^Content-Type:/i PREPEND List-Unsubscribe: <mailto:unsubscribe@mydomain.com>
straight to anonymize_headers.pcre
then running docker compose up -d
and docker compose restart postfix-mailcow
fixes it! đ«Ł
Now there is an List-Unsubscribe header in the source! As you said it might be overwritten after an update but at least it works for now until there is a better solution! Thank you!!! đ