今天,在openSUSE Leap 15.0上配置dovecot的时候,出现了这个错误:
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 7: ssl_cert: /etc/{some path} Can not open file: Permission denied
以下是我的解决办法
环境
我的SSL证书是由certbot颁发的,在/etc/certbot/...
下
错误现象
systemed开启dovecot时,报错
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 7: ssl_cert: /etc/{some path} Can not open file: Permission denied
解决方案
在profiles/apparmor.d/abstractions/ssl_certs
中对应位置添加
/etc/certbot/archive/*/cert*.pem r,
/etc/certbot/archive/*/chain*.pem r,
/etc/certbot/archive/*/fullchain*.pem r,
在profiles/apparmor.d/abstractions/ssl_keys
对应位置添加
/etc/certbot/archive/*/privkey*.pem r,
详细可参考
https://gitlab.com/iochen/apparmor/commit/3016ffb3367e03ee2129401472d44d5eea4c1fb2
https://gitlab.com/iochen/apparmor/commit/4d275bab696f58e1431d26da642e82adbe092526
后续
已在 apparmor官方仓库 中提出 PR