When you install sendmail on a local machine and want to test some mail sending feature of your project, sendmail has a tendency to hang for a couple of minutes each time you try and send mail.
Looking in the /var/log/mail.log will reveal it is trying to determine the fully qualified domain name:
Sep 16 09:21:01 MyHostName sm-msp-queue: unable to qualify my own domain name (MyHostName) -- using short name
Here is a quick fix which resolves the problem:
1. Edit /etc/hosts
2. Change the record for 127.0.0.1 so that it looks something like this
3. Restart sendmail
This now makes sendmail think it’s FQDN is localhost.localdomain, and mail now sends instantly!