FreeBSD的sendmail

 -bash-3.2#主机名 
 name.foo.bar.domain.tld
 -bash-3.2# 

每当我发送一封电子邮件,它留下作为[email protected],我需要有sendmail将其更改为[email protected]

我怎么做?

假设你使用的是默认安装的FreeBSD sendmail,你不应该直接编辑.cf文件。 它们是从/ etc / mail目录中的.mc文件生成的。

在/ etc / mail中有一个Makefile会从.mc文件生成.cf文件

将以下行添加到.mc文件以设置默认域:

define(`confDOMAIN_NAME',`domain.tld') 

如果你真的想直接编辑.cf文件,我相信正确的路线是:

 Djdomain.tld 

(不包括$ w)

更新:如何使用make重新生成.cf

 cd /etc/mail make #the first time you do this it will copy freebsd.mc and freebsd.submit.mc to ${HOSTNAME}.mc and ${HOSTNAME}.submit.mc then generate the .cf files make install # will copy ${HOSTNAME}.cf and ${HOSTNAME}.submit.cf to sendmail.cf and sendmail.submit.cf make restart # will restart your sendmail processes 

你必须是根。

 # my official domain name # ... define this only if sendmail cannot automatically determine your domain #Dj$w.Foo.COM 

应该在/etc/mail/sendmail.cf中