sendmail:如何在ubuntu上配置sendmail?

前端之家收集整理的这篇文章主要介绍了sendmail:如何在ubuntu上配置sendmail?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当我在ubuntu上搜索配置sendmail时,我没有得到任何明确的答案,他们都假设我知道他们在说什么,

我只想基本配置启用电子邮件发送,基本上我将使用它与谷歌应用程序引擎启用从服务器的邮件发送。

我已经这样做:

  1. sudo apt-get install sendmail

然后

  1. sudo sendmailconfig

但我不知道最后一个实际上做了什么。

当您在sudo sendmailconfig中键入时,应该已经提示您配置sendmail。

作为参考,在配置期间更新的文件位于以下位置(如果您要手动更新它们):

  1. /etc/mail/sendmail.conf
  2. /etc/cron.d/sendmail
  3. /etc/mail/sendmail.mc

您可以通过在命令行中键入以下内容来测试sendmail是否已正确配置和设置:

  1. $ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com

以下将允许您向sendmail添加smtp relay:

  1. #Change to your mail config directory:
  2. cd /etc/mail
  3.  
  4. #Make a auth subdirectory
  5. mkdir auth
  6. chmod 700 auth
  7.  
  8. #Create a file with your auth information to the smtp server
  9. cd auth
  10. touch client-info
  11.  
  12. #In the file,put the following,matching up to your smtp server:
  13. AuthInfo:your.isp.net "U:root" "I:user" "P:password"
  14.  
  15. #Generate the Authentication database,make both files readable only by root
  16. makemap hash client-info < client-info
  17. chmod 600 client-info
  18. cd ..
  19.  
  20. #Add the following lines to sendmail.mc. Make sure you update your smtp server
  21. define('SMART_HOST','your.isp.net')dnl
  22. define('confAUTH_MECHANISMS','EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
  23. FEATURE('authinfo','hash /etc/mail/auth/client-info')dnl
  24.  
  25. #Invoke creation sendmail.cf
  26. m4 sendmail.mc > sendmail.cf
  27.  
  28. #Restart the sendmail daemon
  29. service sendmail restart

猜你在找的Ubuntu相关文章