martedì 13 agosto 2013

Configure msmtp to work with gmail on linux

Test environment
  • Mac OS X 10.6, Mutt
  • Ubuntu 12.04 LTS, Mutt 1.5.21
Install it on Ubuntu
sudo apt-get install mutt -y

Send mail

Mail service provider settings


Settings -> Accounts -> POP3/IMAP/SMTP/Exchange Service -> Options 
check 'POP3/SMTP Service'
Install SMTP client [msmtp] []

sudo apt-get install msmtp msmtp-mta -y
sudo apt-get install msmtp ca-certificates 
create or update ~/.muttrc

set editor="emacs -nw "
set sendmail="/usr/sbin/sendmail"
set sendmail_wait=10
create or update ~/.msmtprc

tls on
tls_starttls on
tls_certcheck on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /tmp/msmtp.log
account default              
port 587                     
auth on                     
user my_account
password secret
change configuration file's permission

chmod 600 ~/.msmtprc
send mail

echo 'content' | mutt -s 'subject' --
send mail with attachment

echo 'content' | mutt -s 'subject' -a /tmp/ --

5 commenti:

  1. A very good and interesting post that i have come across, thanks for sharing the post.
    Really appreciable.

  2. The posted letters is very informative. It is a delight reading it. I have also bookmarked you for ascertaining out new mails.
    by MKT 421 Entire Course | MGT 311 Entire Course Provider

  3. thanks for sharing the useful links,good coding and very easy to refer
    business meeting locations in coimbatore

  4. You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
    Thanks you for sharing!
    Friv 4