例えばIMAP4
#開ける
vim /etc/firewalld/services/imap4.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>IMAP4</short>
<description>The Internet Message Access Protocol version 4 (IMAP4) allows a local client to access email on
a remote server in a secure way. If you plan to provide a IMAP4 service (e.g. with dovecot), enable this option.</description>
<port protocol="tcp" port="143"/>
</service>
firewall-cmd --add-service=imap4 --zone=public --permanent
firewall-cmd --list-services --zone=public --permanent
firewall-cmd --reload
iptables -L -n | grep 143
#閉じる
rm /etc/firewalld/services/imap4.xml
firewall-cmd --remove-service=imap4 --zone=public --permanent
firewall-cmd --list-services --zone=public --permanent
firewall-cmd --reload
iptables -L -n | grep 143