aboutsummaryrefslogtreecommitdiffstats
path: root/config/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'config/postfix')
-rw-r--r--config/postfix/postfix.inc11
-rw-r--r--config/postfix/postfix_recipients.xml33
2 files changed, 29 insertions, 15 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
@@ -97,6 +97,17 @@
</tabs>
<fields>
<field>
+ <name>Get Valid recipients update frequency</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Frequency</fielddescr>
+ <fieldname>freq</fieldname>
+ <description>Wait time between each update HINT 30m(30 minutes), 1h(one hour), 1d(one day)</description>
+ <type>input</type>
+ <size>15</size>
+ </field>
+ <field>
<name>Get Valid recipients from Active Directory</name>
<type>listtopic</type>
</field>
@@ -108,13 +119,6 @@
Before using LDAP fetch you must install p5-perl-ldap package(hint: <strong>/usr/sbin/pkg_add -r p5-perl-ldap</strong>)]]></description>
</field>
<field>
- <fielddescr>Frequency</fielddescr>
- <fieldname>freq</fieldname>
- <description>Wait time between each fetch HINT 30m(30 minutes), 1h(one hour), 1d(one day)</description>
- <type>input</type>
- <size>15</size>
- </field>
- <field>
<fielddescr><![CDATA[<strong>HINTS</strong><br>Hostname:<br>dc1.mysite.com<br><br>Domain:<br>dc=mysite,dc=com<br><br>Username:<br>cn=antispam,cn=Users<br>]]></fielddescr>
<fieldname>none</fieldname>
<type>rowhelper</type>
@@ -146,12 +150,19 @@
</rowhelper>
</field>
<field>
- <name>Get Valid recipients from local file</name>
+ <name>Get Valid recipients from a clear text url</name>
<type>listtopic</type>
</field>
<field>
- <fielddescr>Location</fielddescr>
- <name>location</name>
+ <fielddescr>Enable URL fetch</fielddescr>
+ <fieldname>enable_url</fieldname>
+ <type>checkbox</type>
+ <description><![CDATA[Extract valid email addresses from external URL.<br>
+ The file must return a list with valid emails in clear text format(hint: <strong>http://intranet.mycompany.com/valid_emails.txt</strong>)]]></description>
+ </field>
+ <field>
+ <fielddescr>URL</fielddescr>
+ <fieldname>custom_url</fieldname>
<type>input</type>
<size>80</size>
</field>
@@ -164,7 +175,7 @@
<fieldname>custom_recipients</fieldname>
<description><![CDATA[Paste your valid recipients here, one per line. <strong>HINT user@mycompany.com OK</strong>]]></description>
<type>textarea</type>
- <cols>60</cols>
+ <cols>70</cols>
<rows>15</rows>
<encoding>base64</encoding>
</field>