-1

I have a Raspberry Pi and installed msmtp, msmtp-mta and mailutils. I send emails via Google SMTP and it works great for specific email addresses. If I try to send emails to "root" it works if I use msmtp (echo Test | msmtp -v root), but it does not work if I use mail (mail root). In the msmtp log file I find this: "recipients=root@RaspberryPi3".

Somehow, the connection between "mail" and "msmtp" does not work when it comes to doing the aliases substitution?

Does anybode recognize this, or have tips for trouble shooting?

Thanks!

Rickard
  • 31
  • 4
  • It seems like I get downvoted, which I find a bit surprising as I have done my research, way beyond what is described above. E.g. there's a alias problem in msmtp that is solved in 1.8.6, but that is not the problem as I am running backports version. I have googled and read all hits in this area, therefore this post. Thanks.... – Rickard Jan 25 '21 at 16:27
  • The downvotes are most likely due to the words "Raspberry Pi". [Server Fault is a question and answer site for managing information technology systems in a business environment](https://serverfault.com/tour). If you are using a Raspberry Pi for your business then it would be worth explicitly stating that. Is there any reason why you can't just use msmtp since that is working? – Ladadadada Jan 27 '21 at 12:03
  • Not used for business, didn't know that was a requirement. All my scripts are using "mail" command, and I find the msmtp way of sending email clunky. Thanks for you comment, managed to solve the mystery as written below. – Rickard Jan 27 '21 at 23:36

1 Answers1

2

Took A LOT of testing and experimenting... Finally solved:

Uninstalled "mailutils" and installed "bsd-mailx" instead.

Problem solved, "mail" command working as intended, including aliases.

Hope it helps someone to cut down the confusion and testing...

Rickard
  • 31
  • 4