How to specific the name for the receipt when using the program 'mail'?

Nils Kassube kassube at gmx.net
Wed Mar 18 19:53:16 UTC 2015


Peng Yu wrote:
> >> Something like the following does not work.
> >> 
> >> echo 'Message body' | mail -s 'Email subject' 'First
> >> Last<somebody at example.com>'
> >> 
> >> Does anybody know how to specific the name of the recipient?
> >> Thanks.

> Here is the error message after I run the mail command.
> 
> send-mail: recipient address First Last<somebody at example.com> not
> accepted by the server
> send-mail: server message: 555 5.5.2 Syntax error. x135sm8782271oix.25
> - gsmtp send-mail: could not send mail (account default from
> /home/xxx/.msmtprc) Can't send mail: sendmail process failed with
> error code 65
> 
> BTW, I have the following ~/.mailrc. But I think msmtp should be
> compatible with sendmail. So I guess the problem is not due to msmtp?
> 
> ~$ cat ~/.mailrc
> set sendmail=/usr/bin/msmtp

Sorry, I don't use msmtp and I can't really tell you if it matters. But 
to find out where the problem is, you could try your command with the 
default MTA first (IIRC that would be postfix), i.e. without the 
~/.mailrc file.

Another thought: There is a package msmtp-mta - shouldn't that be used 
if you want to replace the sendmail command?


Nils





More information about the ubuntu-users mailing list