DMA not sending emails

I'm trying to configure DMA on FreeBSD 13.2-RELEASE-p4.

I've configured the following settings in /usr/local/etc/dma/dma.conf

Code:
SMARTHOST mysmarthost
MAILNAME mydomain.com
MASQUERADE nagios@

Then try sending two emails:

Code:
echo "test" | /usr/bin/mail -v -s "Subject 1" other.user@mydomain.com
echo "test" | /usr/bin/mail -v -s "Subject 2" nagios@mydomain.com

I see the following in the logs:

Code:
Dec  2 15:12:54 my_server dma[183c0][48164]: new mail from user=root uid=26 envelope_from=<nagios@mydomain.com>
Dec  2 15:12:54 my_server dma[183c0][48164]: mail to=<other.user@mydomain.com> queued as 183c0.2ca35afc0000
Dec  2 15:12:54 my_server dma[183c0.2ca35afc0000][48167]: <other.user@mydomain.com> trying delivery
Dec  2 15:12:54 my_server dma[183c0.2ca35afc0000][48167]: using smarthost (mysmarthost:25)
Dec  2 15:12:54 my_server dma[183c0.2ca35afc0000][48167]: trying remote delivery to mysmarthost [ip.address] pref 0
Dec  2 15:12:55 my_server dma[183c0.2ca35afc0000][48167]: <other.user@mydomain.com> delivery successful
Dec  2 15:13:02 my_server dma[189c9][48179]: new mail from user=root uid=26 envelope_from=<nagios@mydomain.com>
Dec  2 15:13:02 my_server dma[189c9][48179]: mail to=<nagios> queued as 189c9.14c5b7582000
Dec  2 15:13:02 my_server dma[189c9.14c5b7582000][48180]: <nagios> trying delivery
Dec  2 15:13:02 my_server dma[189c9.14c5b7582000][48180]: <nagios> delivery successful

The first email arrives in my inbox the second does not.

In the log the it shows that the first email is sent via the smarthost but the first isn't. Is that the issue? if so what is causing it?
 
They are ending up in nagios mailbox on the same machine.

Code:
/usr/bin/mail -u nagios
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/nagios": 2 messages 1 new 2 unread
 U  1 nagios@mydomain.com  Sat Dec  2 15:58  15/441   "Subject 008"
>N  2 nagios@mydomain.com  Sat Dec  2 16:00  13/461   "Subject 009"

So I've removed the following properties from /usr/local/etc/dma/dma.conf and emails are getting through.
Code:
MAILNAME mydomain.com
MASQUERADE nagios@

But the from address shows as nagios@hostname. Can that be changed?
 
Yes, I encountered this recently. If you set MAILNAME to something which matches the domain portion of your system's hostname, then DMA will attempt to deliver to a local user.
 
Back
Top