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 »

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: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Apple clients delays 60 seconds to process mail

Post by shawniverson »

The milter cannot decide to close the connection for a client prematurely.
mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser »

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: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Apple clients delays 60 seconds to process mail

Post by shawniverson »

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.
mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser »

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 »

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: 1553
Joined: 18 Mar 2015 09:16

Re: Apple clients delays 60 seconds to process mail

Post by pdwalker »

I don't suppose using a non-broken mail client is an option?
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Apple clients delays 60 seconds to process mail

Post by shawniverson »

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 =
mailefauser
Posts: 5
Joined: 11 Feb 2020 14:11

Re: Apple clients delays 60 seconds to process mail

Post by mailefauser »

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