Solved sendmail - localhost only - not working out of the box

I've read the handbook.
https://www.freebsd.org/doc/handbook/sendmail.html

For now, all I want is to send local user/account notices that I can read later via mail(1).

Example:

Code:
# mail -s "subject line" username

text goes here.
(control-D to finish)

When sent from root - the messages disappear. When sent from non-root user, I get a "dead-letter" message.

I can tail -f /var/log/maillog and see sendmail doing *something*.

In this example, I am su(1) into root from user 'redacted' when typing mail -s "subject" to send a message.

sendmail said:
Jul 30 12:43:56 hostname sendmail[9031]: x6UHhj1W009031: to=redacted, ctladdr=redacted (1001/0), delay=00:00:11, xdelay=00:00:11, mailer=relay, pri=30051, relay=[127.0.0.1] [127.0.0.1], dsn=5.6.0, stat=Data format error
Jul 30 12:43:56 hostname sendmail[9031]: x6UHhj1W009031: x6UHhj1X009031: DSN: Data format error
Jul 30 12:43:56 hostname sendmail[9031]: x6UHhj1X009031: to=redacted, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31075, relay=[127.0.0.1], dsn=2.0.0, stat=Sent (x6UHhjgG009032 Message accepted for delivery)

All forum posts I've read are for relaying email to another host. I just want the mail to land in the appropriate /var/mail/xxxx mailbox.
 
I get a little more feedback when running mail(1) with -v.

mail said:
root... Connecting to [127.0.0.1] via relay...
220 alpha ESMTP Sendmail 8.15.2/8.15.2; Tue, 30 Jul 2019 18:34:19 GMT
>>> EHLO hostname.fake-domain
250-alpha Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-STARTTLS
250-DELIVERBY
250 HELP
>>> STARTTLS
220 2.0.0 Ready to start TLS
>>> EHLO hostname.fake-domain
250-alpha Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<redacted@hostname.fake-domain> SIZE=45
553 5.1.8 <redacted@hostname.fake-domain>... Domain of sender address redacted@hostname.fake-domain does not exist
/home/redacted/dead.letter... Saved message in /home/redacted/dead.letter
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 alpha closing connection

'hostname' uses a DHCP assigned address. Typing 'host hostname.fake-domain' actually works.
 
Back
Top