> ## Content Index
> Fetch the complete content index at: https://george.bike/llms.txt
> Use this file to discover other available public pages before exploring further.

# Use Letsencrypt certs on Postfix and Dovecot with selinux
- URL: https://george.bike/use-letsencrypt-certs-on-postfix-and-dovecot-with-selinux/
- Published: 2021-04-07T20:54:00.000Z
- Updated: 2021-04-07T20:54:00.000Z
- Author: George Carey
- Tags: #Import 2026-11-24 15:41

I have my certificates mounted via NFS on all hosts so that it gives me easy access to them for services that use SSL. The workaround I was using for mail services was to mount like this (from /etc/fstab):

`10.20.40.13:/mnt/tank/unix/web/letsencrypt /etc/letsencrypt nfs ro,context="system_u:object_r:postfix_etc_t:s0"`

That solves the issue of context for selinux so that postfix can read the files. The issue is that I can't read those same files with dovecot. I had a cron going to copy the certs to /etc/dovecot dir but that was a bit of a hack. So today I dug into the issue and fixed it.

The solution is to add to the current selinux policy so that dovecot can essentially read postfix's files. I suppose it is slightly less secure that way but since they are both part of the mail system I think it's an acceptable risk.

So here is the TE file that I eventually ended up with that allowed dovecot to start successfully. 

``

``

``

module dovecot\_read\_postfix 1.0;

``

require {  
type postfix\_etc\_t;  
type init\_t;  
type unconfined\_service\_t;  
type dovecot\_t;  
class process siginh;  
class filesystem remount;  
class dir search;  
class file { open read };  
class lnk\_file read;  
}

``

#============= dovecot\_t ==============  
allow dovecot\_t postfix\_etc\_t:dir search;  
allow dovecot\_t postfix\_etc\_t:file { open read};  
allow dovecot\_t postfix\_etc\_t:lnk\_file read;  
#============= init\_t ==============  
allow init\_t postfix\_etc\_t:filesystem remount;  
allow init\_t unconfined\_service\_t:process siginh;

``

``

``

[Original post](https://george.bike/?p=86&more=1) blogged on [b2evolution](http://b2evolution.net/?ref=george.bike).