【问题标题】:exim4-config script automated?exim4-config 脚本自动化?
【发布时间】:2014-11-21 05:15:30
【问题描述】:

我需要在多台服务器上设置 exim4,但是我想知道是否可以创建一个脚本来自动完成安装过程并使用我的主机名在 exim4 上设置它?

sudo dpkg-reconfigure exim4-config

第 1 步:顶部选项(Internet 站点;使用 SMTP 直接发送和接收邮件

第 2 步:主机名(默认)

第 3 步:127.0.0.1; ::1(默认)

第 4 步:主机名(默认)

第 5 步:主机名

第 6 步:主机名

第 7 步:否

第 8 步:/var/mail/ 中的 mbox 格式

第 9 步:否

第 10 步:根主机名

非常感谢任何帮助。 谢谢!

【问题讨论】:

标签: bash exim exim4


【解决方案1】:

Debian 的正确解决方案是在运行 dpkg-reconfigure 之前使用您的选择填充 Debconf 数据库。阅读man debconf-set-selections了解详情。 https://www.debian-administration.org/article/394/Automating_new_Debian_installations_with_preseeding有一个howto

【讨论】:

  • 值得注意的是上面链接中的两个 cmets 专门与 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.
【解决方案2】:

当我遇到这个问题时,我使用 debconf-set-selections 这样做了

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
  • 这在我的带有 Exim4 v4.92 的 Ubuntu 服务器上不起作用。欲了解更多信息:stackoverflow.com/a/61518823/198219
【解决方案3】:

您需要使用本地值创建/etc/exim4/update-exim4.conf.conf,然后按照@Dogsbody 的建议以非交互方式安装 Exim4:

export DEBIAN_FRONTEND=noninteractive
apt-get install -y exim4-daemon-light

如果你已经安装了Exim4,你需要编辑配置文件,然后按照here的建议执行以下命令:

dpkg-reconfigure -fnoninteractive exim4-config

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-16
    • 2016-12-02
    • 2013-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多