Allow authentication from webmail directly, fixes #308

master
kaiyou 7 years ago
parent 28eff398d1
commit 652ca769dc

@ -3,7 +3,7 @@ connect = /data/main.db
# Return the user hashed password # Return the user hashed password
password_query = \ password_query = \
SELECT NULL as password, 'Y' as nopassword, '{{ FRONT_ADDRESS }}' as allow_nets \ SELECT NULL as password, 'Y' as nopassword, '{{ FRONT_ADDRESS }}{% if WEBMAIL_ADDRESS %},{{ WEBMAIL_ADDRESS }}{% endif %}' as allow_nets \
FROM user \ FROM user \
WHERE user.email = '%u' WHERE user.email = '%u'

@ -4,11 +4,13 @@ import jinja2
import os import os
import socket import socket
import glob import glob
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ)) convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
# Actual startup script # Actual startup script
os.environ["FRONT_ADDRESS"] = socket.gethostbyname("front") os.environ["FRONT_ADDRESS"] = socket.gethostbyname("front")
if os.environ["WEBMAIL"] != "none":
os.environ["WEBMAIL_ADDRESS"] = socket.gethostbyname("webmail")
for dovecot_file in glob.glob("/conf/*"): for dovecot_file in glob.glob("/conf/*"):
convert(dovecot_file, os.path.join("/etc/dovecot", os.path.basename(dovecot_file))) convert(dovecot_file, os.path.join("/etc/dovecot", os.path.basename(dovecot_file)))

@ -6,7 +6,7 @@ sieve_use = On
sieve_allow_raw = Off sieve_allow_raw = Off
sieve_host = "imap" sieve_host = "imap"
sieve_port = 4190 sieve_port = 4190
sieve_secure = "TLS" sieve_secure = "None"
smtp_host = "front" smtp_host = "front"
smtp_port = 10025 smtp_port = 10025
smtp_secure = "None" smtp_secure = "None"

@ -26,7 +26,7 @@ $config['smtp_pass'] = '%p';
// Sieve script management // Sieve script management
$config['managesieve_host'] = 'imap'; $config['managesieve_host'] = 'imap';
$config['managesieve_usetls'] = true; $config['managesieve_usetls'] = false;
// We access the IMAP and SMTP servers locally with internal names, SSL // We access the IMAP and SMTP servers locally with internal names, SSL
// will obviously fail but this sounds better than allowing insecure login // will obviously fail but this sounds better than allowing insecure login

Loading…
Cancel
Save