因为公司内网防火墙限制,当GitLab通过SendMail发送email给Gmail或者其他外网邮箱的时候,会出现如下错误:
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.
define(`SMART_HOST',`smtp.mycompany.com')
To: [email protected] Subject: test sendmail in esri From: [email protected] test gmail
root@gitlab:/opt# sendmail -vt < /opt/mail.txt
好了,这下GitLab可以畅通无阻的发送email给所有邮箱了。