Do not just reboot, do docker compose up -d
!!
English
How to implement Global List-Unsubscribe Header
esackbauer
I tried and nothing still..
What i literally tried is:
- added new line
header_checks = regexp:/etc/postfix/list_unsub_header
to/home/mailcow-dockerized/data/conf/postfix/main.cf
- created
list_unsub_header
next tomain.cf
in/home/mailcow-dockerized/data/conf/postfix/list_unsub_header
- ran
docker compose up -d
- restarted
postfix-mailcow
form mailcow UI
Please where did I mess up? I have been trying this for days..
- Edited
DocFraggle
I tried running docker compose down
then docker compose up -d
but nothing.
Also the header_checks
line that was added in the /home/mailcow-dockerized/data/conf/postfix/main.cf
disappeared
- Edited
Olgaa
I guess you want this for Incoming messages!
in your case create the file:
/home/mailcow-dockerized/data/conf/postfix/list_unsub_header
add to:
/home/mailcow-dockerized/data/conf/postfix/extra.cf
header_checks = regexp:/opt/postfix/conf/list_unsub_header
run:
docker compose up -d
docker compose restart postfix-mailcow
although i have no clue how this will work in a multidomain setup just for one domain.
- Edited
i used exactly the same manual
the only difference is the path in the extra.cf
what is the output from:
docker-compose exec postfix-mailcow postconf -n | grep -i header
run below and post the output if something found
docker-compose logs postfix-mailcow | grep prepend
I did a little bit more of fiddling around. So please read the below carefully.
The example Iâve explained earlier just works with incoming mails. As I already wrote.
E.g. from gmail to mailcow!
- In postfix you have to differentiate SMTPâDâ and SMTP. The âDâ is responsible for incoming mails. So, what you
need is âsmtp_header_checks =â in extra.cf for outgoing a assume. - BUT âsmtp_header_checksâ is already configured per default and is using âanonymize_headers.pcreâ
- You can either completely override âanonymize_headers.pcreâ by setting smtp_header_checks =
regexp:/opt/postfix/conf/list_unsub_header in âextra.cfâ, what Iâve done for testing, or try to add the content of
your âlist_unsub_headerâ at the bottom of âanonymize_headers.pcreâ (should work) - There are two issues with the above. âanonymize_headers.pcreâ might be overwritten with an update, or you might
having obsolete content in âlist_unsub_headerâ if the content changes in
âanonymize_headers.pcreâ - And the last point is, create your regex so that itâll will match. Check in recipientâs mailbox for an existing header field. As example, if you send a mail from SoGo with no attachment there there is no âContent-Transfer-Encodingâ in the header.
Final Word:
You might want to look around for another solution to run newsletter or a mailinglist rather than using mailcow, since it is some sort of closed solution.
Even though I havenât found one use case yet which is not covered by mailcow for running a regular, very well designed âmail applianceâ.
Over and out.
maybe @DocFraggle or @esackbauer you can give a few words since you seem to have a lot of experience with mailcow
- Edited
- Best Answerset by eakteam
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!!!
- Edited
I would also strongly suggest to outsource these kind of things into a separate solution which also allows better management. Especially in EU with GDPR it is easier to document in case of audits or complaints. In bigger companies this is typically done within CRM, but there is also a free open source solution:
Havent tried it yet, but looks decent.
Hi fellow bovine enthusiasts. Given the timing, it may be safe to assume you are/were researching this âList-Unsubscribeâ configuration to satiate new deliverability requirements from the âbig 3â. Just wanted to add a few things:
- Gmail expects a âone-clickâ unsub; not the mailto: option youâre looking into. This is to facilitate straightforward/automated list removal for their users.
- Make sure you understand that, by adding a âList-Unsubscribeâ header (regardless of configuration) youâre essentially signaling your intention to send bulk email. This may have unintended consequencesâparticularly if your âList-Unsubscribeâ is misconfigured, inoperable, or otherwise fails to meet Googâs expectations.
- Further to the above, what Goog does with the (possible fact) that you include âList-Unsubscribeâ headers, yet _do not send bulk email (5,000/day ) is an exercise left to speculation and/or trial & error involving significant downside.
As for us, we plan to hold off on adding these headers to Postfix for now, as our server is strictly used for transactional email.
Cheers!