Hello, we are running Dovecot (2.3.4.1-5+deb10u6) with PostgreSQL passdb and userdb and for remote Postfix: auth_mechanisms = plain login inet_listener { address = 127.0.0.1 port = 12345 } It works perfectly. Now we would like to disable authentication for Postfix (SMTP), but allow it for Dovecot (IMAP & POP3). Something like "receive-only". Is there any way we can configure different passdb for mentioned inet_listener? Or is there any variable with "auth requetor name" we can use in SQL query to differentiate the result? Regards Miloslav
On 28/07/2021 09:12, Miloslav H?la wrote:> Now we would like to disable authentication for Postfix (SMTP), but > allow it for Dovecot (IMAP & POP3). Something like "receive-only". > > Is there any way we can configure different passdb for mentioned > inet_listener? > > Or is there any variable with "auth requetor name" we can use in SQL > query to differentiate the result?%s for service https://doc.dovecot.org/configuration_manual/config_file/config_variables/ Something like: password_query = "SELECT password, allow_nets, '*:storage=' || quota || 'M' AS userdb_quota_rule FROM mailbox WHERE username = '%n' AND domain = '%d' AND %Ls = true;" Note the "AND %Ls = true". The 'L' is for lower case. Add boolean columns for the services to your database.
On 28/07/2021 09:12, Miloslav H?la wrote:> Now we would like to disable authentication for Postfix (SMTP), but > allow it for Dovecot (IMAP & POP3). Something like "receive-only". > > Is there any way we can configure different passdb for mentioned > inet_listener? > > Or is there any variable with "auth requetor name" we can use in SQL > query to differentiate the result?%s for service https://doc.dovecot.org/configuration_manual/config_file/config_variables/ Something like: password_query = "SELECT password, allow_nets, '*:storage=' || quota || 'M' AS userdb_quota_rule FROM mailbox WHERE username = '%n' AND domain = '%d' AND %Ls = true;" Note the "AND %Ls = true". The 'L' is for lower case. Add boolean columns for the services to your database.
Dne 28.07.2021 v 11:24 James napsal(a):> On 28/07/2021 09:12, Miloslav H?la wrote: >> Now we would like to disable authentication for Postfix (SMTP), but >> allow it for Dovecot (IMAP & POP3). Something like "receive-only". >> >> Is there any way we can configure different passdb for mentioned >> inet_listener? >> >> Or is there any variable with "auth requetor name" we can use in SQL >> query to differentiate the result? > > %s for service > > https://doc.dovecot.org/configuration_manual/config_file/config_variables/ > > > > Something like: > > password_query = "SELECT password, allow_nets, '*:storage=' || quota > || 'M' AS userdb_quota_rule FROM mailbox WHERE username = '%n' AND > domain = '%d' AND %Ls = true;" > > Note the "AND %Ls = true".? The 'L' is for lower case. > Add boolean columns for the services to your database. >Hi James, I somehow missed your reply. That's exactly what I need. Thank you! Miloslav