Thursday, June 2, 2016

Configuring mutt to work with GMAIL

Mutt is a mail client , that you can configure easier in Linux , i will start with explaining the installation and the configuration of the tool , and some example to send a simple email :

  • sudo apt-get update         #It's always a good idea to update your sources list before you start with installing any thing new .
  • sudo apt-get install mutt         #This command will install the client for you .
  • cd         #This will take you to your home dir , and there you will find a dir called .mutt
  • cd .mutt
  • vi muttrc         # Edit the file like the below example :


Ex :

hdr_order Date From To Cc
ignore "Authentication-Results:"
ignore "DKIM-Signature:"
ignore "DomainKey-Signature:"
set certificate_file="~/.mutt/certificates"
set editor='nano'
set folder=imaps://imap.gmail.com:993
set from="YourEmail@gmail.com"
set header_cache="~/.mutt/cache/headers"
set imap_check_subscribed
set imap_keepalive=300
set imap_pass="YourPassword"
set imap_user="set imap_user="YourEmail@gmail.com"
set markers=no
set message_cachedir="~/.mutt/cache/bodies"
set move=no
set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"
set realname="YourName"
set smtp_pass="YourPassword"
set smtp_url="smtp://YourEmail@smtp.gmail.com:587/"
set sort_aux='last-date-received'
set sort='reverse-threads'
set spoolfile=imaps://imap.gmail.com:993/INBOX
unset imap_passive
You have new mail in /var/mail/root




* Please replace YourName , YourEmail , YourPassword .


And this is an example for sending email with mutt :

Ex :

      echo -e "Hloo \nThis is my body email" | mutt -s "This is my subject" ToEmail@koko.com

No comments: