milter after queue

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

milter after queue

Christos Chatzaras
I install rspamd in a server and I use postfix milter from another server to scan outgoing e-mails.

I have a php script that sends mails. Before the rspamd milter the e-mails I sent using the php script where added in the postfix queue and the php script finish execution in few seconds. Then the e-mails in queue sent within few minutes.

Now it takes a long time because it sends e-mails without using postfix queue and the php script timeouts.

Is it possible to scan outgoing messages using rspamd after adding the e-mails to queue?
Reply | Threaded
Open this post in threaded view
|

Re: milter after queue

Wietse Venema
Christos Chatzaras:

> I install rspamd in a server and I use postfix milter from another
> server to scan outgoing e-mails.
>
> I have a php script that sends mails. Before the rspamd milter the
> e-mails I sent using the php script where added in the postfix
> queue and the php script finish execution in few seconds. Then the
> e-mails in queue sent within few minutes.
>
> Now it takes a long time because it sends e-mails without using
> postfix queue and the php script timeouts.
>
> Is it possible to scan outgoing messages using rspamd after adding
> the e-mails to queue?

Maybe you can figure out why rspamd is slow. Are you sending huge
messages, or is rspamd slow because of DNS lookups?

Maybe you can use /usr/sbin/sendmail for local submissions? This
requires configuring non_smtpd_milters in main.cf.

Otherwise, you can run milters post-queue, with a null SMTP-based
content filter (Postfix SMTP client sending directly into Postfix
SMTP server).

/etc/postfix/master.cf
    # The default before-queue SMTP port, configured
    # to send mail through a null SMTP filter.
    smtp  inet .. .. .. .. .. .. smtpd
         -o content-filter=smtp:127.0.0.1:10025

    # New post-queue SMTP port. Set 'no content filter'
    # to avoid mailer loops (belts and suspenders).
    127.0.0.1:10025 inet .. .. .. .. .. .. smtpd
        -o smtpd_milters=inet:127.0.0.1:12345
        -o content_filter=

    # Optional, to use rspamd for /usr/sbin/sendmail submissions.
    pickup unix .. .. .. .. .. ..  pickup
        -o content-filter=smtp:127.0.0.1:10025

Untested, but it should be very close.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: milter after queue

Christos Chatzaras


> On 29 Dec 2018, at 02:56, Wietse Venema <[hidden email]> wrote:
>
> Maybe you can figure out why rspamd is slow. Are you sending huge
> messages, or is rspamd slow because of DNS lookups?
>
> Maybe you can use /usr/sbin/sendmail for local submissions? This
> requires configuring non_smtpd_milters in main.cf.
>
> Otherwise, you can run milters post-queue, with a null SMTP-based
> content filter (Postfix SMTP client sending directly into Postfix
> SMTP server).
>
> /etc/postfix/master.cf
>    # The default before-queue SMTP port, configured
>    # to send mail through a null SMTP filter.
>    smtp  inet .. .. .. .. .. .. smtpd
> -o content-filter=smtp:127.0.0.1:10025
>
>    # New post-queue SMTP port. Set 'no content filter'
>    # to avoid mailer loops (belts and suspenders).
>    127.0.0.1:10025 inet .. .. .. .. .. .. smtpd
> -o smtpd_milters=inet:127.0.0.1:12345
> -o content_filter=
>
>    # Optional, to use rspamd for /usr/sbin/sendmail submissions.
>    pickup unix .. .. .. .. .. ..  pickup
> -o content-filter=smtp:127.0.0.1:10025
>
> Untested, but it should be very close.
>
> Wietse

Thank you for your reply.

No it's not because of DNS lookups. RBLs are disabled in Rspamd as I use RBLs in Postfix.

Finally I solve the issue by sending the outgoing e-mails to postfix relays and then the relays use the Rspamd milter for outgoing e-mails.

Also I configure as you described Rspamd milter only for incoming e-mails at the main servers.
Reply | Threaded
Open this post in threaded view
|

Re: milter after queue

Christos Chatzaras
In reply to this post by Wietse Venema


> On 29 Dec 2018, at 02:56, Wietse Venema <[hidden email]> wrote:
>
> Maybe you can figure out why rspamd is slow. Are you sending huge
> messages, or is rspamd slow because of DNS lookups?
>
> Maybe you can use /usr/sbin/sendmail for local submissions? This
> requires configuring non_smtpd_milters in main.cf.
>
> Otherwise, you can run milters post-queue, with a null SMTP-based
> content filter (Postfix SMTP client sending directly into Postfix
> SMTP server).
>
> /etc/postfix/master.cf
>    # The default before-queue SMTP port, configured
>    # to send mail through a null SMTP filter.
>    smtp  inet .. .. .. .. .. .. smtpd
> -o content-filter=smtp:127.0.0.1:10025
>
>    # New post-queue SMTP port. Set 'no content filter'
>    # to avoid mailer loops (belts and suspenders).
>    127.0.0.1:10025 inet .. .. .. .. .. .. smtpd
> -o smtpd_milters=inet:127.0.0.1:12345
> -o content_filter=
>
>    # Optional, to use rspamd for /usr/sbin/sendmail submissions.
>    pickup unix .. .. .. .. .. ..  pickup
> -o content-filter=smtp:127.0.0.1:10025
>
> Untested, but it should be very close.
>
> Wietse

Maybe the issue was related to this message:

"got IO timeout with server fuzzy2.rspamd.com(212.24.145.107:11335), after 1 retransmits"

At the moment I block in my firewall UDP port 11335. In the relays the port is open.

I will try tomorrow to see if it's related to this timeout (I think it timeouts in 4 seconds).