email_server: Don't use user IDs when performing lookups

- Typical mail systems are configured to work on usernames or virtual usernames.
UIDs/GIDs are only needed at the final moment when delivering mails to user
inboxes that need to have proper UID/GID set.

- This makes it easy for dovecot to simply use PAM authentication instead of
having to use LDAP.

- Trying to hide UID from email headers is no longer necessary. Received: header
is important for debugging mail delivery across the chain. Don't miss out.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2021-11-03 19:40:19 -04:00
1 parent fb47f35e87
commit d0cf01fb29
8 files changed
+33 -116

No files matched your search

@@ -12,15 +12,6 @@ passdb {
result_success = return-ok
}
userdb {
# UID number lookup (10001@example.com)
driver = ldap
args = /etc/dovecot/freedombox-ldap-userdb-uid.conf.ext
result_failure = continue
result_internalfail = return-fail
result_success = return-ok
}
userdb {
driver = ldap
args = /etc/dovecot/freedombox-ldap-userdb.conf.ext
@@ -1,10 +1,6 @@
# Direct edits to this file will be lost!
# Manage your settings on Plinth <https://localhost/plinth/apps/email_server>
# Privacy: remove the recipient's UID number from email headers
lmtp_add_received_header = no
lmtp_hdr_delivery_address = original
protocol lmtp {
mail_plugins = $mail_plugins sieve
}
@@ -1,22 +0,0 @@
# Direct edits to this file will be lost!
# Manage your settings on Plinth https://localhost/plinth/apps/email_server
uris = ldap://127.0.0.1
base = dc=thisbox
user_attrs = \
=home=%{ldap:homeDirectory}, \
=uid=%{ldap:uidNumber}, \
=gid=%{ldap:gidNumber}, \
=user=%{ldap:uid}, \
=mail=maildir:~/Maildir:LAYOUT=index
# Support user lookup by UID number
user_filter = \
(&(objectClass=posixAccount)(!(uidNumber=0))(uidNumber=%n))
# doveadm -A
iterate_attrs = =user=%{ldap:uid}
iterate_filter = (objectClass=posixAccount)
@@ -1,10 +0,0 @@
# This file is managed by FreedomBox
# Map user name to UID number
bind = no
server_host = ldap://127.0.0.1
search_base = dc=thisbox
query_filter = (&(objectClass=posixAccount)(uid=%s))
result_attribute = uidNumber
result_format = %s@localhost