Plesk Obsidian / Onyx

Plesk Smarthost Configuration

Authenticated relay host setup with Plesk Mail Server settings

Back to Documentation

What does this guide do?

Ensures all emails sent from your Plesk server are delivered through the MXGate smarthost (with authentication). Works on Postfix-based Plesk systems.

Prerequisites

  • Plesk admin/root access
  • SMTP username and password created from MXGate panel
  • Plesk Obsidian 18.x+ or Onyx 17.x+
  • Postfix mail server (not QMail)

1 Access Plesk Mail Server Settings

Log in to Plesk admin panel and navigate to Tools & Settings > Mail Server Settings from the left menu.

# Plesk Yolu:
Tools & Settings > Mail Server Settings

2 SMTP Relay (Smarthost) Settings

In the Mail Server Settings page, find the SMTP relay section and configure:

# SMTP Relay Ayarları:
☑ Use SMTP relay
Relay host: smtp.mxgate.com.tr
Port: 587
☑ Use SMTP authentication
Username: MXGATE_KULLANICI_ADI
Password: MXGATE_SIFRE

Port 587 automatically uses TLS encryption.

3 Save Settings

Click OK or Apply to save settings. Plesk will automatically update Postfix configuration and restart the service.

This process may take 30-60 seconds. Please wait for it to complete without closing the page.

Alternative: Configuration via SSH/CLI

If you prefer command line over GUI, you can use the following commands:

# Plesk CLI ile relay host ayarlama:
/usr/local/psa/bin/server_pref -u -smtp_relay_enable true
/usr/local/psa/bin/server_pref -u -smtp_relay_host smtp.mxgate.com.tr
/usr/local/psa/bin/server_pref -u -smtp_relay_port 587
/usr/local/psa/bin/server_pref -u -smtp_relay_auth_enable true
/usr/local/psa/bin/server_pref -u -smtp_relay_auth_username MXGATE_KULLANICI
/usr/local/psa/bin/server_pref -u -smtp_relay_auth_password MXGATE_SIFRE
# Postfix'i yeniden başlat:
plesk bin service --restart postfix

4 Manual Postfix Configuration (Advanced)

If Plesk GUI doesn't work, you can configure manually. Edit the Postfix main.cf file:

# main.cf dosyasını yedekleyin:
cp /etc/postfix/main.cf /etc/postfix/main.cf.backup
# main.cf düzenleme:
nano /etc/postfix/main.cf
# Aşağıdaki satırları ekleyin/değiştirin:
relayhost = [smtp.mxgate.com.tr]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
# SASL şifre dosyası oluşturun:
nano /etc/postfix/sasl_passwd
# İçerik:
[smtp.mxgate.com.tr]:587 MXGATE_KULLANICI:MXGATE_SIFRE
# Dosya izinleri ve hash:
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
# Postfix yeniden başlat:
systemctl restart postfix

Security: sasl_passwd file must be readable only by root (chmod 600).

5 Testing and Verification

Test if the configuration is working. Send an email and check the Postfix logs:

# Postfix loglarını izleyin:
tail -f /var/log/maillog
# Veya:
tail -f /var/log/mail.log
# Başarılı bağlantı görmelisiniz:
"status=sent (250 2.0.0 Ok: queued as"
# SMTP kimlik doğrulama testi:
postqueue -p
postsmtp -v smtp.mxgate.com.tr:587

Success! All your outgoing emails are now delivered encrypted and authenticated through MXGate.

Troubleshooting

SASL authentication failed:

Check username/password. Make sure you ran postmap command after creating sasl_passwd file.

Connection timed out:

Firewall (Plesk Firewall or server firewall) may not allow port 587. Check outbound 587 permission.

Relay access denied:

Ensure your server IP is whitelisted in MXGate panel, or check authentication credentials.

Plesk ayarları kaydedilmiyor:

Ensure Plesk "Mail Server" service is running. Check in Tools & Settings > Services.

Plesk Specific Notes

  • Smarthost settings in Plesk are global - apply to all domains.
  • Separate relay settings per domain are not possible.
  • If Plesk's "Outbound Antispam Protection" is active, there may be some conflicts.
  • This guide is not valid for older Plesk installations using QMail.