You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Claudio Kuenzler <na...@gmail.com> on 2019/03/04 13:00:38 UTC

SA "loses" the mail with multiple recipients of the same domain?

Am working on an issue that mails sent from Postfix to SA are "lost" when
there are multiple recipients of the same recipient domain. Maybe it's
related to the content of the mail, but I'm not sure yet.

Postfix/SA implementation:

smtp      inet  n       -       y       -       -       smtpd
    -o content_filter=spamassassin

spamassassin unix -     n       n       -       -       pipe
        user=vmail argv=/usr/bin/spamc --filter-retries=3 -t 900 -s 5000000
-f -u ${recipient} -e
        /usr/sbin/sendmail -oi -f ${sender} ${recipient}


SA is started with the following additional options:

OPTIONS="-i 0.0.0.0 -A 127.0.0.0/8,192.168.  -x -q -Q -u nobody
--max-children 5 -s /var/log/spamassassin/spamassassin.log"

*Note: I'm using SQL lookup in the background for SA settings, hence the -u
${recipient} in case you wonder.*

Here's the mail log:

Mar  4 13:27:42 mail01 postfix/smtpd[6471]: 972062001D:
client=unknown[192.168.12.102]
Mar  4 13:27:42 mail01 postfix/cleanup[6563]: 972062001D: message-id=<
1551702462.511808.324328668@otrs.sender.com>
Mar  4 13:27:42 mail01 postfix/qmgr[32166]: 972062001D: from=<
support@sender.com>, size=6235, nrcpt=6 (queue active)
Mar  4 13:27:43 mail01 postfix/pipe[6763]: 972062001D: to=<
recipient1@recipient.com>, relay=spamassassin, delay=0.73,
delays=0.01/0.01/0/0.71, dsn=2.0.0, status=sent (delivered via spamassassin
service (X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
mail01.sender.com X-Spam-Level:  X-S))
Mar  4 13:27:43 mail01 postfix/pipe[6763]: 972062001D: to=<
recipient2@recipient.com>, relay=spamassassin, delay=0.73,
delays=0.01/0.01/0/0.71, dsn=2.0.0, status=sent (delivered via spamassassin
service (X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
mail01.sender.com X-Spam-Level:  X-S))
Mar  4 13:27:43 mail01 postfix/pipe[6763]: 972062001D: to=<
recipient3@recipient.com>, relay=spamassassin, delay=0.73,
delays=0.01/0.01/0/0.71, dsn=2.0.0, status=sent (delivered via spamassassin
service (X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
mail01.sender.com X-Spam-Level:  X-S))
Mar  4 13:27:43 mail01 postfix/pipe[6763]: 972062001D: to=<
recipient4@recipient.com>, relay=spamassassin, delay=0.73,
delays=0.01/0.01/0/0.71, dsn=2.0.0, status=sent (delivered via spamassassin
service (X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
mail01.sender.com X-Spam-Level:  X-S))
Mar  4 13:27:43 mail01 postfix/pipe[6763]: 972062001D: to=<
recipient5@recipient.com>, relay=spamassassin, delay=0.73,
delays=0.01/0.01/0/0.71, dsn=2.0.0, status=sent (delivered via spamassassin
service (X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
mail01.sender.com X-Spam-Level:  X-S))
Mar  4 13:27:43 mail01 postfix/pipe[6566]: 972062001D: to=<
differentuser@gmail.com>, relay=spamassassin, delay=0.75,
delays=0.01/0/0/0.74, dsn=2.0.0, status=sent (delivered via spamassassin
service)
Mar  4 13:27:43 mail01 postfix/qmgr[32166]: 972062001D: removed
Mar  4 13:27:43 mail01 postfix/qmgr[32166]: 972062001D: removed
Mar  4 13:27:43 mail01 postfix/cleanup[6563]: 5902820022: message-id=<
1551702462.511808.324328668@otrs.sender.com>
Mar  4 13:27:43 mail01 postfix/qmgr[32166]: 5902820022: from=<
support@sender.com>, size=6589, nrcpt=1 (queue active)
Mar  4 13:27:43 mail01 postfix/smtp[6768]: 5902820022: to=<
differentuser@gmail.com>, relay=gmail-smtp-in.l.google.com[108.177.126.26]:25,
delay=0.4, delays=0.02/0.01/0.14/0.24, dsn=2.0.0, status=sent (250 2.0.0
OK  1551702463 p33si1538012eda.60 - gsmtp)
Mar  4 13:27:43 mail01 postfix/qmgr[32166]: 5902820022: removed

So as you can see all the mails to the different recipients were sent to
Spamassassin.
Interestingly the log message after "delivered via spamassassin service" is
different on the recipients of the domain recipient.com:

(delivered via spamassassin service (X-Spam-Checker-Version: SpamAssassin
3.4.2 (2018-09-13) on  mail01.sender.com X-Spam-Level:  X-S))

Normally I only see such a log entry:

(delivered via spamassassin service)

This is also the case in the last recipient of that mail, which uses an
account on gmail.com.
It was the only e-mail that was sent back to Postfix and finally was sent
to the destination mail server.
For all the other mails intended for recipient.com users, the mail
disappeared. It's not in any Postfix queue, it's just "gone". In SA's log I
can only find entries for the recpient using gmail and one recipient of
recipient.com:

Mon Mar  4 13:27:42 2019 [20119] info: spamd: processing message <
1551702462.511808.324328668@otrs.sender.com> for
differentuser@gmail.com:65534
Mon Mar  4 13:27:42 2019 [20120] info: spamd: processing message <
1551702462.511808.324328668@otrs.sender.com> for
recipient3@recipient.com:65534
Mon Mar  4 13:27:43 2019 [20119] info: spamd: clean message (-1.0/6.0) for
differentuser@gmail.com:65534 in 0.7 seconds, 6060 bytes.
Mon Mar  4 13:27:43 2019 [20119] info: spamd: result: . 0 -
ALL_TRUSTED,HTML_MESSAGE,T_KAM_HTML_FONT_INVALID
scantime=0.7,size=6060,user=differentuser@gmail.com
,uid=65534,required_score=6.0,rhost=127.0.0.1,raddr=127.0.0.1,rport=53866,mid=<
1551702462.511808.324328668@otrs.sender.com>,autolearn=disabled
Mon Mar  4 13:27:43 2019 [20120] info: spamd: clean message (-1.0/6.0) for
recipient3@recipient.com:65534 in 0.7 seconds, 6060 bytes.
Mon Mar  4 13:27:43 2019 [20120] info: spamd: result: . 0 -
ALL_TRUSTED,HTML_MESSAGE,T_KAM_HTML_FONT_INVALID
scantime=0.7,size=6060,user=recipient3@recipient.com
,uid=65534,required_score=6.0,rhost=127.0.0.1,raddr=127.0.0.1,rport=53870,mid=<
1551702462.511808.324328668@otrs.sender.com>,autolearn=disabled
Mon Mar  4 13:27:43 2019 [20118] info: prefork: child states: BI
Mon Mar  4 13:27:43 2019 [20118] info: prefork: child states: II

The other recpients don't show up.

But if I send the very same mail with the same response/content to a single
recipient of that domain, the mail goes through SA and is delivered:

Mar  4 13:31:02 mail01 postfix/smtpd[6471]: 49C072001D:
client=unknown[192.168.12.102]
Mar  4 13:31:02 mail01 postfix/cleanup[6966]: 49C072001D: message-id=<
1551702662.867311.085249388@otrs.sender.com>
Mar  4 13:31:02 mail01 postfix/qmgr[32166]: 49C072001D: from=<
support@sender.com>, size=7286, nrcpt=1 (queue active)
Mar  4 13:31:03 mail01 postfix/pipe[6967]: 49C072001D: to=<
recipient1@recipient.com>, relay=spamassassin, delay=0.74,
delays=0.01/0/0/0.73, dsn=2.0.0, status=sent (delivered via spamassassin
service)
Mar  4 13:31:03 mail01 postfix/qmgr[32166]: 49C072001D: removed

What would explain this behaviour? Why is the (incomplete?) log entry
shown: "(delivered via spamassassin service (X-Spam-Checker-Version:
SpamAssassin 3.4.2 (2018-09-13) on  mail01.sender.com X-Spam-Level:  X-S))"
?

Re: SA "loses" the mail with multiple recipients of the same domain?

Posted by Claudio Kuenzler <na...@gmail.com>.
On Mon, Mar 4, 2019 at 2:04 PM Reindl Harald <h....@thelounge.net> wrote:

>
>
> Am 04.03.19 um 14:00 schrieb Claudio Kuenzler:
> > Am working on an issue that mails sent from Postfix to SA are "lost"
> > when there are multiple recipients of the same recipient domain. Maybe
> > it's related to the content of the mail, but I'm not sure yet.
> >
> > Postfix/SA implementation:
> >
> > smtp      inet  n       -       y       -       -       smtpd
> >     -o content_filter=spamassassin
> >
> > spamassassin unix -     n       n       -       -       pipe
> >         user=vmail argv=/usr/bin/spamc --filter-retries=3 -t 900 -s
> > 5000000 -f -u ${recipient} -e
> >         /usr/sbin/sendmail -oi -f ${sender} ${recipient}
>
> just don't use such terrible configs to begin with
> setup a proper glue like spamass-milter
>

So basically don't use direct spamc in Postfix, correct? I just found this
on the wiki which would confirm that:

----------------------------------

If you use user preferences stored in SQL, you should change "spamassassin"
service in master.cf to following:

spamassassin          unix  -       n       n       -       -
pipe   flags=Rq user=nobody argv=/path/to/spamc -u ${user} -e
/path/to/postfix/sendmail -oi -f ${sender} ${recipient}

*Note that this exact method of invoking SpamAssassin
<https://wiki.apache.org/spamassassin/SpamAssassin> is not very robust*.
----------------------------------

I have to admit I haven't seen that warning before.

Thanks for the advice, will take a closer look at that.