Site icon Franky's Web

Retrieve e-mails via POP3 and deliver them to Exchange (POP Connector)

I haven't needed it for ages, but now I'm back in a situation where I need a POP connector for Exchange. The reason for this is a somewhat idiosyncratic configuration of my new hoster's mail server. Until the problem is solved, I have to pick up exactly one mailbox via POP3 and deliver it to the local Exchange server. Years ago, I used to use the POPcon software from Servolutions for this, but I didn't want to spend 79 EUR for the one mailbox and a transitional basic solution. There used to be some free alternatives to POPcon, but they all seem to have disappeared or are hopelessly outdated.

I can still vaguely remember having built something with Fetchmail on a Linux server, but I didn't want to install a Linux VM for the one mailbox. WSL also seems to me to be a bit overkill, but fortunately you can also run many Linux tools on Windows using Cygwin. So if anyone needs it, here is a quick and dirty guide for a POP connector using Fetchmail on Windows.

First, Cygwin must be downloaded and installed. I run Cygwin and Fetchmail directly on the Exchange server. For my single mailbox this is OK for me, but of course I bypass my SPAM filter this way, everything that is in the POP mailbox is also delivered to my mailbox. It's not nice, but it's acceptable for my transitional basic solution. You can download Cygwin here:

https://cygwin.com/install.html

The installation of Cygwin and Fetchmail is done quickly, so here are the uncommented screenshots for the sake of completeness:

Only fetchmail needs to be selected as the package. The corresponding dependencies are installed automatically:

After Cygwin and Fetchmail are installed, you will need the following 3 files from this download:

The 3 files from the archive must now be copied to the Cygwin installation directory. In my case it is d:\Tools\Cygwin:

The path to the Cygwin bin directory must now be adjusted in the fetchmail.cmd file:

In the fetchmailrc file, the mailboxes are entered which are to be retrieved from the POP3 server and delivered to Exchange:

I run fetchmail directly on the Exchange server, so I have entered localhost as smtphost here. If fetchmail is running on another server, the name of the Exchange server can of course also be entered as smtphost. If several POP3 mailboxes are to be fetched, the 3 lines can be entered several times in the fetchmailrc file.

The fetchmailrc file now requires certain access rights so that fetchmail does not complain. To do this, a Cygwin terminal (Bash) must be started and the access rights of the file adjusted. The following screenshot shows how it works:

Now the script "fetchmail.cmd" can be executed and the mails are fetched from the POP3 server and delivered to Exchange. A log file is created in the Cygwin directory for this purpose:

A scheduled task can be created so that Fetchmail is executed every few minutes. In this case, fetchmail.cmd only needs to be executed every 5 minutes, for example:

So it works well and I now have 94 mails to process...

Exit mobile version