Sendmail problem
I have recently started using sendmail on a server running ZoneMinder to send notifications when my cameras detect motion. My setup is very simple as I don't need my server to receive or store emails, just be able to send them, and I haven't changed any config files related to sendmail.
Everything seems to work fine, with one exception: when I first boot up and try to send an email (either running sendmail on the command line or by causing ZoneMinder to generate an alert), I never receive it. If I restart /etc/rc.d/rc.sendmail, the emails come through and future ones are received promptly. /etc/rc.d/rc.sendmail has execute permissions. Am I missing something obvious here? |
Are you sure that /etc/rc.d/rc.sendmail is being used at initial boot?
|
Quote:
|
Upon rebooting, the output of ps aux | grep sendmail:
Code:
root 1396 0.0 0.0 63692 4540 ? Ss 22:08 0:00 sendmail: accepting connections EDIT: Actually, I will have to check this again. The emails that I send to my phone via the text gateway are definitely not received until after restarting the sendmail service. I'm not sure if that is true for emails sent to my regular email address. |
I just checked again, and it's definitely all emails that are not coming through, not just SMS gateway emails. I rebooted my computer, started ZoneMinder, and sent a test email. About ten minutes later, I restarted sendmail, and all the notifications and the test email came through at once. Has anyone else experienced this?
|
Is your server behind a fixed IP address? If not it's possible your ISP's relay mail servers are imposing a delay. A genuine mail server will resend, but a spammer is unlikely to bother resending. I'm not familiar with Sendmail, but the Postfix delay is configurable. If you wait a while, after the server boots up, without restarting Sendmail, you might find the mail is sent after all, without your intervention. Try to find out what the default delay is for Sendmail.
Another possibility is a delay in your DNS coming up at boot. Either way, I think this is a network or ISP issue. Not a Slackware or Sendmail problem. |
Quote:
Quote:
Quote:
|
Just a wild guess. Is this system booting from an SSD? There are known related entropy problems with sendmail not starting correctly. I installed haveged on one system to avoid the boot delays. Could be network or DNS, but the symptoms are tad similar.
|
Quote:
|
Quote:
One solution is to not to start sendmail using the slackware init, but instead to start it only when the interfaces are up. However, I solved the problem more satisfactorily by switching to postfix, which as it happens will be the default MTA in the next version of slackware. You can get a build script for postfix using slackbuilds or by borrowing the one from slackware-current. This enables me to run postfix on my laptop, as postfix doesn't care if the wi-fi interface is available when the laptop is started or not - if it isn't up, postfix will send the emails once it detects that the IP connection is working. |
Quote:
|
Quote:
Quote:
|
Quote:
postfix is a welcome improvement generally in my view, although the slackware-current supplied version for some reason did not seem to configure itself as well as my own home-prepared versions (perhaps it was confused by my pre-existing installation). You might get errors on first start-up if not all the fields in main.cf are filled out correctly: make sure that in main.cf setgid_group is set to postdrop, and if you have vacant entries in main.cf for something like 'html_directory =', comment it out rather than leaving it blank. Once you have those correctly set you may need to run 'postfix set-permissions' as root (you will if your main.cf was in error, because then the slackware installation script will have been unable to do it for you). |
Thanks for the tips. Using the SlackBuild from -current, it looks like everything is set up correctly already in main.cf. Here are some notes on the things I needed to do to get it working:
Anyway, it's all working now. I added a line to start /etc/rc.d/rc.postfix to my /etc/rc.d/rc.local, and now no other intervention is needed to send emails after booting. |
All times are GMT -5. The time now is 08:43 PM. |