Using gmail with mutt

For sending and receiving you mails, with the famous mail client mutt, insert the following lines into your ~/.muttrc

set smtp_url = “smtp://”
set smtp_pass = “password”
set from = “”
set realname = “Your Real Name”

you can also use fetchmail to get your mail automatically.
so, edit the ~/.fetchmailrc and add the following :

poll protocol imap user “username” password “password” mda “/usr/bin/procmail -d %T” ssl

That’s great if we will receive notification when a new mail arrived.
for that add the following lines into a shell script, we will name it checkmail.

$ cat >checkmail<<EOF
if [ “$1” = “-v” ]; then
fetchmail -a -K $EXTRAARG >/dev/null 2>&1

if [ “$?” = “0” ]; then
DISPLAY=:0.0 /usr/bin/notify-send -t 0 -u critical -h “int:x:168” -h “int:y:100” -i /home/mezgani/photo/mail.jpg “السلام عليك” “New mail received”

Ok, right now we will define an entry to crontab, which will call the checkmail script every 5min.
of course change the path /home/handrix/bin/checkmail by the emplacement of the script in you host.

*/5 * * * * /home/mezgani/bin/checkmail

And i got this every mail arriving


Author: Ali MEZGANI

My name is MEZGANI Ali. I was born back in 1978 in Rabat Morocco. My interests are Debian Linux , programming , science and music.

One thought on “Using gmail with mutt”

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s