From 523dbf817c7815977ab64ab16ea983434a7651ce Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Sat, 20 Nov 2010 19:10:50 -0700 Subject: Add some files that are part of a postfix mail forwarder package. --- config/postfix/postfix.inc | 114 +++++++++++++++++++++++++++++++++++++++++++++ config/postfix/postfix.xml | 99 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 config/postfix/postfix.inc create mode 100644 config/postfix/postfix.xml (limited to 'config') diff --git a/config/postfix/postfix.inc b/config/postfix/postfix.inc new file mode 100644 index 00000000..63add863 --- /dev/null +++ b/config/postfix/postfix.inc @@ -0,0 +1,114 @@ + "postfix.sh", "start" => $start, "stop" => $stop)); + + conf_mount_ro(); + + log_error("Stopping postfix"); + mwexec("/usr/local/etc/rc.d/postfix.sh stop"); + sleep(1); + log_error("Starting postfix"); + mwexec_bg("/usr/local/etc/rc.d/postfix.sh start"); + log_error("Postfix setup completed"); +} + +function postfix_validate_input($post, &$input_errors) { + foreach ($post as $key => $value) { + if (empty($value)) + continue; + if (substr($key, 0, 6) == "domain" && is_numeric(substr($key, 6))) { + if (!is_domain($value)) + $input_errors[] = "{$value} is not a valid domain name."; + } else if (substr($key, 0, 12) == "mailserverip" && is_numeric(substr($key, 12))) { + if (empty($post['domain' . substr($key, 12)])) + $input_errors[] = "Domain for {$value} cannot be blank."; + if (!is_ipaddr($value) && !is_hostname($value)) + $input_errors[] = "{$value} is not a valid IP address or host name."; + } + } +} + +function postfix_php_install_command() { + sync_package_postfix(); +} + +function postfix_php_deinstall_command() { + mwexec("/usr/local/etc/rc.d/postfix.sh stop"); + sleep(1); + conf_mount_rw(); + unlink_if_exists("/usr/local/etc/rc.d/postfix.sh"); + conf_mount_ro(); +} + +?> \ No newline at end of file diff --git a/config/postfix/postfix.xml b/config/postfix/postfix.xml new file mode 100644 index 00000000..d8103f02 --- /dev/null +++ b/config/postfix/postfix.xml @@ -0,0 +1,99 @@ + + + + + + + + Describe your package here + Describe your package requirements here + Currently there are no FAQ items provided. + postfix + 1.0 + Services: Postfix Forwarder + /usr/local/pkg/postfix.inc + + Postfix Forwarder + Configure Postfix Forwarder +
Services
+ postfix.xml +
+ + postfix + postfix.sh + master + + + http://www.pfsense.org/packages/config/postfix/postfix.inc + /usr/local/pkg/ + 0755 + + + + Forwarding + none + rowhelper + + + Domain + domain + Enter the domain here (ex: example.com) + input + 20 + + + Mail Server IP + mailserverip + Enter the mail server IP to forward to here. + input + 20 + + + + + + postfix_php_install_command(); + + + postfix_php_deinstall_command(); + + + postfix_validate_input($_POST, &$input_errors); + + + sync_package_postfix(); + +
-- cgit v1.2.3