Fetching Email From ISP/Gmail To A Local Server

There are several benefits of fetching emails from an ISP or a Gmail account to a local email server. For example:

  • Bypass storage limitations imposed by the ISP
  • Filtering junk emails
  • Add business logic to emails. For example, automatically replying to certain messages.
  • Email archiving
  • Ability to access emails behind a network that does not have direct access to the Internet

This page talks about setting up a local email server that can pull emails from any ISP or public email services like Gmail, Yahoo, Hotmail, GMX, Zoho, Mail.com, and others.

These steps demonstrate how to fetch emails as well as send outbound emails through these services. Although you could use any email server that can fetch emails from a POP3 server, we will be using Xeams in this example.

The following image depicts the network design of such a system.

This image shows a local email server that:

  • Periodically fetches emails from ISP, Gmail, or any other provider using POP3.
  • Local users use their favorite email clients, such as Outlook, Mozilla Thunderbird, or a web-based client such as Rainloop. Note that users could either use POP3 or IMAP to fetch their messages from their local server.
  • Outbound emails will first go to Xeams, which can then eventually send them to your ISP.

Prerequisites

  • Download Xeams. For this example, we will be installing it on a Windows machine. Note that Xeams works on any operating system including Linux, Unix, or a NAS box, such as QNAP or Synology.
  • Consider installing it on a machine that runs 24/7. Installing it on a laptop is not recommended.
  • A reliable Internet connection. Static IP is not required.

Setting up Inbound Emails

  • Install Xeams, which is as easy as double-clicking the setup.exe file. No other software is required.
  • Once done, the installer will attempt to open the browser on your machine.
  • During initial setup, you will be prompted for a domain name. DO NOT specify your ISP's domain. Instead, create a fictitious domain name for yourself. Assume the fictitious domain name is myfakedomain.com.
  • Once the initial setup is over, click Server Configuration/Manage Users and create a new user for yourself. For example john.doe@myfakedomain.com.
  • Click Manage Configuration/Manage POP3 Fetcher and create the button for New Account.
  • Specify john.doe@myfakedomain.com in the Recipient field.
  • The Remaining fields on the following screen are self-explanatory. Click the ? icon on the left for helpful tips.
  • Once done, Xeams will periodically fetch emails from your ISP. You will be able to see these fetched messages under Message Repository.

Setting up Outbound Emails

  • Many email providers/ISP provide instructions on how to connect to their SMTP server. Please contact your ISP to find out:
    • Hostname for their SMTP server
    • Port
    • Security, such as SSL or TLS


    Note: Some providers like Gmail and Microsoft require you to create an App Password before they accept emails
  • Click Server Configuration/Manage Smart Host within Xeams Admin Console to setup outbound configuration.

Configuring Email Client

Finally, connect to Xeams using your favorite email client. We will be using Thunderbird in this example.

  • When setting up Thunderbird, create an email account for john.doe@myfakedomain.com.
  • You will have to manually setup up the server parameters since Thunderbird will not be able to find myfakedomain.com on any DNS server.
  • Specify the IP address/hostname of Xeams for POP3/IMAP as well as SMTP.
  • Create a new Identity in Thunderbird representing your real address, such as your.email@gmail.com. This step will allow you to reply to messages with your real address rather than the fake one.

POP3 & SMTP Settings For Popular Providers