On 2015-02-12 20:18, Josh Kunz wrote:
> I'm trying to run an OpenSSMTPd + dovecot setup for two separate domains.
> I'd like to be able to assign passwords based on the user and the domain
> part of the address, and using actual email addresses as the user names
> helps with integrating with dovecot.
> 
> I can create a userbase table where the user field is a standard email
> address, but since OpenSMTPd is only matching against the userbase using the
> user part of the address the userbase alone doesn't work. I thought that
> using a virtual user map might work, but since the user names on the right
> hand side of the table are valid email addresses it triggers a circular
> lookup.
> 
> Is there any way I can users whose names are addresses?
> 
> Thanks,
> Josh Kunz
> 

Unless I misunderstood something (I'm not sure I haven't!) you'll want
something like this:

accept from any for <mydomains> virtual <myvirtuals> \
  userbase <myuserbase> deliver to lmtp "/var/dovecot/lmtp"

My virtuals table is something like:

    [email protected]    hugo_barrera.io

So myuserbase can be something like:

    hugo_barrera.io         7000:7000:/var/empty

User 7000 is vmail.
Dovecot's config then has dup'd entries:

    hugo_barrera.io:...
    [email protected]:...

The former is used by the LDA when delivering emails. The latter is used when
authenicating users via IMAP.

It's a bit nasty if using text-based backends, but it's actually quite scalable
if you end up using sql backends: a proper query can be written to unduplicate
the data, but keep the config as-is. This is an exercise left to the reader. ;)
[1].

Oh, and my credentials table actually has full emails:

    [email protected]    [email protected]:<password-goes-here>

No biggie there.

Good luck!

[1] I'm not being secretive, I actually haven't written those yet, but they're
quite trivial.

-- 
Hugo Osvaldo Barrera
A: Because we read from top to bottom, left to right.
Q: Why should I start my reply below the quoted text?

Attachment: pgpgnHJWay6xm.pgp
Description: PGP signature

Reply via email to