Subject: Re: Auth variables unknown variable -- about to go crazy
From: efeizbudak <[email-masked]>
To: Aki Tuomi <[email-masked]>
Date: Tue, 28 Feb 2023 06:51:34 -0500

On 23/02/28 08:50AM, Aki Tuomi wrote:
> 
> > On 27/02/2023 22:00 EET efeizbudak <[email-masked]> wrote:
> > 
> >  
> > Hi everyone,
> > 
> > I'm trying to configure my email server to encrypt mails on a per user
> > basis. I have the following in my conf:
> > 
> > mail_plugins = $mail_plugins mail_crypt
> > mail_attribute_dict = file:%h/Mail/dovecot-attributes
> > 
> > plugin {
> >         mail_crypt_curve = secp521r1
> >         mail_crypt_save_version = 2
> >         mail_crypt_require_encrypted_user_key = yes
> >         mail_crypt_private_password = %N{password}
> > }
> > 
> > And I'm getting %password unknown variable error. I use pam to store the
> > passwords. All I want is to be able to hash the user password and use
> > that to encrypt/decrypt the keys. Can someone _please_ help me?
> > 
> > -- 
> > All the best,
> > Efe
> > 
> 
> Hi!
> 
> This does not work because %password is not passed to protocols by default. For security reasons.
> 
> Try adding in your passdb (not userdb):
> 
> override_fields = userdb_mail_crypt_private_password=%N{password}
> 
> PS. there are several threads about setting up mail crypt with user password, you might want to look at them.
> 
> Aki

Thank you so much! This works great. You mention that %password is not
passed to protocols by default for security reasons. Will doing this
cause a security issue?

Thanks again!

-- 
All the best,
Efe

The funny quote of this email is trivial and left as an exercise.