This behaviour is caused by the Mail Transport Agent (MTA) handling of &
characters in the mailbox name in /etc/passwd
From the passwd man page:
gcos-field is the user's real name, along with
information to pass along in a mail-
message heading. (It is called the
gcos-field for historical reasons.) An
``&'' (ampersand) in this field stands
for the login name (in cases where the
login name appears in a user's real
name).
The workaround in this case is to explicitly set the From address in the mail client.
For example, using mutt
(as suggested by @mailq):
~/.muttrc
set realname="A&B"
set from="ab@myserver"
set use_from=yes
Sending a test email...
echo "Test body" | mutt -s "Test" [email protected]
Seems to work fine.