Score:0

What does "sSMTP[2916968]: 501 Mail from address must be same as authorization user" mean?

in flag

I tried many many times to send email from command line. But just failed a hundred of times.

I installed mailutils, s-nail, and edit /etc/s-nail.rc as

set [email protected]
set smtp=smtp.qq.com
set [email protected]
set smtp-auth-password=xxxxxxxxxxxx
set smtp-auth=login

running

echo "test" | mail -s "test" [email protected]

gives

mail: cannot send message: Process exited with a non-zero status

cat /var/log/mail.log gives

Jan 28 12:25:16 aaaa sSMTP[2917096]: Creating SSL connection to host
Jan 28 12:25:16 aaaa sSMTP[2917096]: SSL connection using ECDHE_RSA_AES_128_GCM_SHA256 
Jan 28 12:25:17 aaaa sSMTP[2917096]: 501 Mail from address must be same as authorization user.

What on earth is wrong here? What does it mean by "Mail from address must be same as authorization user"? How to make it work? Thank you so much.

in flag
Reading the message, I would assume that the value you have in `set from` is not the same as what you have in `set smtp-auth-user`
in flag
@matigo They are exactly the same, I swear
in flag
Then you may want to get in touch with qq.com and ask why you cannot send mail. It's the receiving server that's throwing the error, not the local system. As a final check, have you confirmed that there's no white space after the names? Some mail servers do not trim their inputs ...
in flag
@matigo Oh... I just found an article. I realize I should use `s-nail` instead of `mail` in `echo "test" | s-nail -s "test" [email protected]`. It finally works!
andrew.46 avatar
in flag
Looks like you have solved your issue, congrats! However note that s-nail does need to hand off to an external MTA such as msmtp, ssmtp and friends. If you include the option `set mta=smtps://xxxxx` s-nail will use its own more than adequate mta...
in flag
@andrew.46 Hi, Thank you. But what do you mean by "s-nail will use its own more than adequate mta..."? I do not understand
andrew.46 avatar
in flag
You seem to be calling sSMTP from s-nail; this is not necessary as s-nail can send mail by itself
in flag
@andrew.46 I think that is why I failed previously. I call `mail` to send email and look into `/var/log/mail.log`. If I use `s-nail`, `/var/log/mail.log` will have no record.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.