Jump to content
Froxlor Forum
  • 0

[note] Dovecot, Sieve and Froxlor - Authentication


adlerweb

Question

Since it took some time to get my dovecot working with sieve i post this note here so people using google/forum-search dont have to debug the whole thing again.

 

In previous versions (Syscp-Times for me) using server side mail filtering/sorting/... (sieve) and its remote management (managesieve) could easily be configured using the Dovecot-documentation. On my new server authentication on managesieve always failed:

 

Client:

NO "Authentication failed."

Server:

managesieve-login: Aborted login (auth failed, 1 attempts): user=<x@y.z>, method=PLAIN, rip=12.23.34.45, lip=54.43.32.21, TLS

 

This is related to froxlor's new dovecot<->sql-connection. The newer dovecot-sql.conf now checks if a User is allowed to use the tried protocol:

 

password_query = ? WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')"

 

so you have to allow managesieve - in my example for all users:

 

password_query = "SELECT username AS user, password_enc AS password, homedir AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('*:storage=', quota,'M') AS userdb_quota_rule, concat('maildir:', maildir) AS userdb_mail FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp')"

(0.9.16)

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Since I also had the problem of authentication on the SMTP server and the queries has been changed since 0.9.16, I replaced

 

 OR '%Ls' = 'smtp')

 

with

 

 OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')

 

in the line with

 

password_query = [...]

 

/etc/dovecot/dovecot-sql.conf.

 

 

So we have

 

password_query = SELECT username AS user, password_enc AS password, CONCAT(homedir, maildir) AS userdb_home, uid AS userdb_uid, gid AS userdb_gid, CONCAT('maildir:', homedir, maildir) AS userdb_mail, CONCAT('maildir:storage=', (quota*1024)) as userdb_quota FROM mail_users WHERE (username = '%u' OR email = '%u') AND ((imap = 1 AND '%Ls' = 'imap') OR (pop3 = 1 AND '%Ls' = 'pop3') OR '%Ls' = 'smtp' OR '%Ls' = 'sieve')

 

(Version 0.9.23)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...