How to use getmail, mutt and gmail together at IIT-Bombay
Setup: I want to fetch all my email from IIT-Bombay's email server on
to my Linux desktop, and also forward it to Gmail. IIT
allows you to do either of them but not both by means of a .forward file. If
you use .forward file, then it does not keep a copy locally. Here is a small
description of a method to do both.
Setup getmail: Follow the steps below to configure getmail to fetch
your email from the server and forward it to your gmail account.
- su -
- apt-get install getmail4
- exit;
- mkdir ~/mail ~/mail/{inbox,sent,drafts,read}
- mkdir ~/mail/{inbox,sent,drafts,read}/{tmp,cur,new,del}
- mkdir ~/.getmail ~/.getmail/{inbox,sent}
- Save this config file as
~/.getmail/inbox/getmailrc.
- Change the file.
- 'username' must have your IIT-B Email username.
- 'password' must have your IIT-B email password.
- 'YOUR-GMAIL-ADDRESS-HERE'
must be changed to the gmail address where you want to forward your emails.
- 'user' must be your username on your desktop, 'group' should be same as your
group-name on your desktop (usually same as username).
- Test getmail by running getmail -l --getmaildir=${HOME}/.getmail/inbox
Setup Exim:
Follow the steps below to configure Exim to send your emails to your gmail account.
- su -
- apt-get install exim4
- dpkg-reconfigure exim4-config
- Select mail sent by smarthost; received via SMTP or fetchmail
- Fill the answer to 'IP address or host name of the outgoing smarthost:'
as smtp-auth.iitb.ac.in
- Split configuration files into smaller files? No.
- Keep default values in all other answers.
- edit /etc/exim4/passwd.client, and add the line at the bottom:
*:USERNAME:PASSWD where USERNAME is your IIT-B username, and PASSWD
is your IIT-B password.
- Create a file /etc/exim4/exim4.conf.localmacros and add the line
AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = 1
- service exim4 restart
- exit
- Test getmail again. Send an email to your IIT-B account and then run:
getmail -l --getmaildir=${HOME}/.getmail/inbox
Setup Mutt: Mutt is used to read the emails and answer them from your
desktop. Follow these steps.
- su -
- apt-get install mutt
- Save this file as ${HOME}/.muttrc
- Edit 'smtp_url', 'from', 'Bcc' fields
- mkdir .mutt
- touch .mutt/aliases .mutt/TextSign
- You may put your signature in TextSign and any aliases for email
addresses in aliases file. Either file may be empty.
- Start mutt!
Setup LDAP search for mutt: To query LDAP for addresses from within
mutt follow this setup
- su -
- apt-get install ldapscripts
- exit
- Save this file as ${HOME}/bin/muttldap.pl
- Add ${HOME}/bin to your path.
- Save this file as ${HOME}/.mutt/ldap.conf
- Restart mutt.
- Hit ^t to auto-complete an email address.
This page was last modified on Sept 6, 2012.