Gitlab 4 0 email傳送配置

2021-09-11 00:19:11 字數 2253 閱讀 9841

今天gitlab 的email提醒突然不工作了。需要增加配置,奇怪為什麼之前那麼神奇什麼都不要配?

在config/gitlab.yml中設定:

## email settings  # email address used in the "from" field in mails sent by gitlab  #email_from: [email protected]  from: your_account@your_mail.com  host: your_gitlab_server_host_name

在config/environment/production.rb檔案中end前新增

config.action_mailer.delivery_method = :smtp  config.action_mailer.smtp_settings =

還要安裝sendmail

apt-get install sendmail

還是收不到email,檢查一下日誌,什麼也沒有。檢視系統日誌/var/log/syslog, 看到sendmail錯誤資訊:

feb 19 12:47:19 gitlab sendmail[42520]: my unqualified host name (gitlab) unknown; sleeping for retryfeb 19 12:48:19 gitlab sendmail[42520]: unable to qualify my own domain name (gitlab) -- using short namefeb 19 12:48:19 gitlab sendmail[42520]: gethostbyaddr(10.112.18.182) failed: 2

原來是/etc/hosts配置的順序問題:

127.0.0.1       localhost.localdomain localhost gitlab

記住,寫成一行,並且localhost要放在機器名前面。

現在ok。

再分享一下我老師大神的人工智慧教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智慧的隊伍中來!

今天gitlab 的email提醒突然不工作了。需要增加配置,奇怪為什麼之前那麼神奇什麼都不要配?

在config/gitlab.yml中設定:

## email settings  # email address used in the "from" field in mails sent by gitlab  #email_from: [email protected]  from: your_account@your_mail.com  host: your_gitlab_server_host_name

在config/environment/production.rb檔案中end前新增

config.action_mailer.delivery_method = :smtp  config.action_mailer.smtp_settings =

還要安裝sendmail

apt-get install sendmail

還是收不到email,檢查一下日誌,什麼也沒有。檢視系統日誌/var/log/syslog, 看到sendmail錯誤資訊:

feb 19 12:47:19 gitlab sendmail[42520]: my unqualified host name (gitlab) unknown; sleeping for retryfeb 19 12:48:19 gitlab sendmail[42520]: unable to qualify my own domain name (gitlab) -- using short namefeb 19 12:48:19 gitlab sendmail[42520]: gethostbyaddr(10.112.18.182) failed: 2

原來是/etc/hosts配置的順序問題:

127.0.0.1       localhost.localdomain localhost gitlab

記住,寫成一行,並且localhost要放在機器名前面。

現在ok。

linux shell 傳送email 郵件

方法一 簡單郵件傳送 echo hello world mail s subject t yanggang ithomer.com,yanggang 2050 163.com a from 463103470 qq.com 效果截圖 方法二 文字格式傳送郵件 python view plain co...

php傳送郵件email

header content type text html charset utf 8 include class.phpmailer.php include class.smtp.php mail new phpmailer mail issmtp 設定使用smtp伺服器傳送 mail host ...

linux shell 傳送email 郵件

方法一 簡單郵件傳送 echo hello world mail s subject t yanggang ithomer.com,yanggang 2050 163.com a from 463103470 qq.com 效果截圖 方法二 文字格式傳送郵件 bin shfrom name from...