Configure the SMTP server for Sendmail

Source: Internet
Author: User

Due to restrictions on the company's intranet firewall, the following error occurs when gitlab sends an email to Gmail or another Internet mailbox via Sendmail:

Jul 14 06:48:14 gitlab Sm-MTA [12379]: r6c7hncz024915: To = <mmm@pku.edu.cn>, 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.

The solution is to configure Sendmail so that it can use the company's internal SMTP server to send an email. The configuration is simple. Add a line at the end of the/etc/mail/sendmail. Mc file:

Define ('smart _ host', 'smtp .mycompany.com ')

Then perform a test to create a text file:

To: csfreebird@gmail.comSubject: Test Sendmail in esrifrom: gitlab@mycompany.comtest Gmail

Run the following command:

Root @ gitlab:/OPT # sendmail-Vt </opt/mail.txt

Check the email address and send it successfully.

Now gitlab can send emails to all mailboxes without interruption.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.