Fetchmail, Cyrus and Exim4 – a Mail Server for Linux

Fetchmail installation

  • Install fetchmail

    apt-get install fetchmail

    Let’s assume your name is John Doe and your user on your local Linux box is called john, his email is john.doe@provider.com, so his provider’s pop3 box is pop3.provider.com and his password for fetching his email from his provider is my-secret-password.

  • So create/edit /home/john/.fetchmailrc accordingly:

    # get mail from provider
    poll pop3.myprovider.com
    proto pop3
    auth password
    user "john.doe"
    pass "my-secret-password"
    mda "/usr/sbin/cyrdeliver -a -m john"
    is john
    no ssl

    Remove ‘keep‘ if all went well, and your mail server is up and running, else you’ll eventually loose email. If you have multiple email accounts, simply append them.

  • now it’s time for a cronjob. Perform a

    crontab -e

    and insert this line:

    #*/15 * * * * fetchmail -f /home/john/.fetchmailrc >> /dev/null 2>&1

    ‘*/15’ means your provider will be asked every 15 minutes for new mails. Adjust this value to your needs. Please do this cronjob step at last. It’s actually a silly idea to start with the fetchmail documentation, because fetchmail can’t deliver anything at this moment. Comment out the leading ‘#‘ if all is finished and running. I will mention that later again.