sendmail:如何在 ubuntu 上配置 sendmail? [英] sendmail: how to configure sendmail on ubuntu?
问题描述
当我在 ubuntu 上搜索配置 sendmail 时,我没有得到任何明确的答案,他们每个人都假设我知道他们在说什么,
When I searched for configuring sendmail on ubuntu I din't get any clear answer, each of them assume I know what they are talking about,
我只想要基本的配置来启用电子邮件发送,基本上我将它与谷歌应用引擎一起使用来启用从开发服务器发送邮件.
I just want basic configuration to enable email sending, basically I will use it with google app engine to enable mail sending from dev server.
我已经这样做了:
sudo apt-get install sendmail
然后
sudo sendmailconfig
但我不知道最后一个实际上做了什么.
but I don't know what the last one actually did.
推荐答案
当您输入 sudo sendmailconfig
时,应该会提示您配置 sendmail.
When you typed in sudo sendmailconfig
, you should have been prompted to configure sendmail.
作为参考,在配置过程中更新的文件位于以下位置(如果您想手动更新它们):
For reference, the files that are updated during configuration are located at the following (in case you want to update them manually):
/etc/mail/sendmail.conf
/etc/cron.d/sendmail
/etc/mail/sendmail.mc
您可以通过在命令行中键入以下内容来测试 sendmail 是否已正确配置和设置:
You can test sendmail to see if it is properly configured and setup by typing the following into the command line:
$ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com
以下将允许您将 smtp 中继添加到 sendmail:
The following will allow you to add smtp relay to sendmail:
#Change to your mail config directory:
cd /etc/mail
#Make a auth subdirectory
mkdir auth
chmod 700 auth
#Create a file with your auth information to the smtp server
cd auth
touch client-info
#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"
#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..
将以下行添加到 sendmail.mc,但在 MAILERDEFINITIONS
之前.确保更新您的 smtp 服务器.
Add the following lines to sendmail.mc, but before the MAILERDEFINITIONS
. Make sure you update your smtp server.
define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl
调用创建 sendmail.cf(或者运行 make -C/etc/mail
):
Invoke creation sendmail.cf (alternatively run make -C /etc/mail
):
m4 sendmail.mc > sendmail.cf
重新启动 sendmail 守护进程:
Restart the sendmail daemon:
service sendmail restart
这篇关于sendmail:如何在 ubuntu 上配置 sendmail?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!