歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> sendmail配置SMTP服務器

sendmail配置SMTP服務器

日期:2017/3/1 15:52:58   编辑:關於Linux
sendmail配置SMTP服務器 因為公司內網防火牆限制,當GitLab通過SendMail發送email給Gmail或者其他外網郵箱的時候,會出現如下錯誤: [plain] Jul 14 06:48:14 gitlab sm-mta[12379]: r6C7HnCZ024915: to=<[email protected]>, delay=1+15:30:25, xdelay=00:00:00, mailer=esmtp, pri=21452479, relay=mx1.pku.edu.cn., dsn=\ 4.0.0, stat=Deferred: Connection timed out with mx1.pku.edu.cn. 解決辦法就是配置SendMail,讓它使用公司內部的SMTP服務器發送email。配置很簡單, 在/etc/mail/sendmail.mc文件中末尾加上一行: [plain] define(`SMART_HOST',`smtp.mycompany.com') 然後做個測試,創建一個文本文件: [plain] To: [email protected] Subject: test sendmail in esri From: [email protected] test gmail 運行命令: [plain] root@gitlab:/opt# sendmail -vt < /opt/mail.txt 檢查郵箱,發送成功。 好了,這下GitLab可以暢通無阻的發送email給所有郵箱了。
Copyright © Linux教程網 All Rights Reserved