~2 min read • Updated Jan 27, 2026

1. What is Postfix?


Postfix is a modern, secure, and high‑performance Mail Transfer Agent (MTA). It handles:

  • Outgoing email (SMTP sending)
  • Incoming email (SMTP receiving)
  • Email routing and delivery

It is considered the modern replacement for Sendmail and focuses heavily on:

  • Security
  • Performance
  • Simplicity of configuration

2. What is iRedMail and What Role Does Postfix Play?


iRedMail is a complete mail server stack that bundles several services together:

ServiceRole
PostfixSMTP sending/receiving
DovecotIMAP/POP3 mailbox access
AmavisEmail filtering
SpamAssassinAnti‑spam
ClamAVAnti‑virus
iRedAPDPolicy & restrictions
RoundcubeWebmail

Postfix is the backbone of the entire iRedMail system.


3. Mail Flow Architecture in iRedMail


Incoming mail:

Internet
   ↓
Postfix (SMTP)
   ↓
Amavis (Virus/Spam Scan)
   ↓
Dovecot (Mailbox Storage)

Outgoing mail:

User → SMTP Auth → Postfix → Internet

4. Postfix Service Architecture


Postfix is a daemon‑based service composed of multiple internal processes:

  • master
  • smtp
  • qmgr
  • cleanup
  • pickup

Managed via systemd:

systemctl status postfix

5. Installing Postfix via iRedMail


5.1 Requirements

  • Clean OS (Ubuntu / Debian / Rocky / Alma)
  • Valid hostname
  • DNS records: A + MX

5.2 Installation

wget https://github.com/iredmail/iRedMail/archive/refs/tags/1.7.1.tar.gz
tar xvf 1.7.1.tar.gz
cd iRedMail-1.7.1
bash iRedMail.sh

During the installation wizard:

  • MTA → Postfix (default)
  • Select web server
  • Select backend (MariaDB / LDAP)

6. Important Postfix Files in iRedMail


PathDescription
/etc/postfix/main.cfMain configuration file
/etc/postfix/master.cfServices and ports
/var/log/maillogMail logs
/var/spool/postfixMail queue

7. Key Settings in main.cf


7.1 Server Identity

myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain

7.2 Trusted Networks

mynetworks = 127.0.0.0/8

7.3 TLS / SSL

smtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_use_tls = yes

7.4 SASL Authentication

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth

8. Postfix Ports in iRedMail


PortPurpose
25SMTP (server‑to‑server)
587Submission (authenticated users)
465SMTPS

Enable submission in master.cf:

submission inet n - y - - smtpd

9. Queue Management


View queue:

mailq

Clear queue:

postsuper -d ALL

10. Testing Postfix


telnet localhost 25
or:
swaks --to [email protected]

11. Postfix Security in iRedMail


  • Relay restrictions
  • SPF / DKIM / DMARC (configured automatically by iRedMail)
  • Fail2Ban
  • Rate limiting

12. Troubleshooting


Logs:

tail -f /var/log/maillog

Check configuration:

postfix check

Conclusion


Postfix is the core SMTP engine of iRedMail and handles all email transmission. While iRedMail automates most of the complex configuration, administrators should understand the main configuration files, ports, security settings, and logs. With proper setup, Postfix provides a fast, secure, and reliable mail delivery system.


Written & researched by Dr. Shahin Siami