<div dir="ltr"><div>Hi,</div><div><br></div><div>I am just finishing my first personal email server build so I would really appreciate it if the response to my question can be spelled out in enough detail since I am struggling to fill in the gaps to get this working. I have scoured Google and the archives but I am not fully understanding the implementation for my setup.<br></div><div><br></div><div>I am looking for a solution to encrypt email using a mechanism that increases the difficulty of decrypting my email. For example, having a plain-text decryption key on disk would not be suitable.  From what I understand mail-crypt supports using the user password supplied via IMAP to decrypt email.  Can someone explain how this technically works? i.e. is the private key encrypted in disk and then unlocked using the supplied password?</div><div><br></div><div>Can someone also please step me through <br></div><div>1. how I would ammen the configuration below in order to set this up. <br></div><div>2. the command required to generate keys</div><div>3. Any help in understanding the limitations such as password changes or caveats around generating keys securely<br></div><div><br></div><div>I am happy to take my notes and update the wiki to help others.</div><div><br></div><div>Thanks, Adam</div><div><br></div># 2.3.8 (9df20d2db): /etc/dovecot/dovecot.conf<br># Pigeonhole version 0.5.8 (b7b03ba2)<br># OS: Linux 4.18.0-240.1.1.el8_3.x86_64 x86_64 Red Hat Enterprise Linux release 8.3 (Ootpa) <br># Hostname: <a href="http://mailserver.example.com">mailserver.example.com</a><br>debug_log_path = /var/log/dovecot-debug.log<br>info_log_path = /var/log/dovecot-info.log<br>lda_mailbox_autocreate = yes<br>log_path = /var/log/dovecot.log<br>log_timestamp = "%Y-%m-%d %H:%M:%S "<br>mail_home = /var/mail/%d/%n/<br>mail_location = maildir:~/mail/<br>mail_privileged_group = mail<br>managesieve_notify_capability = mailto<br>managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext<br>namespace inbox {<br>  inbox = yes<br>  location = <br>  mailbox Archive {<br>    auto = create<br>    special_use = \Archive<br>  }<br>  mailbox Drafts {<br>    auto = create<br>    special_use = \Drafts<br>  }<br>  mailbox Junk {<br>    auto = create<br>    special_use = \Junk<br>  }<br>  mailbox Sent {<br>    special_use = \Sent<br>  }<br>  mailbox "Sent Messages" {<br>    special_use = \Sent<br>  }<br>  mailbox Trash {<br>    auto = create<br>    special_use = \Trash<br>  }<br>  prefix = <br>}<br>passdb {<br>  args = scheme=CRYPT username_format=%n@%d /etc/dovecot/passdb<br>  driver = passwd-file<br>}<br>plugin {<br>  recipient_delimiter = -<br>  sieve = ~/.dovecot.sieve<br>  sieve_dir = ~/sieve<br>  sieve_global_dir = /etc/sieve/global/<br>}<br>protocols = imap lmtp<br>service auth {<br>  unix_listener /var/spool/postfix/private/auth {<br>    group = postfix<br>    mode = 0600<br>    user = postfix<br>  }<br>}<br>service imap-login {<br>  inet_listener imap {<br>    address = *<br>    port = 143<br>    ssl = yes<br>  }<br>}<br>service lmtp {<br>  unix_listener /var/spool/postfix/private/dovecot-lmtp {<br>    group = postfix<br>    mode = 0600<br>    user = postfix<br>  }<br>}<br>ssl_cert = </etc/letsencrypt/live/<a href="http://mail.example.com/fullchain.pem">mail.example.com/fullchain.pem</a><br>ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384: DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA: ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256: DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384: AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH: !EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA<br>ssl_dh = # hidden, use -P to show it<br>ssl_key = # hidden, use -P to show it<br>ssl_min_protocol = TLSv1.2<br>ssl_prefer_server_ciphers = yes<br>userdb {<br>  args = uid=vmail gid=vmail home=/var/mail/%d/%n<br>  driver = static<br>}<br>protocol lmtp {<br>  mail_fsync = optimized<br>  mail_plugins = " sieve"<br>  recipient_delimiter = -<br>}<br></div>