1

I've changed my /etc/hosts file as follows, I added the second line:

127.0.0.1 localhost
127.0.0.1 myservername.mydomain.com myservername

I also added myservername.mydomain.com to the /etc/mail/local-host-names file

I now can send an email as follows (logged into linux as user "Me")

Me@myservername:~$ mail someone@mydomain.com
Cc:
Subject: test
test
<ctrl-d>
Me@myservername:~$

The mail gets delivered to someone@mydomain.com, and the from/return address is:

From: Me@myservername.mydomain.com

Mail to the domain @myservername.mydomain.com is properly forwarded to this linux box.

But when I try to reply, instead of getting the mail delivered to user "Me" mailbox, I get this error:

: RCPT TO:<Me@myserver.mydomain.com>
Remote server replied: 550 5.1.1 <Me@myserver.mydomain.com>... User unknown

Interestingly, I can send mail to root@myserver.mydomain.com successfully, but Me@myserver.mydomain.com errors with 550 User unknown

So perhaps there is a step I'm missing that allows inbound email messages to get delivered to other local users besides root? Turns out I can actually deliver mail to ANY other user defined, but not "Me"

Brian B
  • 151
  • 1
    https://unix.stackexchange.com/a/89840/34195 – AnFi Apr 29 '20 at 07:47
  • Thanks AnFi. I was really scratching my head before I figured out it was the upper case characters in the userid that was even the issue. Had I realized that was the issue, I would have found the answer a lot quicker! – Brian B Apr 29 '20 at 15:35

1 Answers1

0

Well, I can answer my own question: The example I gave above was not entirely accurate, masking the issue. I substituted example "me" for the userid and used fictitious domain names. Turns out the real userid was mixed case - it included some upper case letters. Sendmail apparently has no support for delivering mail to a local userid which has uppercase characters in it. This kind-of makes sense - Linux is very case sensitive, and I believe you can create a user "User" and a user "user" and these are different users. SMTP addresses however are not usually considered case sensitive, so I'm guessing sendmail simply lowercases the user portion and looks for a matching Linux user. Since it didn't find this lower-cased user, it reported the 550 error- User Unknown. I figured it out after discovering that I could not only send mail to root, but to ANY other user defined on my box, just not the default admin ID I was using. I will actually edit the question above to uppercase a letter in the user, and change the question title as well.

Brian B
  • 151