I am running Asterisk on Fedora 23 and am using the voicemail IMAP module to store voicemails to Gmail. When SELinux is in enforcing mode it prevents Asterisk from connecting to Gmail. Here is the error message from /var/log/audit/audit.log:
type=AVC msg=audit(1460344333.315:70807): avc: denied { name_connect } for pid=823 comm="asterisk" dest=993 scontext=system_u:system_r:asterisk_t:s0 tcontext=system_u:object_r:pop_port_t:s0 tclass=tcp_socket permissive=0
Because of this I have been forced to put SELinux in permissive mode. How can I fix SELinux to stop blocking Asterisk from making the outbound connection?