sendmail發郵件報錯的解決辦法

2021-09-01 01:14:11 字數 453 閱讀 6329

今天有台伺服器換硬碟重啟了一下,起來後發現發不出去郵件了,看日誌有如下報錯資訊

error:real domain name required for sender address。

手動發郵件也不好使

mail -s "test" [email protected] < 1.txt

提示直接存入了dead.letter

經查閱資料後得知是hostname配置的問題,重新修改hostname即可。

重新溫習一下修改hostname的步驟

1、hostname server01 【立即生效】

2、vi /etc/sysconfig/network 【重啟後會讀這個檔案】

新增或修改:hostname=server01

3、vi /etc/hosts 【跟各個應用有著千絲萬縷的關係,一定得改】

在127.0.0.1後面新增主機名server01

sendmail分組群發郵件

前兩天公司財務需要 郵件到各部門,於是做了個簡單粗暴的郵件分組 下面記錄下步驟,以防以後忘記 切換root賬戶之後,vim編輯aliases root local vim etc aliases 在檔案末尾加入如下語句 我是加在 trap decode to catch security attac...

shell 發郵件命令之 sendmail

只有內容 echo content111 sendmail 1111 aa.com 有內容,有標題,可設定發件人 收件人 cc bcc 命令 sendmail t 111 aa.com content.txt content.txt 檔案內容 subject title testing from 1...

發郵件的實現

做乙個,使用者註冊的時候,給他傳送您郵件,然後取得啟用碼,註冊成功 string email 目的地人的賬戶 string emailmsg 傳送的內容 public static void sendmail string email,string emailmsg throws addres ce...