You are not logged in.

#1 2013-07-02 11:50:38

ryzion
Member
Registered: 2012-03-20
Posts: 95

send mails via mutt (command line)

hi,

I'm trying to send mails via mutt (gmail account) using the terminal. I used this muttrc (http://www.techrepublic.com/blog/openso … -mutt/1737). It works as long as I put my password in the .muttrc. But I'd like to type in the password everytime I send an email, without having it in my .muttrc

Offline

#2 2013-07-02 12:15:23

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: send mails via mutt (command line)

According to the manual, it should ask you if it's not set. What happens when you try that?

http://dev.mutt.org/doc/manual.html#smtp-pass


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2013-07-02 12:31:45

ryzion
Member
Registered: 2012-03-20
Posts: 95

Re: send mails via mutt (command line)

SSL connection using TLSv1/SSLv3 (ECDHE-RSA-RC4-SHA)
SASL authentication failed
Could not send the message.

Offline

#4 2013-07-02 13:20:22

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: send mails via mutt (command line)

Hmmm, it may not work as described from the command line then (which surprises me a little). Might be worth asking on the mutt mailing list.

Also, that error sometimes occurs if the SMTP authentication is incorrectly set - though as it works with the password set, I don't think that's the issue.
You could though try:

set smtp_url = "smtps://username@domain.ex@smtp.gmail.com:465/"


Alternatively you can use the -e option to specify a configuration command on the command line, so you could use a script to wrap your command and ask for the password instead.

Or more securely, it could decrypt a file or query a pwd store and source it to set the password behind the scenes so the password never appears on the screen - your decryption or retrieval method would need to be able to ask for a password without showing it.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2013-07-02 19:39:30

luz1
Member
From: Germany
Registered: 2011-12-14
Posts: 20

Re: send mails via mutt (command line)

I use msmtp instead of the built-in smtp function.

Wiki-Link: https://wiki.archlinux.org/index.php/Msmtp

Here's my .msmtprc

account gmail 
host smtp.gmail.com
port 587
protocol smtp
auth on
from user@gmail.com
user user@gmail.com
password secret
tls on
tls_nocertcheck
account default : gmail

Then just add

set sendmail = /usr/bin/msmtp -a gmail

to your .muttrc and comment the smtp_url and smtp_pass out.

Offline

#6 2013-07-02 20:21:51

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: send mails via mutt (command line)

@luz1, while I too use msmtp and find it to be great for sending mail (both for mutt and via the cli), I think you need to re-read the thread here.  The OP is indicating that mail is sent fine though mutt using the built in functionality.  But he/she wants to be able to set no password in the muttrc and have it prompt for the password when mail is sent.

Offline

#7 2013-07-02 20:38:59

luz1
Member
From: Germany
Registered: 2011-12-14
Posts: 20

Re: send mails via mutt (command line)

OK. You're right my answer is not exact.
My point was, that maybe msmtp will prompt for a password if not set.

Offline

#8 2013-07-02 20:41:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: send mails via mutt (command line)

@luz1, I think that while it is good that you are willing to help and share ideas, in this case it would have been better if you had looked this up first. https://wiki.archlinux.org/index.php/Ms … management

Offline

#9 2013-07-02 20:50:55

luz1
Member
From: Germany
Registered: 2011-12-14
Posts: 20

Re: send mails via mutt (command line)

WonderWoofy wrote:

@luz1, I think that while it is good that you are willing to help and share ideas, in this case it would have been better if you had looked this up first. https://wiki.archlinux.org/index.php/Ms … management

smile
I should have rtfm first.--> msmtp is not an option.

Offline

#10 2013-07-03 08:48:41

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: send mails via mutt (command line)

I use msmtp as well and knew it wouldn't work via mutt. However, it might be possible to wrap it in a script to use it directly, rather than mutt from the command line?
There are other command line MTAs that may do the job instead of using mutt, for instance mailx.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB