untuk SMTP Relay saya menggunakan mailgun https://www.mailgun.com/ jika belum mepunyai accountnya bisa daftat telebih dahulu untuk mailgun perbulan free 10000 email , pastikan anda sudah menginstall zimbra terlebih dahulu , jika sudah berikut untuk langkah-langkah settingannya
Setting a relay host
1 2 |
su - zimbra zmprov ms server.domain.com zimbraMtaRelayHost mailrelay.example.com:port |
Enabling SMTP authentication
membuat pemetaan file teks yang nama / password harus digunakan untuk setiap tujuan keluar yang diberikan:
1 |
echo mailrelay.example.com username:password > /opt/zimbra/conf/relay_password |
Buat tabel postfix lookup:
1 |
postmap /opt/zimbra/conf/relay_password |
Untuk menguji bahwa tabel benar, berikut ini harus kembali username: password:
1 |
postmap -q mailrelay.example.com /opt/zimbra/conf/relay_password |
Configure postfix to use the new password map:
1 |
zmprov ms server.domain.com zimbraMtaSmtpSaslPasswordMaps lmdb:/opt/zimbra/conf/relay_password |
Configure postfix to use SSL authentication:
1 |
zmprov ms server.domain.com zimbraMtaSmtpSaslAuthEnable yes |
Configure postfix to use the outgoing servername rather than the canonical server name:
1 |
zmprov ms server.domain.com zimbraMtaSmtpCnameOverridesServername no |
1 2 3 4 |
zmlocalconfig -e postfix_smtp_sasl_mechanism_filter=plain,login zmlocalconfig -e postfix_smtp_sasl_security_options=noanonymous zmlocalconfig -e postfix_smtp_tls_security_level=may zmlocalconfig -e postfix_smtp_sasl_auth_enable=yes |
1 |
zmprov ms <server> zimbraMtaSmtpSaslSecurityOptions noanonymous |
seleseai untuk konfigurasi SMTP relaynya silahkan di coba dan untuk mengirimkan email
untuk cek lognya bisa di lihat di
1 |
tail -f /var/log/maillog |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@mail ~]# tail -f /var/log/maillog Apr 5 10:35:08 mail postfix/qmgr[23267]: 1AA9C542226F: removed Apr 5 10:35:13 mail postfix/amavisd/smtpd[4785]: connect from localhost.localdomain[127.0.0.1] Apr 5 10:35:13 mail postfix/amavisd/smtpd[4785]: F0AE95422B99: client=localhost.localdomain[127.0.0.1] Apr 5 10:35:13 mail postfix/cleanup[4777]: F0AE95422B99: message-id=<2146451683.76.1459866908042.JavaMail.zimbra@demmy.id> Apr 5 10:35:13 mail postfix/qmgr[23267]: F0AE95422B99: from=<nanda@demmy.id>, size=1924, nrcpt=1 (queue active) Apr 5 10:35:13 mail postfix/smtp[4778]: 82C1A5422B9C: to=<dnadna91@gmail.com>, relay=127.0.0.1[127.0.0.1]:10032, delay=5.5, delays=0.04/0.0 1/0/5.4, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as F0AE95422B99) Apr 5 10:35:13 mail postfix/qmgr[23267]: 82C1A5422B9C: removed Apr 5 10:35:13 mail postfix/amavisd/smtpd[4785]: disconnect from localhost.localdomain[127.0.0.1] Apr 5 10:35:15 mail postfix/smtp[4786]: F0AE95422B99: to=<dnadna91@gmail.com>, relay=smtp.mailgun.org[104.130.177.23]:587, delay=1.5, delay s=0/0.01/0.96/0.52, dsn=2.0.0, status=sent (250 Great success) Apr 5 10:35:15 mail postfix/qmgr[23267]: F0AE95422B99: removed |
sudah sukses relay nya silahkan selamat mencoba