Closed Dexus closed 4 years ago
no-reply@localhost.local
address in From:
: did you restart iredadmin
service after applied the patch?/etc/amavis/conf.d/50-user
, parameter $policy_bank{'MYNETS'}
, does it have setting originating => 1,
and enable_dkim_signing => 1,
like below?$policy_bank{'MYNETS'} = {
originating => 1,
...
enable_dkim_signing => 1,
};
I changed LINE 165 in mlmmj/newsletter.py
to qr = iredutils.sendmail(recipients=subscriber, message_text=_msg_string, from_address=mail)
I use the iRedAdmin-Pro-SQL-4.3 release, fresh installed 3 days ago.
I changed LINE 165 in
mlmmj/newsletter.py
toqr = iredutils.sendmail(recipients=subscriber, message_text=_msg_string, from_address=mail)
You're right, we should always specify from_address
.
Fixed moment ago.
3. Please check Amavisd config file
/etc/amavis/conf.d/50-user
, parameter$policy_bank{'MYNETS'}
, does it have settingoriginating => 1,
andenable_dkim_signing => 1,
like below?$policy_bank{'MYNETS'} = { originating => 1, ... enable_dkim_signing => 1, };
is set like this.
I can reproduce this issue, and here's the fix:
/etc/postfix/master.cf
, find the pickup
transport like below:pickup unix n - n 60 1 pickup
content_filter
for it:pickup unix n - n 60 1 pickup
-o content_filter=smtp-amavis:[127.0.0.1]:10026
Now subscription confirm email (and all emails generated locally without smtp auth) will be signed with proper DKIM.
- Could you please show us full Postfix log related to this email? especially Amavisd log.
May 2 13:38:34 mail-nl-100 amavis[1187]: starting. /usr/sbin/amavisd-new at mailserver.example.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="en_US.UTF-8"
May 2 13:38:35 mail-nl-100 amavis[2027]: Net::Server: Group Not Defined. Defaulting to EGID '122 122'
May 2 13:38:35 mail-nl-100 amavis[2027]: Net::Server: User Not Defined. Defaulting to EUID '117'
May 2 13:38:35 mail-nl-100 amavis[2027]: No ext program for .F, tried: unfreeze, freeze -d, melt, fcat
May 2 13:38:35 mail-nl-100 amavis[2027]: No ext program for .zoo, tried: zoo, unzoo
May 2 13:38:35 mail-nl-100 amavis[2027]: No decoder for .F
May 2 13:38:35 mail-nl-100 amavis[2027]: No decoder for .zoo
May 2 13:38:35 mail-nl-100 amavis[2027]: Using primary internal av scanner code for clamav-socket
May 2 13:38:35 mail-nl-100 amavis[2027]: Found secondary av scanner clamav-clamscan at /usr/bin/clamscan
May 2 13:38:37 mail-nl-100 postfix/postfix-script[2458]: starting the Postfix mail system
May 2 13:38:37 mail-nl-100 postfix/master[2462]: daemon started -- version 3.3.0, configuration /etc/postfix
May 2 13:44:29 mail-nl-100 postfix/pickup[2466]: 49Dr2P2HPtz42Pq: uid=2001 from=<no-reply@localhost.local>
May 2 13:44:29 mail-nl-100 postfix/cleanup[3654]: 49Dr2P2HPtz42Pq: message-id=<49Dr2P2HPtz42Pq@mailserver.example.com>
May 2 13:44:29 mail-nl-100 postfix/qmgr[2467]: 49Dr2P2HPtz42Pq: from=<no-reply@localhost.local>, size=1066, nrcpt=1 (queue active)
May 2 13:44:29 mail-nl-100 postfix/10025/smtpd[3671]: connect from localhost[127.0.0.1]
May 2 13:44:29 mail-nl-100 postfix/10025/smtpd[3671]: 49Dr2P67RPz42Pn: client=localhost[127.0.0.1]
May 2 13:44:29 mail-nl-100 postfix/cleanup[3654]: 49Dr2P67RPz42Pn: message-id=<49Dr2P2HPtz42Pq@mailserver.example.com>
May 2 13:44:29 mail-nl-100 postfix/10025/smtpd[3671]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
May 2 13:44:29 mail-nl-100 postfix/qmgr[2467]: 49Dr2P67RPz42Pn: from=<no-reply@localhost.local>, size=1894, nrcpt=1 (queue active)
May 2 13:44:29 mail-nl-100 amavis[2487]: (02487-01) Passed CLEAN {RelayedInbound}, [127.0.0.1] /ESMTP <no-reply@localhost.local> -> <receiver3@gmail.com>, (), Message-ID: <49Dr2P2HPtz42Pq@mailserver.example.com>, mail_id: XMybXgnUvC8q, b: 0Ad-XyqMd, Hits: 2.128, size: 1066, queued_as: 49Dr2P67RPz42Pn, Subject: "Subscription confirm: TSG News", From: <newsletter@senderdomain.example.com>, helo=, Tests: [FROM_FMBLA_NEWDOM=1.5,HEADER_FROM_DIFFERENT_DOMAINS=0.249,NO_DNS_FOR_FROM=0.379,NO_RELAYS=-0.001,URIBL_BLOCKED=0.001], autolearn=no autolearn_force=no, autolearnscore=2.128, 502 ms
May 2 13:44:29 mail-nl-100 postfix/amavis/smtp[3663]: 49Dr2P2HPtz42Pq: to=<receiver3@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.63, delays=0.09/0.02/0.01/0.51, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 49Dr2P67RPz42Pn)
May 2 13:44:29 mail-nl-100 postfix/qmgr[2467]: 49Dr2P2HPtz42Pq: removed
May 2 13:44:30 mail-nl-100 postfix/smtp[3676]: Trusted TLS connection established to gmail-smtp-in.l.google.com[64.233.184.26]:25: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
May 2 13:44:30 mail-nl-100 postfix/smtp[3676]: 49Dr2P67RPz42Pn: to=<receiver3@gmail.com>, relay=gmail-smtp-in.l.google.com[64.233.184.26]:25, delay=0.77, delays=0.03/0.03/0.23/0.48, dsn=2.0.0, status=sent (250 2.0.0 OK DMARC:Quarantine 1588427070 f11si5248644wrr.209 - gsmtp)
May 2 13:44:30 mail-nl-100 postfix/qmgr[2467]: 49Dr2P67RPz42Pn: removed
May 2 14:05:30 mail-nl-100 postfix/pickup[2466]: 49DrVf3VJQz42Pr: uid=2001 from=<no-reply@localhost.local>
May 2 14:05:30 mail-nl-100 postfix/cleanup[4215]: 49DrVf3VJQz42Pr: message-id=<49DrVf3VJQz42Pr@mailserver.example.com>
May 2 14:05:30 mail-nl-100 postfix/qmgr[2467]: 49DrVf3VJQz42Pr: from=<no-reply@localhost.local>, size=1071, nrcpt=1 (queue active)
May 2 14:05:31 mail-nl-100 postfix/10025/smtpd[4227]: connect from localhost[127.0.0.1]
May 2 14:05:31 mail-nl-100 postfix/10025/smtpd[4227]: 49DrVg0YS7z42Pq: client=localhost[127.0.0.1]
May 2 14:05:31 mail-nl-100 postfix/cleanup[4215]: 49DrVg0YS7z42Pq: message-id=<49DrVf3VJQz42Pr@mailserver.example.com>
May 2 14:05:31 mail-nl-100 postfix/qmgr[2467]: 49DrVg0YS7z42Pq: from=<no-reply@localhost.local>, size=1909, nrcpt=1 (queue active)
May 2 14:05:31 mail-nl-100 postfix/10025/smtpd[4227]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
May 2 14:05:31 mail-nl-100 amavis[2486]: (02486-01) Passed CLEAN {RelayedInbound}, [127.0.0.1] /ESMTP <no-reply@localhost.local> -> <receiver2@gmail.com>, (), Message-ID: <49DrVf3VJQz42Pr@mailserver.example.com>, mail_id: zpFmEJUAWbdv, b: FgGRemqBR, Hits: 2.128, size: 1071, queued_as: 49DrVg0YS7z42Pq, Subject: "Subscription confirm: TSG News", From: <newsletter@senderdomain.example.com>, helo=, Tests: [FROM_FMBLA_NEWDOM=1.5,HEADER_FROM_DIFFERENT_DOMAINS=0.249,NO_DNS_FOR_FROM=0.379,NO_RELAYS=-0.001,URIBL_BLOCKED=0.001], autolearn=no autolearn_force=no, autolearnscore=2.128, 547 ms
May 2 14:05:31 mail-nl-100 postfix/amavis/smtp[4222]: 49DrVf3VJQz42Pr: to=<receiver2@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.69, delays=0.1/0.02/0.03/0.55, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 49DrVg0YS7z42Pq)
May 2 14:05:31 mail-nl-100 postfix/qmgr[2467]: 49DrVf3VJQz42Pr: removed
May 2 14:05:31 mail-nl-100 postfix/smtp[4231]: Trusted TLS connection established to gmail-smtp-in.l.google.com[64.233.184.26]:25: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
May 2 14:05:31 mail-nl-100 postfix/smtp[4231]: 49DrVg0YS7z42Pq: to=<receiver2@gmail.com>, relay=gmail-smtp-in.l.google.com[64.233.184.26]:25, delay=0.72, delays=0.02/0.03/0.22/0.45, dsn=2.0.0, status=sent (250 2.0.0 OK DMARC:Quarantine 1588428331 r1si5192228wrx.129 - gsmtp)
May 2 14:05:31 mail-nl-100 postfix/qmgr[2467]: 49DrVg0YS7z42Pq: removed
May 2 14:06:58 mail-nl-100 postfix/pickup[2466]: 49DrXL1txhz42Pr: uid=2001 from=<newsletter@senderdomain.example.com>
May 2 14:06:58 mail-nl-100 postfix/cleanup[4215]: 49DrXL1txhz42Pr: message-id=<49DrXL1txhz42Pr@mailserver.example.com>
May 2 14:06:58 mail-nl-100 postfix/qmgr[2467]: 49DrXL1txhz42Pr: from=<newsletter@senderdomain.example.com>, size=1072, nrcpt=1 (queue active)
May 2 14:06:58 mail-nl-100 postfix/10025/smtpd[4227]: connect from localhost[127.0.0.1]
May 2 14:06:58 mail-nl-100 postfix/10025/smtpd[4227]: 49DrXL3wQXz42Pq: client=localhost[127.0.0.1]
May 2 14:06:58 mail-nl-100 postfix/cleanup[4215]: 49DrXL3wQXz42Pq: message-id=<49DrXL1txhz42Pr@mailserver.example.com>
May 2 14:06:58 mail-nl-100 postfix/qmgr[2467]: 49DrXL3wQXz42Pq: from=<newsletter@senderdomain.example.com>, size=1629, nrcpt=1 (queue active)
May 2 14:06:58 mail-nl-100 postfix/10025/smtpd[4227]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
May 2 14:06:58 mail-nl-100 amavis[2487]: (02487-02) Passed CLEAN {RelayedInbound}, [127.0.0.1] /ESMTP <newsletter@senderdomain.example.com> -> <receiver@gmail.com>, (), Message-ID: <49DrXL1txhz42Pr@mailserver.example.com>, mail_id: dsA3NHb7fI4u, b: vzttPRLWD, Hits: 1.5, size: 1072, queued_as: 49DrXL3wQXz42Pq, Subject: "Subscription confirm: TSG News", From: <newsletter@senderdomain.example.com>, helo=, Tests: [FROM_FMBLA_NEWDOM=1.5,NO_RELAYS=-0.001,URIBL_BLOCKED=0.001], autolearn=no autolearn_force=no, autolearnscore=1.5, 271 ms
May 2 14:06:58 mail-nl-100 postfix/amavis/smtp[4222]: 49DrXL1txhz42Pr: to=<receiver@gmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.33, delays=0.04/0/0.01/0.28, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 49DrXL3wQXz42Pq)
May 2 14:06:58 mail-nl-100 postfix/qmgr[2467]: 49DrXL1txhz42Pr: removed
May 2 14:06:58 mail-nl-100 postfix/smtp[4231]: Trusted TLS connection established to gmail-smtp-in.l.google.com[64.233.184.26]:25: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
May 2 14:06:59 mail-nl-100 postfix/smtp[4231]: 49DrXL3wQXz42Pq: to=<receiver@gmail.com>, relay=gmail-smtp-in.l.google.com[64.233.184.26]:25, delay=0.67, delays=0.02/0.01/0.19/0.46, dsn=2.0.0, status=sent (250 2.0.0 OK 1588428419 p9si5408235wre.435 - gsmtp)
May 2 14:06:59 mail-nl-100 postfix/qmgr[2467]: 49DrXL3wQXz42Pq: removed
receiver@gmail.com -> worked but not DKIM signed receiver2@gmail.com -> receiver3@gmail.com > failed because no from_address
I can reproduce this issue, and here's the fix:
- In file
/etc/postfix/master.cf
, find thepickup
transport like below:pickup unix n - n 60 1 pickup
- Enable
content_filter
for it:pickup unix n - n 60 1 pickup -o content_filter=smtp-amavis:[127.0.0.1]:10026
- Restart Postfix service.
Now subscription confirm email (and all emails generated locally without smtp auth) will be signed with proper DKIM.
Thank you!
Fixed in iRedMail moment ago: https://github.com/iredmail/iRedMail/commit/74554496beadc0a3e4a942c09755a77da1de66b4
Hello again, i think everything that is send with the mlmmj in the iRedAdmin-Pro (SQL) should also send DKIM signed. But that is currently not done.
Also the message is using
no-reply@localhost.local
even after fix the #2 issue - see headers:Else your DKIM/DMARC settings will hit and the mail will mark as SPAM. Maybe also the
X-Spam-xxx
header fields should prevent from sending to outbound, but that should not be the question here.