Micah Anderson
2011-Dec-07 18:02 UTC
[Dovecot] overriding userdb connection host for doveadm-user
I've got my users in a replicated database setup and dovecot configured with two connect lines in dovecot-sql.conf: connect = host=127.0.0.1 port=3306 dbname=users user=user password=pass connect = host=127.0.0.2 port=3306 dbname=users user=user password=pass this works really well to help balance the load. However, when a new user is created, the replication information sometimes has not made it to the slave database before my user creation process tries to send that new user an email about their new email account. If it hasn't and the email gets sent, then it bounces because postfix thinks the user doesn't exist yet. Replication usually happens within seconds, but could be delayed due to problems. I would like a way to see if the new user's information has been replicated yet before sending the email. I was thinking I could use 'doveadm user' to lookup the user, but I am not sure that I can specify one of the specific 'connect' lines in my configuration to check. Is there a way to override that configuration variable to do this test? I tried various incarnations of passing '-o connect=host='... but doveadm user would just ignore them. thanks for any suggestions! micah ps - yes, I can make my user creation process just 'sleep' for an arbitrary amount of time and by that time the replication should have occured, but that is a bit of a shot in the dark, and doesn't handle longer replication delays that could potentially happen. -- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20111207/e497cfcc/attachment-0004.bin>
Timo Sirainen
2011-Dec-08 04:22 UTC
[Dovecot] overriding userdb connection host for doveadm-user
On Wed, 2011-12-07 at 13:02 -0500, Micah Anderson wrote:> I've got my users in a replicated database setup and dovecot configured > with two connect lines in dovecot-sql.conf: > > connect = host=127.0.0.1 port=3306 dbname=users user=user password=pass > connect = host=127.0.0.2 port=3306 dbname=users user=user password=pass > > this works really well to help balance the load.If you actually have it like that, it should only be using 127.0.0.2, as the second connect setting overrides the first one.. The right way would have been: connect = host=127.0.0.1 host=127.0.0.2 port=...> I would like a way to see if the new user's information has been > replicated yet before sending the email. I was thinking I could use > 'doveadm user' to lookup the user, but I am not sure that I can specify > one of the specific 'connect' lines in my configuration to check. Is > there a way to override that configuration variable to do this test? I > tried various incarnations of passing '-o connect=host='... but doveadm > user would just ignore them.doveadm does the lookup via auth-userdb socket. You have two possibilities: a) Have doveadm use another auth-userdb socket that points to another dovecot installation with different configuration. b) Use a different userdb configuration for doveadm: protocol !doveadm { userdb { driver = sql args = /.../dovecot-sql.conf.ext } } protocol doveadm { userdb { driver = sql args = /.../dovecot-sql-slave.conf.ext } }
Seemingly Similar Threads
- userdb missing driver
- 'doveadm quota get' dictionary SQL query ignores specified '@domain' part of username. bad config or bug?
- iterate_query does not use userdb - mail_location not found
- Asterisk 1.4 and CDR
- userdb lookup not possible with only userdb prefetch