SMTP Login Exim Config

Berikut cara untuk membuat validasi login SMTP menggunakan Exim.

exim.conf

tls_advertise_hosts = *
tls_certificate = /etc/pki/tls/certs/exim.pem
tls_privatekey = /etc/pki/tls/private/exim.pem
daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465



######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################

begin authenticators

plain:
  driver = plaintext
  public_name = PLAIN
  server_prompts = :
  server_set_id = $2
  server_condition = "\
    ${if exists{/etc/exim/passwd}\
      {${lookup{$2}lsearch{/etc/exim/passwd}\
        {${if crypteq{$3}{\\\{md5\\\}${extract{1}{:}{$value}{$value}fail}}\
          {true}{false} }}\
        {${if pam{$2:${sg{$3}{:}{::}} }\
          {true}{false}} } }}\
      {${if pam{$2:${sg{$3}{:}{::}} }\
          {true}{false} }} }"
  server_advertise_condition = ${if def:tls_cipher }
 
login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_set_id = $1
  server_condition = "\
    ${if exists{/etc/exim/passwd}\
      {${lookup{$1}lsearch{/etc/exim/passwd}\
        {${if crypteq{$2}{\\\{md5\\\}${extract{1}{:}{$value}{$value}fail}}\
          {true}{false} }}\
        {${if pam{$1:${sg{$2}{:}{::}} }\
          {true}{false}} } }}\
      {${if pam{$1:${sg{$2}{:}{::}} }\
        {true}{false}} }}"
  server_advertise_condition = ${if def:tls_cipher }

Kemudian buat file /etc/exim/passwd yang berisi username dan password dalam format seperti berikut:

# This file allows a user to authenticate a mail submission to the Exim
# MTA without using their system password (found in /etc/shadow).
#
# Each line of this file should contain a "user:password:comment" field,
# where the password is encrypted using MD5 and encoded as a hexadecimal
# string.  Please note that this format is NOT the same as is used by
# /etc/shadow!  You can disable a user from ever sending (authenticated)
# messages by using "*" as the password.
#
# You can use the following Perl command line to generate the password:
#
#  perl -MDigest::MD5=md5_hex -e 'print md5_hex($ARGV[0]),"\n"' password
#
# (replace "password" with your password, of course).
####################
#   System users   #
####################
 
root:*:
 
###################
#   Local users   #
###################
 
user1:09a2658fdbb387ad0758a22d95d23a35:
user2:8dad658a28f03720755bd29a2d953ba3:
xtrsyz:d9a2379dbbad0758a28f0526a35382d5:

Kemudian silakan login menggunakan Secured connection on port 465 using SSL

Facebook Comments

Leave a Reply

Your email address will not be published. Required fields are marked *