Tom - can you have a quick look into speeding up the SMTP server that this script is talking too? It likely has anti-spam-relay delays and doing DNS checks synchronously. As this script is a trusted sender on the LAN and is too dumb to deal with failures due to dud MX records and whatnot anyway, we might be able to fix this issue with a few tweaks on the SMTP server.
Tom - can you have a quick look into speeding up the SMTP server that this script is talking too? It likely has anti-spam-relay delays and doing DNS checks synchronously. As this script is a trusted sender on the LAN and is too dumb to deal with failures due to dud MX records and whatnot anyway, we might be able to fix this issue with a few tweaks on the SMTP server.