Should sending email via sendmail result in a long wait?

April 29, 2015 1.7k views
Email Ubuntu

In my previous hosting setup I used the sendmail command to send email when I needed to notify myself about system occurrences.

But I've been trying it out in DigitalOcean, and it consistently takes almost exactly 1 minute to execute.

Is this expected? Maybe an intentional rate-limiting measure? That would be fine, but it causes certain actions on my site to time out. I could execute the command in the background, but I'd like the exit status to tell the user if there was a problem (e.g. if they're using a "contact admin" form).

So: what's going on, and is there a way to mitigate it?

Ubuntu 12.04.5 32-bit
kernel 3.2.0-24-virtual
sendmail 8.14.4

1 comment
  • DO doesn't rate limit or lag email (as far as I can tell). I'm not sure that SendMail is a blocking task. Outgoing email should be placed in /var/spool/mail and be send by a daemon process. So if sendmail is blocking for 1 minute then I'd say you have something wrongly configured, but maybe you are referring to delivery time taking 1 minute. Which would be related to your email server and not the droplet.

1 Answer

Try checking your hosts file:
sudo nano /etc/hosts

The first uncommented line will probably say this if you haven't made any configuration changes: localhost yourservername

After localhost, add in localhost.localdomain so you end up with localhost localhost.localdomain yourservername

This should do the trick

Have another answer? Share your knowledge.