sumarsono.com
Take it with a grain of salt


Msmtp Debian 10

Posted on

Aku pengen server Debian 10 punyaku bisa kirim email pakai external smtp server. Ada banyak caranya, kali ini aku mau pakai msmtp.

Pertama, aku install paket msmtp, dan bsd-mailx (yg ini supaya kita bisa pakai command mail)

bash apt install msmtp msmtp-mta bsd-mailx


Terus, aku bikin konfigurasi msmtp

bash
nano ~/.msmtprc

Isi dari ~/.msmtprc:

defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
logfile        ~/.msmtp.log

# akun smpt
account        nalakawula
host           smtp.domain.com
port           587
from           [email protected]
user           [email protected]
password       password-email
account default : nalakawula

Note: kalau pakai akun gmail, password-email diganti pakai app password.

Terakhir, tes kirim email:

mail -s "Tes dari Server" [email protected] < /dev/null

Selesai