Skip to content

add mailbox uid cdb endpoint

mh requested to merge mailboxuid-cdb into master

This exposes a simple cdb endpoint that delivers email -> uid lookups per host.

This is required for immerda/ibox/puppet-modules!5 (merged) where I would like to try out using local cdb files (as a cache) where possible and fallback to iapi lookups only if not there.

While working on integrating exim lookups into the iapi, I realized that a simple email delivery would likely trigger around ~20 iapi lookups for delivery for a single email.

My fear is that in the end, we will knock out the iAPI through mail delivery, when switching over and for that I would like to be prepared to have ways to do some/most(?) lookups in an alternative way, that should be suitable for most lookups. In the end we won't do much less efficient sql calls, but we have a whole tls+json overhead and a less performant backend than PG.

Such fallback lookups can be quite hard and we will need to carefully decide which ones to take. We even might have places where we really want to lookup in iapi. But I think we also have quite some places where it can be done as outlined in immerda/ibox/puppet-modules!5 (merged) and thus might be able to reduce the amount of calls down to ~5. Just a wild guess. E.g. sometimes per router we do a lookup and then another 2 per transport.

On the other hand, this might also be a way to finally address that lag of 5min. after registering a domain in the mailsystem until maildelivery works for that domain. as we could just do it the same way for there.

Alternatively, we could do certain lookups differently. But we'll see.

The example now being proposed to try out is a simple one: We can safely assume, that likely the uid of a mailbox user never changes and thus unless the user has just been created or migrated to a certain host, it will always be able to deliver it from the cdb.

If the user just got deleted: should we immediately drop emails or can it also wait 5 min. ?

Edited by mh

Merge request reports