From 7b5250ddad2ae8502f159f5c812fe43655f2be36 Mon Sep 17 00:00:00 2001 From: marcelloc Date: Thu, 16 Feb 2012 20:40:44 -0200 Subject: postfix - change local file recipients to url fetch with cron --- config/postfix/postfix.inc | 11 +++++++---- config/postfix/postfix_recipients.xml | 33 ++++++++++++++++++++++----------- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/config/postfix/postfix.inc b/config/postfix/postfix.inc index 831e6bb2..5fde243e 100644 --- a/config/postfix/postfix.inc +++ b/config/postfix/postfix.inc @@ -56,14 +56,17 @@ function sync_relay_recipients($via_cron="cron"){ $ad_export="/usr/local/etc/postfix/adexport.pl"; $postfix_enabled=$config['installedpackages']['postfix']['config'][0]['enable_postfix']; if (is_array($config['installedpackages']['postfixrecipients']['config'])) { - $postfix_recipients_config=$config['installedpackages']['postfixrecipients']['config'][0]; - if($postfix_recipients_config['location'] && file_exists($postfix_recipients_config['location'])) - $relay_recipients .= file_get_contents($postfix_recipients_config['location']); + $relay_ldap_recipients=""; + $postfix_recipients_config=$config['installedpackages']['postfixrecipients']['config'][0]; + if($postfix_recipients_config['enable_url'] && is_URL($postfix_recipients_config['custom_url'])){ + print "extracting from ".$postfix_recipients_config['custom_url']."..."; + $relay_recipients .= file_get_contents($postfix_recipients_config['custom_url']); + print "(". count(file($postfix_recipients_config['custom_url'])).")\n"; + } if($postfix_recipients_config['custom_recipients']) $relay_recipients .= px_text_area_decode($postfix_recipients_config['custom_recipients']); if($postfix_recipients_config['enable_ldap']){ #validate cront job - $relay_ldap_recipients=""; if ($via_cron == "gui"){ #running via pfsense gui, not time for ldap fetch. $ldap_recipients='/usr/local/etc/postfix/relay_ldap_recipients.txt'; diff --git a/config/postfix/postfix_recipients.xml b/config/postfix/postfix_recipients.xml index 5b46e32c..97e39fb2 100644 --- a/config/postfix/postfix_recipients.xml +++ b/config/postfix/postfix_recipients.xml @@ -96,6 +96,17 @@ + + Get Valid recipients update frequency + listtopic + + + Frequency + freq + Wait time between each update HINT 30m(30 minutes), 1h(one hour), 1d(one day) + input + 15 + Get Valid recipients from Active Directory listtopic @@ -107,13 +118,6 @@ Before using LDAP fetch you must install p5-perl-ldap package(hint: /usr/sbin/pkg_add -r p5-perl-ldap)]]> - - Frequency - freq - Wait time between each fetch HINT 30m(30 minutes), 1h(one hour), 1d(one day) - input - 15 - HINTS
Hostname:
dc1.mysite.com

Domain:
dc=mysite,dc=com

Username:
cn=antispam,cn=Users
]]>
none @@ -146,12 +150,19 @@
- Get Valid recipients from local file + Get Valid recipients from a clear text url listtopic - Location - location + Enable URL fetch + enable_url + checkbox + + The file must return a list with valid emails in clear text format(hint: http://intranet.mycompany.com/valid_emails.txt)]]> + + + URL + custom_url input 80 @@ -164,7 +175,7 @@ custom_recipients HINT user@mycompany.com OK]]> textarea - 60 + 70 15 base64 diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 4e7c3ebe..ed87c751 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -395,7 +395,7 @@ http://forum.pfsense.org/index.php/topic,40622.0.html http://files.pfsense.org/packages/8/All/ postfix-2.8.7,1.tbz - 2.8.7,1 pkg v.2.3.3 + 2.8.7,1 pkg v.2.3.3_1 RC1 2.0 postfix.xml diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 6a7cade8..4a38d1b5 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -480,7 +480,7 @@ postfix-2.8.7,1.tbz perl-5.12.4_3.tbz postfix-2.8.5-amd64.pbi - 2.8.7,1 pkg v.2.3.3 + 2.8.7,1 pkg v.2.3.3_1 RC1 2.0 postfix.xml -- cgit v1.2.3