Skip to content

Mail Service Setup

1. Sendmail install

  • Check if sendmail was installed. if not, please install it first
rpm -qa|grep sendmail
dnf install -y sendmail

image-20251006164405717

2. Sendmail config

  • Add mail server info into /etc/hosts
if ! grep -q "10.41.10.108    smtmailserver   sendmailserver.wistron.com" /etc/hosts; then
    echo "10.41.10.108    smtmailserver   sendmailserver.wistron.com" | sudo tee -a /etc/hosts
    echo "内容已添加到 /etc/hosts"
else
    echo "内容已存在,无需添加"
fi

image-20251006170220835

  • Modify config file
vim /etc/mail/sendmail.cf

添加修改内容:

Dj$w.wistron.com

DSsendmailserver.wistron.com

image-20251006170703532

  • Start send mail service, and test sendmail

Start sendmail service

systemctl enable --now sendmail.service

image-20251006171425044

Test mail send

mail -s "test" "Seven_Qin@wistron.com" < /etc/hosts

image-20251006171743091