1、出現cannot send message: Process exited with a non-zero status錯誤linux
查看log文件:sudo cat /var/log/mail.err,發現存在以下問題:Sep 19 10:07:35 ubuntu postfix/sendmail[38195]: fatal: open /etc/postfix/main.cf: No such file or directoryubuntu
方法:bash
sudo dpkg-reconfigure postfix
配置選擇:Internet Site=>System mail name:保持默認(如:ubuntu)=>其餘的都選默認的,配置完成後就存在/etc/postfix/main.cf文件了ssh
而後就能夠使用mail命令了ide
2、mail命令的使用post
#將d3.csv文件內容發送給314104490,郵件主題是hello mail -s 'hello' 314104490@qq.com < d3.csv #在linux下使用mail命令發送附件:首先須要安裝uuencode軟件包,這個程序是對二進制文件進行編碼使其適合經過郵件進行發送 sudo apt-get install sharutils #uuencode 須要兩個參數,第一個是你要發送的文件,第二個是附件顯示的文件名 uuencode d3.csv D3.csv | mail -s 'This is 3D' 314104490@qq.com < d3.csv #將文件d3.csv以附件發送,附件名爲D3.csc,郵件內容爲d3.csv(郵件內容部分) #發送圖片
目前沒找到合適的發送圖片的方法,若是有看到發送圖片郵件方法的還請留言編碼
3、ssh localhostspa
出錯:ssh_exchange_identification: read: Connection reset by peercode
sudo vi /etc/hosts.deny#註釋掉all sudo vi /etc/hosts.allow