diff --git a/mail-server/networking.nix b/mail-server/networking.nix index b4397c0..bd8ccd2 100644 --- a/mail-server/networking.nix +++ b/mail-server/networking.nix @@ -14,13 +14,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see -{ domain, host_prefix }: +{ domain, host_prefix, enable_imap, enable_pop3 }: { hostName = "${host_prefix}.${domain}"; firewall = { enable = true; - allowedTCPPorts = [ 25 143 587 ]; # < TODO: make this flexible + allowedTCPPorts = [ 25 587 ] + ++ (if enable_imap then [ 143 ] else []) + ++ (if enable_pop3 then [ 110 ] else []); }; }