zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Exim SMTP authentication

April 6, 2011 by Igor Drobot Leave a Comment

Some years ago a set up my mail system with SMTP authentication, the credentials for sending and receiving E-Mails could be different. I had a special list for SMTP auth with username:password.

I think it is too secure and it makes me too much work to document all this passwords

You can access the Courier authdaemon from an Exim authenticator. That means you have only one password.

Cerate a new auth acl in:

1
vim /etc/exim4/conf.d/auth/10_courier_auth

vim /etc/exim4/conf.d/auth/10_courier_auth

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
AUTHDAEMON_SOCKET = /var/run/courier/authdaemon/socket
 
# LOGIN authenticator
login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = Username:: : Password::
  server_condition = ${extract {address} {${readsocket{AUTHDAEMON_SOCKET} \
    {AUTH ${strlen:exim\nlogin\n$1\n$2\n}\nexim\nlogin\n$1\n$2\n} }} {yes} fail}
  server_set_id = $1
 
# PLAIN authenticator
plain:
  driver = plaintext
  public_name = PLAIN
  server_prompts = :
  server_condition = ${extract {address} {${readsocket{AUTHDAEMON_SOCKET} \
    {AUTH ${strlen:exim\nlogin\n$2\n$3\n}\nexim\nlogin\n$2\n$3\n} }} {yes} fail}
  server_set_id = $2

AUTHDAEMON_SOCKET = /var/run/courier/authdaemon/socket # LOGIN authenticator login: driver = plaintext public_name = LOGIN server_prompts = Username:: : Password:: server_condition = ${extract {address} {${readsocket{AUTHDAEMON_SOCKET} \ {AUTH ${strlen:exim\nlogin\n$1\n$2\n}\nexim\nlogin\n$1\n$2\n} }} {yes} fail} server_set_id = $1 # PLAIN authenticator plain: driver = plaintext public_name = PLAIN server_prompts = : server_condition = ${extract {address} {${readsocket{AUTHDAEMON_SOCKET} \ {AUTH ${strlen:exim\nlogin\n$2\n$3\n}\nexim\nlogin\n$2\n$3\n} }} {yes} fail} server_set_id = $2

If you try to send a mail you will see a error in your exim mainlog:

1
2011-04-06 11:18:42 plain authenticator failed for hexa.debianuser.org ([192.168.3.118]) [46.4.33.19]: 435 Unable to authenticate at present (set_id=my-username): failed to connect to socket /var/run/courier/authdaemon/socket: Permission denied

2011-04-06 11:18:42 plain authenticator failed for hexa.debianuser.org ([192.168.3.118]) [46.4.33.19]: 435 Unable to authenticate at present (set_id=my-username): failed to connect to socket /var/run/courier/authdaemon/socket: Permission denied

Fix it by adding exim to daemon group:

1
usermod -a -G daemon Debian-exim

usermod -a -G daemon Debian-exim

This idea comes from debian-wiki

Filed Under: Linux Tagged With: Debian, Exim4, exim4 auth, SMTP, SMTP authentication

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

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

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok