Это старая версия документа.


Exim4

Exim4 это другой агент передачи сообщений (MTA), разработанный в университете Кембриджа для использования на UNIX системах, подключенных к интернету. Exim может быть установлен вместо sendmail, хотя настройки exim сильно отличаются от настроек sendmail.

Установка

Для установки exim4 выполните следующую команду:

sudo apt-get install exim4

Настройка

Для настройки Exim4 выполните следующую команду:

sudo dpkg-reconfigure exim4-config

Появится пользовательский интерфейс. Этот интерфейс позволит вам настроить множество параметров. Например, в Exim4 файлы настроек разделены между различными файлами. Если вы решите объединить в один файл, вы можете настроить это в данном пользовательском интерфейсе.

Все параметры, которые вы настроите в пользовательском интерфейсе будут сохранены в файле /etc/exim4/update-exim4.conf. Если вы захотите что-то перенастроить, или перезапустите мастера настройки или вручную поправьте данный файл любым редактором. После настройки вам потребуется выполнить следующую команду для создания главного файла настроек:

sudo update-exim4.conf

Главный файл настроек будет создан и сохранен в /var/lib/exim4/config.autogenerated.

В любом случае вам не следует редактировать главный файл настроек /var/lib/exim4/config.autogenerated вручную. Он обновляется автоматически каждый раз по команде update-exim4.conf

Вы можете воспользоваться следующей командой для запуска сервиса Exim4:

sudo /etc/init.d/exim4 start

Аутентификация SMTP

This section covers configuring Exim4 to use SMTP-AUTH with TLS and SASL.

The first step is to create a certificate for use with TLS. Enter the following into a terminal prompt:

sudo /usr/share/doc/exim4-base/examples/exim-gencert

Now Exim4 needs to be configured for TLS by editing /etc/exim4/conf.d/main/03_exim4-config_tlsoptions add the following:

MAIN_TLS_ENABLE = yes

Next you need to configure Exim4 to use the saslauthd for authentication. Edit /etc/exim4/conf.d/auth/30_exim4-config_examples and uncomment the plain_saslauthd_server and login_saslauthd_server sections:

plain_saslauthd_server:

 driver = plaintext
 public_name = PLAIN
 server_condition = ${if saslauthd{{$auth2}{$auth3}}{1}{0}}
 server_set_id = $auth2
 server_prompts = :
 .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
 server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
 .endif

# login_saslauthd_server:

 driver = plaintext
 public_name = LOGIN
 server_prompts = "Username:: : Password::"
 # don't send system passwords over unencrypted connections
 server_condition = ${if saslauthd{{$auth1}{$auth2}}{1}{0}}
 server_set_id = $auth1
 .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
 server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
 .endif

Additionally, in order for outside mail client to be able to connect to new exim server, new user needs to be added into exim by using the following commands.

sudo /usr/share/doc/exim4/examples/exim-adduser

Users should protect the new exim password files with the following commands.

sudo chown root:Debian-exim /etc/exim4/passwd sudo chmod 640 /etc/exim4/passwd

Finally, update the Exim4 configuration and restart the service:

sudo update-exim4.conf sudo /etc/init.d/exim4 restart

Настройка SASL

This section provides details on configuring the saslauthd to provide authentication for Exim4.

The first step is to install the sasl2-bin package. From a terminal prompt enter the following:

sudo apt-get install sasl2-bin

To configure saslauthd edit the /etc/default/saslauthd configuration file and set START=no to:

START=yes

Next the Debian-exim user needs to be part of the sasl group in order for Exim4 to use the saslauthd service:

sudo adduser Debian-exim sasl

Now start the saslauthd service:

sudo /etc/init.d/saslauthd start

Exim4 is now configured with SMTP-AUTH using TLS and SASL authentication.

Ссылки

  See exim.org for more information.
  There is also an Exim4 Book available.
  Another resource is the Exim4 Ubuntu Wiki page.