Home      Students      Teaching      Publications      Software      Fac-Ad      Linux      Links      Bio

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.

  1. su -
  2. apt-get install getmail4
  3. exit;
  4. mkdir ~/mail ~/mail/{inbox,sent,drafts,read}
  5. mkdir ~/mail/{inbox,sent,drafts,read}/{tmp,cur,new,del}
  6. mkdir ~/.getmail ~/.getmail/{inbox,sent}
  7. Save this config file as ~/.getmail/inbox/getmailrc.
  8. 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).
  9. 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.
  1. su -
  2. apt-get install exim4
  3. dpkg-reconfigure exim4-config
  4. Select mail sent by smarthost; received via SMTP or fetchmail
  5. Fill the answer to 'IP address or host name of the outgoing smarthost:' as smtp-auth.iitb.ac.in
  6. Split configuration files into smaller files? No.
  7. Keep default values in all other answers.
  8. 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.
  9. Create a file /etc/exim4/exim4.conf.localmacros and add the line AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS = 1
  10. service exim4 restart
  11. exit
  12. 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.
  1. su -
  2. apt-get install mutt
  3. Save this file as ${HOME}/.muttrc
  4. Edit 'smtp_url', 'from', 'Bcc' fields
  5. mkdir .mutt
  6. touch .mutt/aliases .mutt/TextSign
  7. You may put your signature in TextSign and any aliases for email addresses in aliases file. Either file may be empty.
  8. Start mutt!
Setup LDAP search for mutt: To query LDAP for addresses from within mutt follow this setup
  1. su -
  2. apt-get install ldapscripts
  3. exit
  4. Save this file as ${HOME}/bin/muttldap.pl
  5. Add ${HOME}/bin to your path.
  6. Save this file as ${HOME}/.mutt/ldap.conf
  7. Restart mutt.
  8. Hit ^t to auto-complete an email address.

This page was last modified on Sept 6, 2012.