ubuntu下向163發送郵件

來源:互聯網
上載者:User

環境:ubuntu12.04

一。安裝軟體

apt-get install sendmail

apt-get install sendmail-cf(一般上面一步已經安裝此軟體)

apt-get install mailutils

查看是否安裝成功:終端輸入ps aux | grep sendmail

root 23905 0.0 0.2 15104 2240 ? Ss 14:41 0:00 sendmail: MTA: accepting connections
hadoop 26100 0.0 0.0 4368 828 pts/2 S+ 17:11 0:00 grep --color=au
to sendmail

表示sendmail啟動成功。

二,配置

vi /etc/mail/sendmail.mc

修改:DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=0.0.0.0)dnl

產生新的設定檔:

cd /etc/mail

mv sendmail.cf sendmail.cf~備份

m4 sendmail.mc > sendmail.cf

三。發送郵件

這裡我用了個qq郵箱,太坑了。

echo "本文" | mail -s 主題 12345@qq.com

結果一直沒收到郵件,查看/var/log/syslog,發現 DSN: Service unavailable,網路上說是網域名稱問題,修改主機名稱

解決方案就是修改/etc/hosts裡面的第一行:127.0.0.1 gitlab.youdomain.com localhost ubuntu1204-dell# 127.0.0.1 localhost.localdomain localhost ubuntu1204-dell 也不要重啟,然後在觀察/var/logs/syslog日誌,問題解決了,我這裡沒有解決,然後修改了主機名稱與hosts對應,重啟後錯誤一樣但是發現relay=mx3.qq.com. [183.62.125.199],說明郵件已經發送,但是退回了,無奈只能改為163郵箱,之後成功

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.