macOS Mail app takes ~60 seconds to send emails but only for one SMTP server

Recently I've noticed that the Apple Mail app on macOS takes about 60 seconds to send emails via a certain SMTP server (my primary mail server). I don't recall any particular upgrade to either my operating system or mail server that may have triggered this, so I'm not sure why it's started happening as Mail has been happily using this mail server for many years.

I've performed a connection test from within the Mail app and looked at the Mail logs and the mail server (postfix) logs and this is what I can see:

Logs from Mail.app:

INITIATING CONNECTION Aug 07 19:12:06.024 host:<my-mail-server> -- port:<port> -- socket:0x0 -- thread:0x6000002e2fc0

CONNECTED Aug 07 19:13:07.110 [kCFStreamSocketSecurityLevelNone] -- host:<my-mail-server> -- port:<port> -- socket:0x6000032c4420 -- thread:0x6000002e2fc0

READ Aug 07 19:13:07.260 [kCFStreamSocketSecurityLevelNone] -- host:<my-mail-server> -- port:<port> -- socket:0x6000032c4420 -- thread:0x6000002e2fc0
220 <my-mail-server> ESMTP Postfix (Ubuntu)

WROTE Aug 07 19:13:07.272 [kCFStreamSocketSecurityLevelNone] -- host:<my-mail-server> -- port:<port> -- socket:0x6000032c4420 -- thread:0x6000002e2fc0
EHLO [<my-ip-address>]

// Followed by the basic SMTP handshake and connection test.

Logs from postfix:

Aug  7 19:12:06 <server> postfix/smtpd[23750]: connect from unknown[<my-ip-address>]
Aug  7 19:13:01 <server> postfix/master[1324]: warning: master_wakeup_timer_event: service pickup(public/pickup): Connection refused
Aug  7 19:13:07 <server> postfix/smtpd[23750]: lost connection after UNKNOWN from unknown[<my-ip-address>]
Aug  7 19:13:07 <server> postfix/smtpd[23750]: disconnect from unknown[<my-ip-address>] unknown=0/3 commands=0/3
Aug  7 19:13:07 <server> postfix/smtpd[23750]: connect from unknown[<my-ip-address>]
Aug  7 19:13:08 <server> postfix/smtpd[23750]: disconnect from unknown[<my-ip-address>] ehlo=2 starttls=1 auth=1 quit=1 commands=5

From the mail server logs it seems like the client connects, times out after 60 seconds, connects again and then instantly succeeds, whereas from the Mail logs it looks like it just takes 60 seconds to connect in the first place.

I've tested the same mail server and credentials with both an iPhone and an iPad and neither of them have the same issue.

Is there anything I can do to resolve this?

Edit: I have just updated my operating system to macOS 10.15.6 and restarted but the issue still persists.

Edit 2: I've just set up a new 2019 MacBook Pro and continue to experience the same issue, which suggests that it is an issue with the mailserver, but doesn't explain why it works fine on an iPhone and iPad.


Solution 1:

I only managed to solve this by changing the port that I was using on my mail server to send emails (I was using a non-standard port to bypass ISP filtering). When I changed to using TCP port 587 (the Message Submission port) the issue was resolved.

I'm still not convinced that Mail and/or macOS (or possibly my mail server) is doing something weird as other devices (iPhone and iPad) use the non-standard SMTP port just fine.