Joined: 16 Apr 2014
|Posted: Wed Apr 16, 2014 8:25 pm Post subject: [SOLVED]: Delivering local mail with opensmtpd
|I am trying to get opensmtpd to send and deliver local mail (e.g. mail sent by cron); the mail is getting queued (I can see it in /var/spool/smtpd/queue) but not delivered.
Does anyone here use opensmtpd for this, and if so, can you shed any light on the problem?
Additional info/things I've tried:
I've searched the Gentoo forums and Google to no avail. I'd like to use opensmtpd for this, since it's very simple, provides MTA/MDA in one package, and meets my extremely basic needs (only local mail delivery from cron, essentially).
- I am using the default smtpd.conf that was installed when I merged opensmtpd, which is set up for local transport/delivery (and which, FWIW, works as is on Arch Linux and OpenBSD; I've tried changing "listen on localhost" to "listen on lo"; no difference).
- The iptables INPUT chain is set up to pass traffic on lo, and netstat confirms that smtpd is listening on localhost:25
- I've tried manually creating the directory /var/spool/mail; no difference
- "smtpctl show status" confirms that MDA, MTA, and SMTP are all running
(on a side note, this is my first-ever Gentoo install after many years of other Linux/BSDs, and I am really liking it so far)
Edit: Solved. On further inspecting the message headers, I saw that they were bound for /var/mail, not /var/spool/mail. Created /var/mail and boom, mail delivered.
As a note for anyone using opensmtpd for this purpose, the group for /var/mail should be set to 'mail', not 'root', and /var/mail should be group-writeable, otherwise users won't be able to alter their mailboxes with mail/mailx.