Thanks all for your help. In the solution I ended up going with I have an aliases table and a userbase for each domain, and a single passwd file for all domains. I have an accept rule for each domain that looks like the following:

accept from any \
       for domain "DOMAIN" alias <DOMAIN-alias> \
       userbase <DOMAIN-ubase> \
       deliver to mda \
"spamc --pipe-to /usr/lib/dovecot/dovecot-lda -d %{user.username}@DOMAIN"

With `DOMAIN` replaced with the domain for this particular rule.

My dovecot.conf looks like this:

mail_location = maildir:~/mail

passdb {
    driver = passwd-file
    args = scheme=sha512-crypt /etc/dovecot/passwd
}

userdb {
    driver = passwd-file
    args = /etc/dovecot/passwd
    default_fields = uid=vmail gid=vmail home=/var/vmail/%d/%n
}

----8<---------------

plugin {
    sieve = ~/.dovecot.sieve
    sieve_dir = ~/sieve
    sieve_before = /etc/dovecot/spam.sieve
}

protocol sieve {
    log_path = /var/log/dovecot/sieve.log
}


lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = no
protocol lda {
    mail_plugins = $mail_plugins sieve
    log_path = /var/log/dovecot/lda.log
}

service auth {
    unix_listener auth-userdb {
        mode = 0600
        user = vmail
        group = vmail
    }
}

service managesieve-login {
    inet_listener sieve {
        port = 4190
    }
}

----8<---------------

Josh Kunz

On 2/12/15 8:18 PM, 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


--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to