exim4-config script automated?
我需要在多个服务器上设置exim4,但是我想知道是否可以创建一个脚本,自动完成安装过程,并用我的主机名在exim4上设置它?
sudo dpkg重新配置exim4配置
步骤1:顶部选项(Internet站点;邮件直接使用SMTP发送和接收
步骤2:主机名(默认)
步骤3:127.0.0.1;::1(默认)
步骤4:主机名(默认)
步骤5:主机名
第6步:主机名
第7步:没有
步骤8:mbox格式/var/mail/
第9步:没有
步骤10:根主机名
非常感谢您的帮助。谢谢!
- Linux shell脚本中处理输入确认的可能副本
Debian的正确解决方案是在运行dpkg-reconfigure之前用您的选择填充debconf数据库。详情请参阅man debconf-set-selections。https://www.debian-administration.org/article/394/automathing_new_debian_installations_with_preseeding有一个方法
- 值得注意的是,上面链接中的两条评论与exim相关。Problems preseeding exim where probably due to the fact that debconf gets it's answers from '/etc/exim4/update-exim4.conf.conf' (something like this also happens in 'locales'). In a script I'm using, I first replace the original 'update-exim4.conf.conf' before updating/installing the packages.和The preseed method isn't perfect. I had lots of trouble preseeding exim and eventually I replaced exim with postfix.。
当我遇到这个问题时,我用debconf集选择像这样做。
1 2 3 4 5 6
| debconf-set-selections <<CONF
exim4-config exim4/dc_other_hostnames string $hostnames
exim4-config exim4/dc_eximconfig_configtype select internet site; mail is sent and received directly using SMTP
exim4-config exim4/no_config boolean true
# rest of the secret sauce omitted...
CONF |
- 在已安装exim4的系统上使用debconf-get-selections | grep exim4以获取此类设置的列表。如果缺少debconf-get-selections可执行文件,则必须安装debconf-utils。