You are not logged in.
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
According to the manual, it should ask you if it's not set. What happens when you try that?
"...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
SSL connection using TLSv1/SSLv3 (ECDHE-RSA-RC4-SHA)
SASL authentication failed
Could not send the message.
Offline
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
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
@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
OK. You're right my answer is not exact.
My point was, that maybe msmtp will prompt for a password if not set.
Offline
@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
@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
I should have rtfm first.--> msmtp is not an option.
Offline
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