User Tools

Site Tools


doc:appunti:linux:sa:postfix_courier_authdaemon_debian_12

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:postfix_courier_authdaemon_debian_12 [2023/10/23 16:08] niccolodoc:appunti:linux:sa:postfix_courier_authdaemon_debian_12 [2024/02/26 10:13] (current) – [Moving the Courier Authdaemon socket into the Postfix chroot] niccolo
Line 1: Line 1:
-====== Postfix with Courier Authdaemon in Debian 12 ====== +====== Postfix with Courier Authdaemon in Debian 12 Bookworm ======
- +
-===== Configuring the Courier Authdaemon =====+
  
 We want to enable authentication on **virtual users** (i.e. using a login name which is not an Unix username), e.g. we want to use an email address as a login name. We want to enable authentication on **virtual users** (i.e. using a login name which is not an Unix username), e.g. we want to use an email address as a login name.
 +
 +We want the same authentication schema to work on both authenticated SMTP sumbission (sending mail via Postfix) and on POP3/IMAP (incoming mail via Courier daemons).
 +
 +===== Configuring the Courier Authdaemon =====
  
 Into the configuration file **/etc/courier/authdaemonrc** we add the module **authuserdb** to the **authmodulelist**, beside the standard Unix PAM (i.e. the ''passwd'' and ''shadow'' files ): Into the configuration file **/etc/courier/authdaemonrc** we add the module **authuserdb** to the **authmodulelist**, beside the standard Unix PAM (i.e. the ''passwd'' and ''shadow'' files ):
Line 64: Line 66:
 </code> </code>
  
-To enable the bind mount at bootstrap we create a **systemd mount service** creating the file **/etc/systemd/system/var-spool-postfix-var-run-courier-authdaemon.mount** with the following content:+To enable the bind mount at bootstrap we define a **systemd mount service** creating the file **/etc/systemd/system/var-spool-postfix-var-run-courier-authdaemon.mount** with the following content:
  
 <file> <file>
 [Unit] [Unit]
 Description=Mount Courier Authdaemon into Postfix chroot Description=Mount Courier Authdaemon into Postfix chroot
-Requires=courier-authdaemon.service +Wants=courier-authdaemon.service
-After=courier-authdaemon.service+
  
 [Mount] [Mount]
-What=/var/run/courier/authdaemon+What=/run/courier/authdaemon
 Where=/var/spool/postfix/var/run/courier/authdaemon Where=/var/spool/postfix/var/run/courier/authdaemon
 Type=bind Type=bind
Line 81: Line 82:
 WantedBy=postfix.service WantedBy=postfix.service
 </file> </file>
 +
 +**NOTICE**: The weak dependency ''Wants=courier-authdaemon.service'' is preferable than the stronger ones ''Requires='' and ''After=''. In Debian 12 the strong dependencies cause a Systemd ordering cycle problem, see **[[systemd_tmpfiles_problem]]**.
  
 This is a **[[https://www.freedesktop.org/software/systemd/man/systemd.mount.html|systemd mount unit]]**, we need to reload the systemd daemon and enable that unit for the next reboot: This is a **[[https://www.freedesktop.org/software/systemd/man/systemd.mount.html|systemd mount unit]]**, we need to reload the systemd daemon and enable that unit for the next reboot:
Line 95: Line 98:
 systemctl restart postfix systemctl restart postfix
 </code> </code>
 +
 +  * **[[https://www.freedesktop.org/software/systemd/man/latest/systemd.syntax.html|Systemd Syntax]]**
 +  * **[[https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html|Systemd Unit]]**
 +  * **[[https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html|Systemd Mount]]**
  
 ====== Spamassassin ====== ====== Spamassassin ======
 +
 +Install the **spamassassin** Debian package.
 +
 +The package provides two Systemd units: **spamd.service** and **spamassassin-maintenance.timer**; both should be enabled to have the daemon running and the rules updated once a day.
 +
 +To enable and start both, execute:
 +
 +<code>
 +systemctl enable --now spamassassin-maintenance.timer
 +systemctl enable spamassassin-maintenance.service
 +systemctl start spamassassin-maintenance.service
 +</code>
 +
 +Then you can check timer schedule with:
 +
 +<code>
 +systemctl list-timers --all
 +</code>
 +
 +The timer will call the **spamassassin-maint** which in turn will call the **sa-update** program to download the updated SpamAssassin rules and reload the spamd daemon.
 +
 +The SpamAssassin rules are saved into **/var/lib/spamassassin/**.
  
 ====== ClamAV ====== ====== ClamAV ======
 +
 +Install the Debian packages **clamav**, **clamav-daemon**, **clamdscan** and **clamav-freshclam**. Ensure that the Systemd units **clamav-daemon.service** and **clamav-freshclam.service** are enabled and started.
 +
 +The Freshclam program will update the database of signatures stored into **/var/lib/clamav/** and will log into **/var/log/clamav/freshclam.log**.
  
doc/appunti/linux/sa/postfix_courier_authdaemon_debian_12.1698070089.txt.gz · Last modified: 2023/10/23 16:08 by niccolo