Apple clients delays 60 seconds to process mail

Bugs in eFa 4
Post Reply
mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Apple clients delays 60 seconds to process mail

Post by mailefauser » 11 Feb 2020 14:41

Hi,
we are using:
eFa-4.0.2

MailWatch Version: 1.2.15
Operating System Version: CentOS Linux 7 (Core)
Postfix Version: 3.4.8
MailScanner Version: 5.2.2
ClamAV Version: 0.101.5
SpamAssassin Version: 3.4.4
PHP Version: 7.2.26
MySQL Version: 10.1.41-MariaDB

We use EFA4 for outgoing e-mails.
We have problems with Apple SMTP clients (Mac Os and Ios) when they trying to send e-mails. Postfix use "smtpd_milters" to send the e-mail to Mailscanner, the problem is that the e-mail remains blocked in milter inbound queue for 60 seconds waiting the "close connection" (QUIT) from the client. With Thunderbird we don't have any problem because the client inmediatly close the connection.

We have found that MSMilter daemon waits the client quit when execute "Sendmail::PMilter::SMFIS_DISCARD;":
sub eom_callback
{
my $ctx = shift;
my $message_ref = $ctx->getpriv();

# Store reference for subsequent messages in connection or for connection close
$ctx->setpriv($message_ref);

# Send DISCARD signal to accept message and drop from postfix
# for mailscanner processing
Sendmail::PMilter::SMFIS_DISCARD;
}

I suppose that milter-discard waits the client "quit" is the normal behavior of "sendmail-milter" when DISCARD message, but it will be a problem if you have a lot of users with this kind of clients.


Thanks for your help!
Best regards,

User avatar
shawniverson
Posts: 3104
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Apple clients delays 60 seconds to process mail

Post by shawniverson » 12 Feb 2020 09:38

The milter cannot decide to close the connection for a client prematurely.
Version eFa 4.0.2 now available!

mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser » 12 Feb 2020 11:35

Hi,
thanks for your replay.
Milter waits for client "quit" before to process the mail when execute "Sendmail::PMilter::SMFIS_DISCARD;"

I changed SMFIS_DISCARD and i put SMFIS_CONTINUE -> "Sendmail::PMilter::SMFIS_CONTINUE" in MSMilter daemon and in this case the milter no waits for client quit. Of course this duplicate the mail in the mta.

I think "Sendmail::PMilter::SMFIS_DISCARD;" should process the e-mail without wait the client "quit" because the "end of data" is already sent.

I think that be behaviour of SMFIS_DISCARD and SMFIS_CONTINUE should wait the same time to process the e-mail.

thanks,

User avatar
shawniverson
Posts: 3104
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Apple clients delays 60 seconds to process mail

Post by shawniverson » 12 Feb 2020 11:51

Using CONTINUE is wrong and will cause a copy of the message to queue directly in postfix.

Terminating a connection at the end of message will break MTAs trying to send multiple messages in a single connection.
Version eFa 4.0.2 now available!

mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser » 12 Feb 2020 12:55

Thanks for your reply.

I know that use CONTINUE is wrong. I only tested it to know how milter works with a e-mail.
Last question:
When milter DISCARD the e-mail from POSTFIX to be processed by mailscanner, Why milter waits for client "quit"?
I think It would be better that milter when receives "end of data" inmediatly sends to mailscanner as SMFIS_CONTINUE works, and not wait for "quit" command from the client.

thanks for your help!!!!

regards,

mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser » 14 Feb 2020 09:32

Hi,
MSMilter when executes "eom_callback" try to do "read_block" but this subroutine execute $socket->sysread and waits for quit connection from client.
Mac Os client (Mail) and ios Clients after send EOM delays 60 seconds to send quit.
we have queued for 60 seconds every mail of mac clients.
any idea?

thanks,

User avatar
pdwalker
Posts: 1293
Joined: 18 Mar 2015 09:16

Re: Apple clients delays 60 seconds to process mail

Post by pdwalker » 16 Feb 2020 03:45

I don't suppose using a non-broken mail client is an option?

User avatar
shawniverson
Posts: 3104
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Apple clients delays 60 seconds to process mail

Post by shawniverson » 16 Feb 2020 16:27

Or simply setting up a separate submission daemon without the milter so that the clients don't have to interact with the milter.

Adding this to /etc/postfix/master.cf for submission daemon, for example, if you don't need to run your trusted clients through mailscanner...

Code: Select all

  -o smtpd_milters =
Version eFa 4.0.2 now available!

mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser » 17 Feb 2020 12:24

Hi,
thanks for all comments.
We have problems with phishing and we have to use mailscanner with all clients.
I will use the "Hold" queue Configuration as a previous version of Mailscanner.
This configuration works fine as a MSA.

Thanks!!!!

Post Reply