sendmail with SSL

By | 2020년 4월 5일
Table of Content

sendmail with SSL

먼저 여기 를 참조하여 SSL 을 설치해야 합니다.

sudo vi /etc/hostname

skyer9.pe.kr
sudo reboot
sudo vi /etc/mail/sendmail.mc

define(`confCACERT_PATH', `/etc/letsencrypt/live/skyer9.pe.kr')dnl
define(`confCACERT',      `/etc/letsencrypt/live/skyer9.pe.kr/chain.pem')dnl
define(`confSERVER_CERT', `/etc/letsencrypt/live/skyer9.pe.kr/cert.pem')dnl
define(`confSERVER_KEY',  `/etc/letsencrypt/live/skyer9.pe.kr/privkey.pem')dnl
define(`confCLIENT_CERT', `/etc/letsencrypt/live/skyer9.pe.kr/cert.pem')dnl
define(`confCLIENT_KEY',  `/etc/letsencrypt/live/skyer9.pe.kr/privkey.pem')dnl
sudo chmod 755 /etc/letsencrypt/live/
sudo chmod 755 /etc/letsencrypt/archive/
sudo vi /etc/mail/sendmail.mc

include(`/etc/mail/tls/starttls.m4')dnl
# below the following
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
sudo vi /etc/mail/submit.mc

include(`/etc/mail/tls/starttls.m4')dnl
# below the following
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
sudo service saslauthd start
sudo vi /etc/default/saslauthd

START=yes

sudo systemctl reload saslauthd
sudo sendmailconfig

아래 설정을 추가하면, TLS 가 활성화되어 이메일이 발송됩니다.

vi ~/.mutt/muttrc

set from="ubuntu@skyer9.pe.kr"
set realname="ubuntu"
set hostname=skyer9.pe.kr
set ssl_starttls=yes
echo "메일 내용" | mutt -s "제목" skyer9@gmail.com

답글 남기기