You are not logged in.

#1 2016-04-11 12:51:45

cutuchiqueno
Member
Registered: 2013-07-06
Posts: 70

[SOLVED] mail command does not work with msmtp?

I can not get the mail command working with msmtp.

I followed the instructions from the msmtp wiki page https://wiki.archlinux.org/index.php/Ms … il_command

I tried both installing msmtp-mta and putting

set sendmail=/usr/bin/msmtp

into .mail.rc

I do have a configured .msmtprc in my $HOME folder which I use successfully in other contexts

I do not know where to look else.

Last edited by cutuchiqueno (2016-04-12 09:57:43)

Offline

#2 2016-04-11 13:07:14

EmilyShepherd
Member
From: Bucks, UK
Registered: 2016-03-20
Posts: 45
Website

Re: [SOLVED] mail command does not work with msmtp?

Could you give some more detail about "does not work" means? Does it give an error message? Does it complete successfully but fail to actually send the email?

Offline

#3 2016-04-11 15:11:20

cutuchiqueno
Member
Registered: 2013-07-06
Posts: 70

Re: [SOLVED] mail command does not work with msmtp?

Apologies for being so unspecific and thx for answering.

I tried the command:

echo "Dies ist eine Testmail" | mail -A akademisch RECIPIENT@DOMAIN.de

The output is

Account 'akademisch' does not exist

I have 3 accounts but using each one of them was not successful.

In the meantime I found out that it works if I turn one account into a *default* account and omitt the *-A* flag. However, this is not what I would like to do since I use different accounts for different purposes.

Offline

#4 2016-04-11 17:22:57

EmilyShepherd
Member
From: Bucks, UK
Registered: 2016-03-20
Posts: 45
Website

Re: [SOLVED] mail command does not work with msmtp?

Ah, "mail" is part of the s-nail package, and although you have correctly configured it to use mstmp, it will not pass the command line arguments with it. In your case, this means that s-nail is looking in its own configuration for an account called "akademisch" and is correctly announcing that it can't find it. Try instead:

echo "Dies ist eine Testmail" | mstmp -a akademisch RECIPIENT@DOMAIN.de

Offline

#5 2016-04-11 18:40:48

cutuchiqueno
Member
Registered: 2013-07-06
Posts: 70

Re: [SOLVED] mail command does not work with msmtp?

thanks for the hint. So if I want to have the comfort which is provided by mail I would set up all my accounts in .mailrc and delete the set sendmail option. I just now figured out that mail in Arch is capable to transfer mail on its own which I was not aware of before.

Offline

#6 2016-04-11 20:02:13

EmilyShepherd
Member
From: Bucks, UK
Registered: 2016-03-20
Posts: 45
Website

Re: [SOLVED] mail command does not work with msmtp?

Yep that would work as you expected. If you want to use the "mail" command but still want to use the msmtp settings, you could set "mail" to be an alias of "msmtp" (or even "msmtp -a" if you are always going to pass in an account) in your shell?

Offline

#7 2016-04-12 09:57:22

cutuchiqueno
Member
Registered: 2013-07-06
Posts: 70

Re: [SOLVED] mail command does not work with msmtp?

true! Though with comfort I mean that mail provides flags for passing a subject and so forth which msmtp does not. In the latter case I would have to pass together with the email string which less convenient.

Anyhow, thx a lot

Offline

Board footer

Powered by FluxBB