Augustin Riedinger
Augustin Riedinger

Reputation: 22270

SMTP: Emails sent with delay (~8 hours)

I have the impression (still investigating on it) that the emails my webapp automatically sends are highly delayed (something like 8 hours late).

I have been searching in those directions, without success.

I am using 1&1 as a domain name provider.

Upvotes: 1

Views: 6050

Answers (2)

mti2935
mti2935

Reputation: 12037

It's possible that something could be introducing a delay between when your application generates these messages, and when your SMTP server actually sends them, as you allude to in your question.

It's also possible that the receiving MX could be deferring acceptance of the messages, thinking that your sending SMTP server could be a spammer. This is known as 'greylisting'. In this case, your SMTP server must make several retries before the message is finally accepted by the receiving MX, and this is what is causing the delay. It is not uncommon for receiving MX's to greylist sending SMTP servers with questionable IP reputation or improperly configured DNS.

Is it possible for you to check the logs on the SMTP server that sends these messages? If so, the logs will show you a timestamp for each delivery attempt, and from the timestamps it will be clear which of the above is happening.

Also, looking at the headers of one of the delayed messages (after it was finally received) may shed some light on where the delay is. Reading from the bottom up, you should see a timestamp showing when the message was generated, followed by timestamps for the arrival of the message at each server that relayed it. From these timestamps, you should be able to see where the delay was.

Upvotes: 3

Aaron Gray
Aaron Gray

Reputation: 11713

Might they be running on a cronjob that only sends them every so often?

Or perhaps they are sent using a task queue of background jobs (like Resque), and the queue is just really backed up?

Upvotes: 0

Related Questions