1. What you need

      • Ubuntu 22.04/24.04 VPS with root/SSH access
      • A domain and hostname like mail.yourdomain.com
      • DNS A record pointing mail.yourdomain.com to your server IP
      • Open ports 25, 587, 465, 143, 993 (as needed)
      • At least 1–2 GB RAM for a small mail box setup

2. Update the server

      • Run: sudo apt update && sudo apt -y upgrade
      • Set hostname: sudo hostnamectl set-hostname mail.yourdomain.com
      • Edit /etc/hosts so the FQDN maps to the server IP

3. Install Postfix

      • Run: sudo apt install -y postfix
      • Choose Internet Site when prompted
      • Set system mail name to yourdomain.com
      • Confirm service: sudo systemctl status postfix

4. Install Dovecot

      • Run: sudo apt install -y dovecot-core dovecot-imapd dovecot-pop3d
      • Enable and start: sudo systemctl enable --now dovecot
      • Check status: sudo systemctl status dovecot

5. Basic mailbox user setup

      • Create a Linux user for each mailbox, or configure virtual users later
      • For a simple start, create a system user and set a strong password
      • Test IMAP login from a mail client using mail.yourdomain.com

6. Enable submission (recommended)

      • Configure Postfix submission on port 587 with authentication
      • Use STARTTLS/SSL certificates for encrypted login
      • Prefer 587/465 for client sending instead of open relay on 25

7. Test the stack

      • Send a local test with: echo test | mail -s hello you@yourdomain.com
      • Check mail logs: sudo tail -f /var/log/mail.log
      • Connect with Thunderbird/Outlook using IMAP + SMTP submission

8. Next hardening steps

      • Install Let's Encrypt SSL for mail hostname
      • Add SPF, DKIM, and DMARC DNS records
      • Disable open relay and require auth for sending
      • Set up firewall rules and fail2ban

9. Campaigns vs mailbox server

Postfix/Dovecot handle mailboxes and transport. For high-volume personalized campaigns, use Px Mailer to manage leads, SMTP pools, attachments, and tracking — then send through your SMTP path when allowed. Px Mailer: https://pxtoolx.com