一、出现cannot send message: Process exited with a non-zero status错误
查看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 directory
方法:
sudo dpkg-reconfigure postfix
配置选择:Internet Site=>System mail name:保持默认(如:ubuntu)=>其他的都选默认的,配置完成后就存在/etc/postfix/main.cf文件了
然后就可以使用mail命令了
二、mail命令的使用
#将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(邮件内容部分) #发送图片
目前没找到合适的发送图片的方法,如果有看到发送图片邮件方法的还请留言
三、ssh localhost
出错:ssh_exchange_identification: read: Connection reset by peer
sudo vi /etc/hosts.deny#注释掉all sudo vi /etc/hosts.allow