When we send a email by SMTP protocol on ubuntu, we can configure our default informations. The system will check two path to find the default information about your email.
The first is system configuration file /etc/msmtprc;
the second is user configuration file /home/xxx/.msmtprc(xxx is user name).
So we can configure the one of them theoretically, but now I only configured the second file .
For example, we can creat a new file .msmtprc in the folder /home/xxx/ configuring the 163 email as the default email, we can refer to the configuration file:
# Set default values for all following accounts.
defaults
# Create a folder /home/xxx/.var/log/msmtp/ to save the file .log
logfile /home/xxx/.var/log/msmtp/msmtp.log
# The SMTP server of the provider.
account 163
# Set SMTP service address
host smtp.163.com
# Set the sending email
from xxx@163.com
auth login
# set the login_account of email
user xxx@163.com
# set the login_password of email
password user_password
# Set a default account
account default : 163
we can check the configuration by the command :
echo -e “Subject: Test Mail\r\n\r\nThis is a test mail” |msmtp -debug -t xxx@xxx.
NOTE:
- “xxx@xxx” need to be your other email ,and receive the test eamil.
- all of operation is in user mode.
NOTE:
- If we check the configuration , maybe meet an issue :
554 DT:SPM 163 smtp11,D8CowAB3ETB47DddflWCAg–.47523S2 1563946104,please see http://mail.163.com/help/help_spam_16.htm?ip=124.115.231.150&hostid=smtp11&time=1563946104
we can open the link, get the following information:
“554 DT:SPM 发送的邮件内容包含了未被许可的信息,或被系统识别为垃圾邮件。请检查是否有用户发送病毒或者垃圾邮件”.
So maybe you need to modify your email content.