Skip navigation

fetching emails from ISP and import to Mail Server

3109 Views 12 Replies Latest reply: May 5, 2012 8:00 AM by Chen Zhongguo RSS
niklasfromstockholm Calculating status...
Currently Being Moderated
Aug 30, 2011 6:34 AM



Just purchased a Mac Mini with Lion Server.


I want to to use it as my company's email server, and read that I can use Mail Server for this.


I just seem to have this one tiny little problem.... How do I fetch emails from our external ISP and "import" them to Mail Server? I cannot for the life of me understand how to achieve this??


Any help in this matter would be greatly appreciated!





Mac mini, Mac OS X (10.7.1), Lion Server
  • ScottM Level 1 Level 1 (120 points)

    Using, read the manual for "fetchmail" -- this is included by default on Lion, client and server.


           fetchmail - fetch mail from a POP, IMAP, ETRN, or ODMR-capable server


    Does exactly what you want and has been around quite a while. 

  • ScottM Level 1 Level 1 (120 points)

    The Unix man pages -- from the shell/command line.  Thus, start Terminal first, then type:


    man fetchmail


    You can also read:



    Same thing...


    It's a command line utility that does what you want.

  • ScottM Level 1 Level 1 (120 points)

    I think you may be slightly missing somethng -- or, more to the point, perhaps you just didn't explain what you want to accomplish quite right.


    Lion is based on Unix.  It has the MTA (mail transfer agent) of Postfix built in.  You don't *need* Lion Server in order for your Lion system to be a mail server.  Indeed, you can do it with the same freeware that Apple uses:


    MTA: Postfix

    Webmail: Roundcube

    IMAP/POP: Dovecot

    Server Side Filtering: Pigeonhole Sieve (built in to Dovecot)


    The Apple Lion Server package provides a VERY simple GUI around some of the server software -- there's a bit more depth in the Server Admin package which is available for free as well.


    The Fetchmail solution is just one way to get from A to B.  In most cases, you should just set up your Lion box to be a normal mail server, using the standard applicaitons listed above (or, use the Server version of Lion for a simple GUI).


    Fetchmail is more about handling mail in a batched fashion, where you want to download it from Server A, and inject it into Server B as if it was new mail arriving from the Internet.


    Thus, any filtering into folders needs to be done either with Server Side Filtering (Sieve, which with Lion Server, can be managed, per user, via the Webmail interface) or with client-based filters ( rules, or other mail clients that see incoming mail and automatically sort it for you).


    The smoothest setup, by far, is to simply configure the server to be a server.  For the Internet NOT to mail your ISP, but to mail you directly.  This takes a bit more care and attention, as you have to deal with thigns like Spam in ways that your provider may do for you...


    So perhaps you don't want to *IMPORT* mail from the ISP, but, you should work with your ISP to figure out what services *they* provide to help you run your own mail server.  Different providers have different options.


    If your company has its own domain name, and you're familiar with the risks, perils and benefits of running a mail server, you can do it yourself - that's what I do - but if you're not familiar with all of the issues that go along with running an Internet facing mail server, then you'll have to think about your plans and goals carefully.

  • billeco Calculating status...

    Hi Niklas, unfortunately I've only now come across your discussion. Even more unfortunately I've already spent 1keuro on the new minmac server which I believed was going to be oh-so-simple to set up but I've hit a solid brick wall regarding the mailserver. come back xp, all is forgiven. Did you find an easy solution? my brand new server is still sitting in the corner after 2wks and i've more or less decided to install win xp on it because its become an embarassement. 20yrs with ms and not able to get my head around intuitively simple apple. oh the shame of it

    regards, bill

  • stevemit Calculating status...

    This is an inexplicable hole in Apple's server offering.  I was able to set up a useful mail server, but not without many headaches and scrounging around Unix lore.  This should be part of Apple's easy-to-use configuration tools.


    To fetch incoming emails from ISP email accounts:

    • Create and configure /etc/fetchmailrc
    • Create and configure /Library/LaunchDaemons/fetchmail.plist


    To send outgoing emails through ISP mail servers (if the ISP requires SSL on port 465):

    • Install stunnel
    • Create and configure /Library/LaunchDaemons/stunnel.plist
    • Create and configure /opt/local/etc/stunnel/stunnel.conf
    • Configure /etc/postfix/
      • Enable plaintext auth to local stunnel port
    • Configure /etc/postfix/sasl/passwd
      • Configure ISP login credentials for outgoing email


    To enable external webmail (on a server with a dynamic DNS name):

    • Enable the DNS service on your local server
      • Point your dynamic DNS name to your local server


    These are common configuration requirements, but Apple's server is anything but easy to accommodate them.



  • billeco Level 1 Level 1 (0 points)
    Currently Being Moderated
    Apr 28, 2012 6:22 AM (in response to stevemit)

    Hi Steve, that's an interesting solution - congrats for being so persistent in finding a working solution. I got tired and embarassed from having to hide my new server in a filing cabinet. 20yrs on computers and I still couldn't get on top of this "intuitively easy" operating system. So i bit the bullet one weekend, installed win7 on the server together with hmailserver, mysql and apache and on the monday everything was honky-dory. Haven't looked back. Bill

  • Chen Zhongguo Calculating status...

    My solution to "fetching emails from ISP and import to Mail Server" is use Popcon (, it should be installed on PC. It can successfully populate mail to my local email server. But mail client can't receive the mail, because local mail server resend mail to ISP server again. Because ISP email name( is same as the email name on local email server.


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.