Bumalik sa blog
Pebrero 2, 2026Mga Gabay

Paano Mag-setup ng Private Email Server sa VPS

Kumpletong gabay sa pag-setup ng iyong sariling private email server gamit ang Postfix at Dovecot sa VPS. Matuto kung paano mag-host ng iyong sariling email na may buong privacy at kontrol.

Paano Mag-setup ng Private Email Server sa VPS

Ang pagpapatakbo ng iyong sariling email server ay nagbibigay sa iyo ng kumpletong kontrol sa iyong mga komunikasyon, tinitiyak ang privacy at iniiwasan ang pag-asa sa third-party providers. Habang nangangailangan ito ng ilang teknikal na kaalaman, ang pag-setup ng private email server sa iyong VPS ay ganap na makakamit. Ang gabay na ito ay sumasaklaw sa pag-setup ng Postfix (SMTP) at Dovecot (IMAP/POP3) para sa kumpletong email solution.

Bakit Mag-host ng Sariling Email Server?

  • Kumpletong privacy: Ang iyong mga email ay naka-store sa iyong server, hindi na-scan ng third parties
  • Walang data mining: Iwasan ang targeted advertising batay sa email content
  • Custom domains: Gumamit ng iyong sariling domain para sa propesyonal na email addresses
  • Walang limitasyong accounts: Gumawa ng maraming email addresses hangga't kailangan mo
  • Buong kontrol: I-configure ang spam filters, security policies, at storage limits
  • Cost-effective: Isang server ay maaaring mag-handle ng maraming email accounts

Mga Prerequisites

  • VPS na may hindi bababa sa 2GB RAM at 20GB storage
  • Domain name na may DNS access
  • Static IP address (inirerekomenda)
  • Ubuntu 20.04 o Debian 11+
  • Root o sudo access

DNS Configuration

Bago i-install ang email software, i-configure ang DNS records:

  • A record: mail.yourdomain.com → iyong server IP
  • MX record: yourdomain.com → mail.yourdomain.com (priority 10)
  • SPF record: TXT "v=spf1 mx a:mail.yourdomain.com ~all"
  • DKIM record: Gagawin pagkatapos ng installation
  • DMARC record: TXT "v=DMARC1; p=none; rua=mailto:admin@yourdomain.com"

Pag-install at Pag-configure ng Postfix

bash
apt update
apt install -y postfix postfix-mysql dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql

# Sa panahon ng installation, piliin ang 'Internet Site' at ilagay ang iyong domain name
# I-configure ang Postfix main settings:
nano /etc/postfix/main.cf

# Mga pangunahing settings:
myhostname = mail.yourdomain.com
mydomain = yourdomain.com
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, $mydomain
inet_interfaces = all

Pag-configure ng Dovecot

bash
nano /etc/dovecot/conf.d/10-mail.conf

# I-set ang mail location:
mail_location = maildir:/var/mail/vhosts/%d/%n

nano /etc/dovecot/conf.d/10-auth.conf

# I-enable ang authentication:
disable_plaintext_auth = no
auth_mechanisms = plain login

systemctl restart dovecot
systemctl restart postfix

Pag-setup ng Webmail (Opsiyonal)

I-install ang Roundcube para sa web-based email access:

bash
apt install -y roundcube roundcube-mysql roundcube-plugins
# I-configure ang Roundcube sa panahon ng installation
# Ma-access ang webmail sa: https://yourdomain.com/webmail

Security Configuration

  • I-enable ang SSL/TLS encryption para sa SMTP (port 587) at IMAP (port 993)
  • I-configure ang firewall para payagan lamang ang mga kinakailangang ports (25, 587, 993, 995)
  • Mag-setup ng fail2ban para maiwasan ang brute force attacks
  • Gumamit ng malalakas na password at isaalang-alang ang two-factor authentication
  • Regular na i-update ang lahat ng email server software
  • I-monitor ang logs para sa suspicious activity
  • I-configure nang tama ang SPF, DKIM, at DMARC records

Mahahalagang Tips

  • Ang mga IP ng email server ay maaaring ma-blacklist - i-monitor ang iyong IP reputation
  • Magsimula sa maliit na setup at unti-unting i-scale
  • Panatilihin ang backups ng email data at configurations
  • I-test ang email delivery sa mga major providers (Gmail, Outlook, atbp.)
  • Isaalang-alang ang paggamit ng relay service para sa mas mahusay na deliverability
  • I-monitor ang disk space - ang mga email ay maaaring kumonsumo ng malaking storage