I've seen this behavior twice in the past week or so, where mail takes a very long time to send (60 seconds). In troubleshooting one case, I found that cause is setting a custom 'From' header.
I can work around this using a SMTP connection instead of mail()
(which is better all around) - just wondering if anyone could shed some light on why setting the header would cause this delay.
I have some guesses, but nothing I know for sure.
Update: Running in Linux. I have to check on the MX records, I'm pretty sure one is correctly pointing to the server (for the domain, although the address isn't really a valid user/alias), the other it's probably not, since this is one of many servers for that domain/company.
Update (2): Actually, the hosting for the one recently changed, so I'm pretty sure neither case has a MX record pointing to the server sending the email. That's likely the issue - although, I'd love to know why the mail is still sent, but with a delay. Looks like this will be moved to ServerFault and perhaps find an answer there.
Log output (actual domain name redacted):
Oct 3 12:28:18 server sendmail[29795]: p93CSI3t029795: from=tjlytle, size=129, class=0, nrcpts=1, msgid=<[email protected]>, relay=tjlytle@localhost
Oct 3 12:29:30 server sm-mta[29796]: p93CSIs6029796: from=<[email protected]>, size=355, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost.localdomain [127.0.0.1]
Oct 3 12:29:30 server sendmail[29795]: p93CSI3t029795: [email protected], ctladdr=tjlytle (1001/1001), delay=00:01:12, xdelay=00:01:12, mailer=relay, pri=30129, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p93CSIs6029796 Message accepted for delivery)
Oct 3 12:29:30 server sm-mta[30649]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-SHA, bits=128/128