Home > How To > Configure "mutt" to send mail over SMTP using Google Apps

Configure "mutt" to send mail over SMTP using Google Apps

dot.muttrc Download this file

My Colleague was working on having auto scripts to send mail through “mutt” with backup attachment.
But he was not able get it up, so though of looking into this.
Wondering what “mutt” is go here then 🙂
Here is what I did to get it working.

  1. If you need to configure anything for mutt first look for .muttrc in your home directory ~/.muttrc
  2. If its not there you can create one.
  3. I have attached my .muttrc file you can use to configure your mutt. (change the email and password)
  4. Just download the dot.muttrc and save it as .muttrc in your home directory (/home/ahmed).
  5. Also create directory in the  path below
  • mkdir -p ~/.mutt/cache/headers
  • mkdir -p ~/.mutt/cache/bodies
  • mkdir -p ~/.mutt/certificates

Before you can start using the script to send your mails –
you need to send the first mail from the “mutt client” so that it takes the certificate from the server.

use
$ mutt
This will bring up the mutt interface – send your test mail from here.
Once that is done. You are all set to use the script.
To test – run the below command in your command prompt.
$ mutt –help
$ mutt -s “Hello Test from the shell Script :)” zubair.ahmed@emailid.com < /dev/null -a <attach a File here>

NOTE for .muttrc
# Non Google App users can just enter the username without the domain name like below.
#set smtp_url = “smtp://zubair.ahmed@smtp.gmail.com:587/
# To use google apps make sure your email account is transitioned – check with our Google Email Administrator
set smtp_url = “smtp://zubair.ahmed@domainName.com@smtp.gmail.com:587/
set smtp_pass = “yourDomainPassword”

Advertisements
Categories: How To
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: