I have a basic question for a mail setup which i have to implement.

We have an SMTP server (Postfix) in DMZ, which should receive and accept all mails for our internal users. Then we have a internal mail server which should provide all the mails to the users with IMAP.

The problem is, no connections from DMZ are allowed (except LDAP/s). So the internal mail server has download the mails from the server in the DMZ.

I'm not sure which tool stack to use and how to make the mails available for the internal server.

EDIT: So basically I have to do something like this with fetchmail on the internal server:

poll serverDMZ.domain.com protocol POP3 envelope "Delivered-To:" localdomains example.org user "*@example.org" there with password "Passw0rd!" is * here smtpaddress localhost ssl fetchall

But I don't now how to configure the SMTP Server in DMZ.


  • I think there are a few details missing here. Why would there be a requirement to not deliver mail directly, when fetching LDAP information directly is acceptable?
    – anx
    Apr 15, 2021 at 13:46
  • @anx We have to do lab in cs class and this a requirement. It's for sure a stupid requirement. The lecturer wants us to fetch the mails with a POP3 connector or ETRN from the SMTP Server. Apr 15, 2021 at 14:01
  • Sorry for the misunderstandig. From the DMZ it's not allowed to initiate any connection except LDAP. Apr 15, 2021 at 14:25
  • So, how does that fit together with a feature that is solely intended to request initiating a connection?
    – anx
    Apr 15, 2021 at 14:34
  • By doing it with a POP3 connector, so the connection is initiated by the internal mail server. Apr 15, 2021 at 14:37

2 Answers 2


Postfix handles SMTP(S) protocol. Technically it is an MTA (Mail Transfer Agent). It moves emails around to recipients mail servers or, if it is the server managing recipient's email address, either directly stores them in recipient's mailbox or passes them to another software (i.e. dovecot) which performs this task.

Softwares like dovecot are MDA (Mail Delivery Agent). They manage email 'last mile'. They speak IMAP(S) and POP3(S) and allow the retrieval of emails from a remote server to either a mail client (MUA - Mail User Agent) like Thunderbird, or fetchmail.

Long story short: my suggestion is to install an MDA like dovecot on the external server running postfix and configure postfix to deliver incoming emails to it. Internal mail server would fetch emails from it using POP3, making them available for internal users.


For your scenario, you won't install a second email server, instead:

  1. Configure an internal SMTP Relay server (or a Send-only SMTP Server) which will send e-mails

    Take a look at this tutorial: Configure Postfix to Send Email Using External SMTP Servers

  2. Configure fetchmail on the internal server to retrieve emails from your external mail server

  3. Configure an IMAP server on your internal server to deliver emails internally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.