1

I installed nullmailer on a Debian 10 VPS.

root@:~# cat /etc/nullmailer/remotes
hotmail-com.olc.protection.outlook.com
  • echo "Subject: test" | sendmail -v me@hotmail.com works, I receive the e-mail.
  • echo "Subject: test" | sendmail -v me@example.com doesn't work, saying:

    smtp: Failed: 550 5.5.0 Requested action not taken: mailbox unavailable. [DM6NAM12FT063.eop-nam12.prod.protection.outlook.com]

As far as I understand, for example.com to work, I have to resolve it's MX record and put the value into /etc/nullmailer/remotes.

Sendmail seems to handle that automatically.

  • Can nullmailer do that as well?
  • If not, what is a lightweight yet capable alternative (msmtp, swaks)?
  • Or should I have a wrapper script doing dig first, saving to /etc/nullmailer/remotes, and only then calling nullmailer?

Please advise!

ᴍᴇʜᴏᴠ
  • 577
  • 1
  • 6
  • 20

1 Answers1

1

Can nullmailer do that as well?

No. It is a "relay-only" MTA, i.e. it always relies on another full-featured SMTP relay server (a "smarthost") to handle the actual delivery. (Hence the "null" name.)

Really, that's kind of the whole point of using nullmailer or msmtp or similar tools.

If not, what is a lightweight yet capable alternative

If you define 'lightweight' as in "no permanent daemon processes running", then Exim can do the job – it tries to deliver mail in foreground by default (i.e. right in the same sendmail process), and if that fails, you can use a cronjob to process queued mail.

Otherwise, OpenSMTPd would be my choice, followed by Postfix. While they run as daemons, they don't really consume a noticeable amount of resources and the outgoing-only config file can be tiny.

Or should I have a wrapper script doing dig first, saving to /etc/nullmailer/remotes, and only then calling nullmailer?

Only if your script implements locking (single instance). Editing global configuration can go really wrong if you allow it to make multiple deliveries simultaneously.

user1686
  • 10,162
  • 1
  • 26
  • 42
  • Thank you for the answer, accepting it because I really like it, although I ended up taking the `/etc/nullmailer/remotes` route as it's the easiest for me right now (there's one recipient on that system only) – ᴍᴇʜᴏᴠ Jan 21 '20 at 18:15