exim4:enable_smtp-auth_with_pam
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exim4:enable_smtp-auth_with_pam [2016/11/07 14:19] – peter | exim4:enable_smtp-auth_with_pam [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 10: | Line 10: | ||
===== Configuring exim ===== | ===== Configuring exim ===== | ||
- | < | + | < |
tls_advertise_hosts = * | tls_advertise_hosts = * | ||
+ | </ | ||
+ | |||
+ | Make sure authentication is only enabled on an encrypted connection. | ||
+ | |||
+ | <file bash / | ||
auth_advertise_hosts = ${if def: | auth_advertise_hosts = ${if def: | ||
+ | </ | ||
+ | |||
+ | and | ||
+ | <file bash / | ||
begin authenticators | begin authenticators | ||
Line 29: | Line 38: | ||
</ | </ | ||
+ | Add or modify the following | ||
+ | |||
+ | <file bash / | ||
+ | begin authenticators | ||
+ | |||
+ | ######################################################################### | ||
+ | plain_server: | ||
+ | |||
+ | # This authenticator implements the PLAIN authentication mechanism | ||
+ | # (RFC2595). | ||
+ | # text, a user can only authenticate if the session is encrypted using | ||
+ | # TLS. The user name and password is first checked against | ||
+ | # / | ||
+ | # that order). | ||
+ | |||
+ | driver | ||
+ | public_name | ||
+ | server_advertise_condition = ${if eq{$tls_cipher}{}{false}{true}} | ||
+ | server_prompts | ||
+ | server_set_id | ||
+ | |||
+ | server_condition | ||
+ | ${if exists{CONFDIR/ | ||
+ | {${lookup{$auth2}lsearch{CONFDIR/ | ||
+ | {${if crypteq{$auth3}{\\\{md5\\\}${extract{1}{: | ||
+ | {true}{false} }}\ | ||
+ | {${if pam{$auth2: | ||
+ | {true}{false}} } }}\ | ||
+ | {${if pam{$auth2: | ||
+ | {true}{false}} }}" | ||
+ | |||
+ | ######################################################################### | ||
+ | login_server: | ||
+ | |||
+ | # This authenticator implements the LOGIN authentication mechanism. | ||
+ | # Since the password is transmitted essentially as clear text, a user | ||
+ | # can only authenticate if the session is encrypted using TLS. The | ||
+ | # user name and password is first checked against / | ||
+ | # then against the system database using PAM (in that order). | ||
+ | |||
+ | driver | ||
+ | public_name | ||
+ | server_advertise_condition = ${if eq{$tls_cipher}{}{false}{true}} | ||
+ | server_prompts | ||
+ | server_set_id | ||
+ | server_condition | ||
+ | ${if exists{CONFDIR/ | ||
+ | {${lookup{$1}lsearch{CONFDIR/ | ||
+ | {${if crypteq{$auth2}{\\\{md5\\\}${extract{1}{: | ||
+ | {true}{false} }}\ | ||
+ | {${if pam{$auth1: | ||
+ | {true}{false}} } }}\ | ||
+ | {${if pam{$auth1: | ||
+ | {true}{false}} }}" | ||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP caution> | ||
+ | **NOTE**: | ||
+ | </ | ||
===== PAM config ===== | ===== PAM config ===== | ||
Line 50: | Line 119: | ||
535 Incorrect authentication data (set_id=' | 535 Incorrect authentication data (set_id=' | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Configuring / | ||
+ | |||
+ | |||
+ | <file bash / | ||
+ | ######################################################################### | ||
+ | # / | ||
+ | ######################################################################### | ||
+ | |||
+ | # This file allows a user to authenticate a mail submission to the Exim | ||
+ | # MTA without using their system password (found in / | ||
+ | # | ||
+ | # Each line of this file should contain a " | ||
+ | # where the password is encrypted using MD5 and encoded as a hexadecimal | ||
+ | # string. | ||
+ | # / | ||
+ | # messages by using " | ||
+ | # | ||
+ | # You can use the following Perl command line to generate the password: | ||
+ | # | ||
+ | # perl -MDigest:: | ||
+ | # | ||
+ | # (replace " | ||
+ | |||
+ | #################### | ||
+ | # | ||
+ | #################### | ||
+ | |||
+ | root:*: | ||
+ | |||
+ | ################### | ||
+ | # Local users # | ||
+ | ################### | ||
+ | |||
+ | # | ||
+ | </ | ||
+ | |||
+ | The easiest way to generate a password is to use the Digest::MD5 package with Perl: | ||
+ | |||
+ | <code bash> | ||
+ | perl -MDigest:: | ||
+ | </ | ||
+ | |||
+ | Simply replace **password** with your password. | ||
+ | |||
+ | |||
+ | <WRAP notice> | ||
+ | **NOTE**: | ||
+ | </ | ||
+ | |||
exim4/enable_smtp-auth_with_pam.1478528368.txt.gz · Last modified: 2020/07/15 09:30 (external edit)