在debian中不能用exim4发送邮件

我使用aptitude install exim4

并使用dpkg-reconfigure exim4-config

这是我的/etc/exim4/update-exim4.conf.conf文件:

 dc_eximconfig_configtype='internet' dc_other_hostnames='midomain.com' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='true' dc_mailname_in_oh='true' dc_localdelivery='maildir_home' 

当我在shell中执行时: echo "This is a test." | mail -s Testing [email protected] echo "This is a test." | mail -s Testing [email protected]

它什么都不做。

/var/log/exim4/mainlog我可以看到以下错误:

 2012-08-04 13:05:30 1SxcAk-0001BT-61 <= root@ETC_MAILNAME U=root P=local S=494 2012-08-04 13:05:30 1SxcAk-0001BT-61 ** [email protected]: Unrouteable address 2012-08-04 13:05:30 1SxcAk-0001BV-Al Error while reading message with no usable sender address (R=1SxcAk-0001BT-61): at least one malformed recipient address: root@ETC_MAILNAME - malformed address: _MAILNAME may not follow root@ETC 2012-08-04 13:05:30 1SxcAk-0001BT-61 Process failed (1) when writing error message to root@ETC_MAILNAME (frozen) 

它看起来像文件/etc/mailname不存在。 这应该包含一个由您的主机应该被称为FQDN(完全合格的域名)组成的行。

如果您没有configuration正确的rDNSlogging的固定IP地址,我强烈build议您使用智能主机。 通常你的ISP提供一个你可以使用的中继服务器。

你需要运行:

 update-exim4.conf --keepcomments --output /etc/exim4/exim4.conf 

所以debconf会通过并填写所有这些值…

https://wiki.debian.org/Exim#Your_own_file