Fetch your KU Leuven email into another email address

From ULYSSIS documentation

You can use our shell-servers to forward mails from your KULeuven mailbox to an email provider of your choice (e.g. GMail).

WarningWarning!

DOING THIS IS ENTIRELY ON YOUR OWN RISK. ULYSSIS CANNOT BE HELD RESPONSIBLE FOR LOST/DELAY MAILS. BY HAVING OUR SERVERS FORWARD YOUR KULEUVEN MAIL, YOU TAKE FULL RESPONSIBILITY.


This tutorial is based on http://ronin.ulyssis.be/files/kulmail_gmail2.txt

We wrote a script that configures everything automatically. To use it, log in on one of our shell servers and execute the following commands:

  1. wget ftp://ftp.ulyssis.org/kulforward/kulforwardsetup.sh
  2. chmod u+x kulforwardsetup.sh
  3. ./kulforwardsetup.sh
  4. Follow the instructions on the screen.

Alternatively, you can configure everything yourself. Below we briefly explain how to do this.

  • Create a directory to save the SSL certificates:
    mkdir .certs
  • Put the necessary certificates in the .certs directory:
    cd .certs
    wget ftp://ftp.ulyssis.org/kulforward/imapkul.pem
    wget ftp://ftp.ulyssis.org/kulforward/usertrust.pem
    cp /etc/ssl/certs/AddTrust_External_Root.pem .
    cd
  • Rehash them:
    c_rehash ~/.certs/
  • Create the fetchmail configuration file with your favourite text editor and enter the confiration details:
    $login = your KULeuven login (e.g. s0123456)
    $pass = your KULeuven password
    $mail = the email address to forward your KULeuven mail to (TRIPLECHECK IT!!)
    keep = "" (delete forwarded mails from your KULeuven mailbox) or "keep" (keep forwarded emails)
    set daemon 600 # Check every 10 minutes
    poll imaps.student.kuleuven.be port 993 protocol imap username "$login" password "$pass" smtpname "$mail" ssl sslcertck $keep sslcertpath .certs/
  • Add it to your crontab
    crontab -e
    @reboot fetchmail
  • Because of our setup fetchmail cannot be started automatically when the shell server is restarted. But you if you add it to your crontab, you'll get email that it failed. You can then manually login on our shell servers to start fetchmail again.
  • Start fetchmail:
    fetchmail