How can I send mail to a local user with a domain prefixed username?
Running SUSE Linux Enterprise Server 11.3 joined to an active directory domain with Heirloom mailx version 12.5 7/5/10
Scenario:
I have 2 users on the server, one local user account and one domain user account:
- jeff
- DOM1\john
Logged in as DOM1\john, I can issue this command from terminal echo "hello" | mail -s "test" jeff
and jeff successfully receives the message. Not surprisingly, the header reads an escaped backslash in the FROM
field From: "DOM1\\john"@server.example.com
Oddly, if jeff simply replies to the message, jeff will get an Undelivered Mail Returned to Sender
in inbox. The header says To: [email protected]
, so I can see that the backslash is getting stripped out. I have tried the following commands as jeff to attempt to escape the backslash, all to no avail, and the backslash is always omitted in the TO
header of the undelivered message:
echo "hello" | mail -s "test" DOM1\john
echo "hello" | mail -s "test" 'DOM1\john'
echo "hello" | mail -s "test" "DOM1\john"
echo "hello" | mail -s "test" DOM1\[email protected]
echo "hello" | mail -s "test" 'DOM1\john'@server.example.com
echo "hello" | mail -s "test" "DOM1\john"@server.example.com
echo "hello" | mail -s "test" DOM1\\john
echo "hello" | mail -s "test" 'DOM1\\john'
echo "hello" | mail -s "test" "DOM1\\john"
echo "hello" | mail -s "test" DOM1\\[email protected]
echo "hello" | mail -s "test" 'DOM1\\john'@server.example.com
echo "hello" | mail -s "test" "DOM1\\john"@server.example.com
Stranger still, if I try 3 backslashes, echo "hello" | mail -s "test" DOM1\\\john
, it doesn't deliver the message nor issue an undelivered message, it just fails silently.
And if I try to just send the mail without the domain prefix, echo "hello" | mail -s "test" john
, I get the expected undelivered message saying that user john doesn't exist.
Also, to be clear, yes these domain users have email accounts like [email protected], but we don't want to send to that mail server account - we just want to use the local mail accounts on SLES so they can communicate with the other local non-domain accounts on that server.