aboutsummaryrefslogtreecommitdiffstats
path: root/config/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'config/postfix')
-rwxr-xr-xconfig/postfix/adexport.pl40
-rwxr-xr-xconfig/postfix/postfix.inc140
-rw-r--r--config/postfix/postfix.php50
-rwxr-xr-xconfig/postfix/postfix.widget.php25
-rw-r--r--config/postfix/postfix.xml4
-rwxr-xr-xconfig/postfix/postfix_about.php10
-rw-r--r--config/postfix/postfix_acl.xml4
-rw-r--r--config/postfix/postfix_antispam.xml6
-rw-r--r--config/postfix/postfix_domains.xml6
-rwxr-xr-xconfig/postfix/postfix_queue.php37
-rw-r--r--config/postfix/postfix_recipients.xml4
-rwxr-xr-xconfig/postfix/postfix_search.php20
-rw-r--r--config/postfix/postfix_sync.xml4
-rw-r--r--config/postfix/postfix_view_config.php30
14 files changed, 193 insertions, 187 deletions
diff --git a/config/postfix/adexport.pl b/config/postfix/adexport.pl
index 185848f1..25a8a267 100755
--- a/config/postfix/adexport.pl
+++ b/config/postfix/adexport.pl
@@ -1,9 +1,9 @@
-#!/usr/bin/perl -w
+#!/usr/local/bin/perl -w
##############################################################################
#
# Script to export a list of all email addresses from Active Directory
# Brian Landers <brian@packetslave.com>
-#
+#
# This code is in the public domain. Your use of this code is at your own
# risk, and no warranty is implied. The author accepts no liability for any
# damages or risks incurred by its use.
@@ -42,7 +42,7 @@ use Net::LDAP;
use Net::LDAP::Control::Paged;
use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED );
-#our ($cn,$passwd,$base);
+#our ($cn,$passwd,$base);
#($cn,$passwd,$base)=@_ARGV;
#print "$cn \n $passwd \n $base";
#exit;
@@ -74,10 +74,10 @@ foreach( @servers ) {
# 1000 records by default. We have to use paging to get the full list.
my $page = Net::LDAP::Control::Paged->new( size => 100 );
-
+
# Try to bind (login) to the server now that we're connected
-my $msg = $ldap->bind( dn => $bind,
- password => $passwd
+my $msg = $ldap->bind( dn => $bind,
+ password => $passwd
);
# If we can't bind, we can't continue
@@ -122,7 +122,7 @@ if( $cookie ) {
}
# Finally, unbind from the server
-$ldap->unbind;
+$ldap->unbind;
# ------------------------------------------------------------------------
# Callback function that gets called for each record we get from the server
@@ -131,16 +131,16 @@ $ldap->unbind;
#
sub handle_object {
-
+
my $msg = shift; # Net::LDAP::Message object
my $data = shift; # May be Net::LDAP::Entry or Net::LDAP::Reference
-
+
# Only process if we actually got data
return unless $data;
-
+
return handle_entry( $msg, $data ) if $data->isa("Net::LDAP::Entry");
return handle_reference( $msg, $data ) if $data->isa("Net::LDAP::Reference");
-
+
# If we get here, it was something we're not prepared to handle,
# so just return silently.
@@ -153,35 +153,35 @@ sub handle_object {
# ones we haven't seen before.
sub handle_entry {
-
+
my $msg = shift;
my $data = shift;
-
+
# Extract the email addressess, selecting only the SMTP ones, and
# filter them so that we only get unique addresses
- my @mails = grep { /^smtp:/i && !$gSeen{$_}++ }
+ my @mails = grep { /^smtp:/i && !$gSeen{$_}++ }
$data->get_value( "proxyAddresses" );
-
- # If we found any, strip off the SMTP: identifier and print them out
+
+ # If we found any, strip off the SMTP: identifier and print them out
if( @mails ) {
print map { s/^smtp:(.+)$/\L$1\n/i; $_ } @mails;
}
}
# ------------------------------------------------------------------------
-# Handler for a Net::LDAP::Reference object. This is a 'redirect' to
+# Handler for a Net::LDAP::Reference object. This is a 'redirect' to
# another portion of the directory. We simply extract the references
# from the object and resubmit them to the handle_object function for
# processing.
sub handle_reference {
-
+
my $msg = shift;
my $data = shift;
-
+
foreach my $obj( $data->references() ) {
-
+
# Oooh, recursion! Might be a reference to another reference, after all
return handle_object( $msg, $obj );
}
diff --git a/config/postfix/postfix.inc b/config/postfix/postfix.inc
index 50979f38..eb5499aa 100755
--- a/config/postfix/postfix.inc
+++ b/config/postfix/postfix.inc
@@ -3,7 +3,7 @@
postfix.inc
part of the Postfix package for pfSense
Copyright (C) 2010 Erik Fonnesbeck
- Copyright (C) 2011-2013 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
@@ -35,19 +35,19 @@ require_once("functions.inc");
require_once("pkg-utils.inc");
require_once("globals.inc");
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version > 2.0)
+$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+if (is_dir('/usr/pbi/postfix-' . php_uname("m"))) {
define('POSTFIX_LOCALBASE', '/usr/pbi/postfix-' . php_uname("m"));
-else
- define('POSTFIX_LOCALBASE','/usr/local');
-
+} else {
+ define('POSTFIX_LOCALBASE','/usr/local');
+}
$uname=posix_uname();
if ($uname['machine']=='amd64')
ini_set('memory_limit', '250M');
function px_text_area_decode($text){
- return preg_replace('/\r\n/', "\n",base64_decode($text));
+ return preg_replace('/\r\n/', "\n",base64_decode($text));
}
function px_get_real_interface_address($iface) {
@@ -85,8 +85,8 @@ function sync_relay_recipients($via_cron="cron"){
if (!file_exists($ldap_recipients))
system('/usr/bin/touch '. $ldap_recipients);
$relay_ldap_recipients=file_get_contents($ldap_recipients);
- }
- else{
+ }
+ else{
#running via crontab, time to get ldap content.
$ldap_temp=array();
foreach ($postfix_recipients_config['row'] as $postfix_ldap) {
@@ -121,7 +121,7 @@ function sync_relay_recipients($via_cron="cron"){
print "Total ldap recipients:".count($ldap_all)."\tunique:".count($ldap_unique)."\n";
foreach($ldap_unique as $recipient)
$relay_ldap_recipients.=($recipient != ""?preg_replace("/\s+/","",$recipient)." OK\n":"");
-
+
#save ldap relay recipients
file_put_contents(POSTFIX_LOCALBASE."/etc/postfix/relay_ldap_recipients.txt",$relay_ldap_recipients, LOCK_EX);
}
@@ -137,11 +137,11 @@ function sync_relay_recipients($via_cron="cron"){
}
if($relay_recipients !="" || $relay_ldap_recipients!="")
return("relay_recipient_maps = hash:".POSTFIX_LOCALBASE."/etc/postfix/relay_recipients\n");
-
+
}
function check_cron(){
global $config, $g;
- #check crontab
+ #check crontab
$new_cron=array();
$cron_cmd_sqlite = "";
$cron_postfix_sqlite="";
@@ -207,7 +207,7 @@ function check_cron(){
}
}
}
-
+
#check crontab relay recipients
$cron_found="";
if (is_array($config['cron']['item'])){
@@ -224,7 +224,7 @@ function check_cron(){
}
}
}
- #check sqlite update queue
+ #check sqlite update queue
else if(!preg_match("/.usr.local.www.postfix.php/",$cron["command"])){
#keep all non postfix cron cmds if not empty
if ($cron["command"] != "")
@@ -235,7 +235,7 @@ function check_cron(){
# Check if crontab must be changed to valid recipients cmd
if ($postfix_recipients_config['enable_ldap'] || $postfix_recipients_config['enable_url']){
if ($cron_found!=$cron_postfix){
- #update postfix cron schedule
+ #update postfix cron schedule
if (! is_array($cron_found) && $postfix_enabled=="on")
$new_cron['item'][]=$cron_postfix;
$write_cron=1;
@@ -255,7 +255,7 @@ function check_cron(){
}
}
- #call cron functions
+ #call cron functions
if ($write_cron==1){
$config['cron']=$new_cron;
write_config('Postfix - sync remote sqlite database',$backup = false);
@@ -271,17 +271,17 @@ function check_cron(){
else
$new_crontab .= $line;
}
- if ($old_cron==1)
+ if ($old_cron==1)
file_put_contents("/etc/crontab",$new_crontab, LOCK_EX);
-
+
#print "<pre>". var_dump($new_cron). var_dump($cron_postfix_sqlite).var_dump($config['cron']);
#exit;
-
-
+
+
}
function sync_package_postfix($via_rpc="no") {
global $config;
-
+
log_error("sync_package_postfix called with via_rpc={$via_rpc}");
# detect boot process
if (is_array($_POST)){
@@ -290,10 +290,10 @@ function sync_package_postfix($via_rpc="no") {
else
$boot_process="on";
}
-
+
if(is_process_running("master") && isset($boot_process) && $via_rpc=="no")
return;
-
+
#check patch in /etc/inc/config.
$relay_domains = "";
$transport = "";
@@ -346,10 +346,10 @@ function sync_package_postfix($via_rpc="no") {
}
file_put_contents($sys_log_file,$new_sys_log, LOCK_EX);
#mwexec('/usr/local/bin/php -q /usr/local/www/postfix_syslog.php');
- #restart syslog daemon
+ #restart syslog daemon
system_syslogd_start();
}
-
+
#check_debug
if($postfix_config['debug_list'] && $postfix_config['debug_list']!=""){
$check_debug ="\n#Debugging postfix\n";
@@ -358,7 +358,7 @@ function sync_package_postfix($via_rpc="no") {
}
#check relay recipients
$all_relay_recipients=sync_relay_recipients('gui');
-
+
$copyright=<<<ABOUT
#Part of the Postfix package for pfSense
#Copyright (C) 2010 Erik Fonnesbeck
@@ -416,14 +416,14 @@ EOF;
$cal_cidr = px_text_area_decode($config['installedpackages']['postfixacl']['config'][0]['cal_cidr']);
else
#formatar o arquivo retirando os 'oks'
- $cal_cidr_tmp = px_text_area_decode($config['installedpackages']['postfixacl']['config'][0]['cal_cidr']);
+ $cal_cidr_tmp = px_text_area_decode($config['installedpackages']['postfixacl']['config'][0]['cal_cidr']);
$cal_cidr = preg_replace('/ ok/i'," permit",$cal_cidr_tmp);
}
#Client PCRE
if ($config['installedpackages']['postfixacl']['config'][0]['cal_pcre']){
$cal_pcre = px_text_area_decode($config['installedpackages']['postfixacl']['config'][0]['cal_pcre']);
}
- $postfix_main .= px_text_area_decode($postfix_config['maincf'])."\n".
+ $postfix_main .= px_text_area_decode($postfix_config['maincf'])."\n".
"relay_domains ={$relay_domains}\n" .
"transport_maps = hash:".POSTFIX_LOCALBASE."/etc/postfix/transport\n" .
"local_recipient_maps =\n" .
@@ -434,7 +434,7 @@ EOF;
"default_process_limit = {$process_limit}\n";
#assign antispam options
$antispam=$config['installedpackages']['postfixantispam']['config'][0];
-
+
if($antispam['antispam_enabled']){
switch ($antispam['antispam_software']){
case "mailscanner":
@@ -452,16 +452,16 @@ smtpd_client_restrictions = check_policy_service {$antispam['antispam_location']
smtpd_restriction_classes =
has_our_domain_as_sender
client_throttle
-smtpd_end_of_data_restrictions = check_policy_service {$antispam['antispam_location']}
+smtpd_end_of_data_restrictions = check_policy_service {$antispam['antispam_location']}
EOF;
}
else{
- $postfix_main_antispam = "Policyd v2 has no location set.\n\n";
+ $postfix_main_antispam = "Policyd v2 has no location set.\n\n";
}
break;
- }
+ }
}
if ($antispam['reject_unknown_helo_hostname']){
$reject_unknown_helo_hostname = <<<EOF
@@ -470,7 +470,7 @@ smtpd_helo_restrictions = check_helo_access pcre:{$pf_dir}/etc/postfix/helo_chec
reject_invalid_helo_hostname,
reject_non_fqdn_helo_hostname,
permit
-
+
EOF;
}
if ($antispam['header_check'] == "strong")
@@ -492,7 +492,7 @@ smtpd_sender_restrictions = reject_non_fqdn_sender,
reject_multi_recipient_bounce,
permit
-# Allow connections from specified local clients and strong check everybody else.
+# Allow connections from specified local clients and strong check everybody else.
smtpd_client_restrictions = permit_mynetworks,
reject_unauth_destination,
check_client_access pcre:{$pf_dir}/etc/postfix/cal_pcre,
@@ -500,7 +500,7 @@ smtpd_client_restrictions = permit_mynetworks,
reject_unknown_client_hostname,
reject_unauth_pipelining,
reject_multi_recipient_bounce,
- permit
+ permit
smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_destination,
@@ -522,13 +522,13 @@ else
$postfix_main .= <<<EOF
#Just reject after helo,sender,client,recipient tests
smtpd_delay_reject = yes
-
+
# Don't talk to mail systems that don't know their own hostname.
smtpd_helo_required = yes
{$reject_unknown_helo_hostname}
smtpd_sender_restrictions = reject_unknown_sender_domain,
- RBLRBLRBL
+ RBLRBLRBL
# Allow connections from specified local clients and rbl check everybody else if rbl check are set.
smtpd_client_restrictions = permit_mynetworks,
@@ -540,7 +540,7 @@ smtpd_client_restrictions = permit_mynetworks,
# Whitelisting: local clients may specify any destination domain.
#,
-smtpd_recipient_restrictions = permit_mynetworks,
+smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_destination,
check_sender_access hash:{$pf_dir}/etc/postfix/sender_access,
check_client_access pcre:{$pf_dir}/etc/postfix/cal_pcre,
@@ -571,16 +571,16 @@ switch ($antispam['zombie_blocker'])
case "ignore":
$postscreen=1;
break;
-
+
case "disabled":
$postscreen=0;
break;
}
if ($antispam['soft_bounce'] == "enabled")
{
- $postfix_main.="soft_bounce = yes\n";
+ $postfix_main.="soft_bounce = yes\n";
}
-
+
//check ips to listen on
$inet_protocols=($postfix_config['inet_protocol'] ? $postfix_config['inet_protocol'] : "ipv4");
$inet_interfaces =array();
@@ -633,7 +633,7 @@ switch ($antispam['zombie_blocker'])
if(preg_match("/postscreen_greet_check/",$antispam['after_greeting'])){
$postfix_main.="postscreen_greet_action = ".$antispam['zombie_blocker']."\n";
}
-
+
$postfix_main.="postscreen_access_list = permit_mynetworks,\n\t\t\tcidr:".POSTFIX_LOCALBASE."/etc/postfix/cal_cidr\n";
$postfix_main.="postscreen_dnsbl_action= ".$antispam['zombie_blocker']."\n";
$postfix_main.="postscreen_blacklist_action= ".$antispam['zombie_blocker']."\n";
@@ -674,7 +674,7 @@ MASTEREOF;
$rbl2.= $prefix."reject_rbl_client $rbl,\n";
}
}
-
+
#interface loop
/*$postfix_inets="";
$ifaces = ($postfix_config['enabled_interface'] ? $postfix_config['enabled_interface'] : 'loopback');
@@ -688,16 +688,16 @@ MASTEREOF;
}
*/
$postfix_master ="25 inet n - n - - smtpd\n";
-
+
}
$rbl2.=($rbl2 !=""?"\t\t\t\tpermit\n":"permit\n");
$postfix_main=preg_replace("/RBLRBLRBL/",$rbl2,$postfix_main);
-
+
#Header Maps
$anvil_config=$config['installedpackages']['postfixantispam']['config'][0]['anvil'];
if ($anvil_config =='enabled' || ($anvil_config =='postscreen' && $postscreen==1))
$anvil='anvil unix - - n - 1 anvil';
-
+
$postfix_master .= <<<MASTEREOF2
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
@@ -725,9 +725,15 @@ scache unix - - n - 1 scache
{$anvil}
MASTEREOF2;
-
+
conf_mount_rw();
+ //check postfix etc dir on 2.2
+ $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+ $postfix_etc_lnk="/usr/local/etc/postfix";
+ if ($pfs_version == 2.2 && !is_dir($postfix_etc_lnk))
+ @symlink(POSTFIX_LOCALBASE.'/etc/postfix',$postfix_etc_lnk);
+
log_error("Writing out configuration");
file_put_contents(POSTFIX_LOCALBASE."/etc/postfix/main.cf", $postfix_main, LOCK_EX);
file_put_contents(POSTFIX_LOCALBASE."/etc/postfix/master.cf", $postfix_master, LOCK_EX);
@@ -745,13 +751,13 @@ MASTEREOF2;
{
mwexec(POSTFIX_LOCALBASE."/sbin/postmap ".POSTFIX_LOCALBASE."/etc/postfix/".$file);
}
-
+
#check postix dirs
$dirs=array("/var/spool/postfix","/etc/mail","/var/db/postfix","/var/mail/postfix");
foreach ($dirs as $dir)
if (!is_dir($dir) && !file_exists($dir))
mkdir($dir, 0755,TRUE);
-
+
#check postfix owners
$dirs=array("/var/db/postfix","/var/mail/postfix");
foreach ($dirs as $dir){
@@ -762,27 +768,27 @@ MASTEREOF2;
touch("/etc/mail/aliases");
exec("/usr/local/bin/newaliases");
postfix_start();
-
+
#Do not sync during boot
if(!isset($boot_process) || $via_rpc=="yes")
postfix_sync_on_changes();
-
+
}
function postfix_start(){
global $config;
$pf_dir=POSTFIX_LOCALBASE;
$start=<<<EOF
-
+
sysctl kern.ipc.nmbclusters=65536
sysctl kern.ipc.somaxconn=16384
sysctl kern.maxfiles=131072
sysctl kern.maxfilesperproc=104856
sysctl kern.threads.max_threads_per_proc=4096
{$pf_dir}/sbin/postfix start
-
+
EOF;
$stop = POSTFIX_LOCALBASE."/sbin/postfix stop\n";
- log_error("Writing rc_file");
+ log_error("Writing rc_file");
write_rcfile(array("file" => "postfix.sh", "start" => $start, "stop" => $stop));
sleep(1);
@@ -797,7 +803,7 @@ EOF;
mwexec("/usr/local/etc/rc.d/postfix.sh stop");
system('/bin/chmod -x /usr/local/etc/rc.d/postfix.sh');
}
-
+
conf_mount_ro();
}
@@ -806,11 +812,11 @@ function postfix_validate_input($post, &$input_errors) {
if (empty($value))
continue;
if($key == "greet_time" && !preg_match("/(\d+),(\d+)(s|m|h|w)/",$value))
- $input_errors[] = "Wrong greet time sintax.";
+ $input_errors[] = "Wrong greet time sintax.";
if($key == "message_size_limit" && !is_numeric($value))
$input_errors[] = "Message size limit must be numeric.";
if($key == "process_limit" && !is_numeric($value))
- $input_errors[] = "Process limit must be numeric.";
+ $input_errors[] = "Process limit must be numeric.";
if($key == "freq" && (!preg_match("/^\d+(h|m|d)$/",$value) || $value == 0))
$input_errors[] = "A valid number with a time reference is required for the field 'Frequency'";
if (substr($key, 0, 2) == "dc" && !is_hostname($value))
@@ -845,7 +851,7 @@ function postfix_php_deinstall_command() {
/* Uses XMLRPC to synchronize the changes to a remote node */
function postfix_sync_on_changes() {
- global $config, $g;
+ global $config, $g;
if (is_array($config['installedpackages']['postfixsync']['config'])){
$postfix_sync=$config['installedpackages']['postfixsync']['config'][0];
$synctimeout = $postfix_sync['synctimeout'];
@@ -877,7 +883,7 @@ function postfix_sync_on_changes() {
log_error("[postfix] xmlrpc sync is enabled but there is no system backup hosts to push postfix config.");
return;
}
- break;
+ break;
default:
return;
break;
@@ -905,13 +911,13 @@ function postfix_do_xmlrpc_sync($sync_to_ip,$username,$password,$sync_type,$sync
if(!$username)
$username="admin";
-
+
if(!$password)
return;
if(!$sync_to_ip)
return;
-
+
if(!$synctimeout)
$synctimeout=120;
@@ -923,9 +929,9 @@ function postfix_do_xmlrpc_sync($sync_to_ip,$username,$password,$sync_type,$sync
$port = $config['system']['webgui']['port'];
/* if port is empty lets rely on the protocol selection */
if($port == "") {
- if($config['system']['webgui']['protocol'] == "http")
+ if($config['system']['webgui']['protocol'] == "http")
$port = "80";
- else
+ else
$port = "443";
}
$synchronizetoip .= $sync_to_ip;
@@ -948,7 +954,7 @@ function postfix_do_xmlrpc_sync($sync_to_ip,$username,$password,$sync_type,$sync
XML_RPC_encode($password),
XML_RPC_encode($xml)
);
-
+
/* set a few variables needed for sync code borrowed from filter.inc */
$url = $synchronizetoip;
log_error("Beginning Postfix XMLRPC sync to {$url}:{$port}.");
@@ -973,18 +979,18 @@ function postfix_do_xmlrpc_sync($sync_to_ip,$username,$password,$sync_type,$sync
} else {
log_error("Postfix XMLRPC sync successfully completed with {$url}:{$port}.");
}
-
+
/* tell postfix to reload our settings on the destionation sync host. */
$method = 'pfsense.exec_php';
$execcmd = "require_once('/usr/local/pkg/postfix.inc');\n";
$execcmd .= "sync_package_postfix('yes');";
-
+
/* assemble xmlrpc payload */
$params = array(
XML_RPC_encode($password),
XML_RPC_encode($execcmd)
);
-
+
log_error("postfix XMLRPC reload data {$url}:{$port}.");
$msg = new XML_RPC_Message($method, $params);
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
diff --git a/config/postfix/postfix.php b/config/postfix/postfix.php
index 774c7573..4cf85033 100644
--- a/config/postfix/postfix.php
+++ b/config/postfix/postfix.php
@@ -2,7 +2,7 @@
/*
postfix.php
part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2011-2013 Marcello Coutinho <marcellocoutinho@gmail.com>
+ Copyright (C) 2011-2014 Marcello Coutinho <marcellocoutinho@gmail.com>
based on varnish_view_config.
All rights reserved.
@@ -42,13 +42,13 @@ function get_remote_log(){
$curr_time = time();
$log_time=date('YmdHis',$curr_time);
#get protocol
- if($config['system']['webgui']['protocol'] != "")
+ if($config['system']['webgui']['protocol'] != "")
$synchronizetoip = $config['system']['webgui']['protocol']. "://";
#get port
$port = $config['system']['webgui']['port'];
- #if port is empty lets rely on the protocol selection
+ #if port is empty lets rely on the protocol selection
if($port == "")
- $port =($config['system']['webgui']['protocol'] == "http"?"80":"443");
+ $port =($config['system']['webgui']['protocol'] == "http"?"80":"443");
$synchronizetoip .= $sync_to_ip;
if (is_array($config['installedpackages']['postfixsync']))
foreach($config['installedpackages']['postfixsync']['config'][0]['row'] as $sh){
@@ -59,7 +59,7 @@ function get_remote_log(){
#get remote data
if ($sync_type=='fetch'){
$url= $synchronizetoip . $sync_to_ip;
- print "$sync_to_ip $url, $port\n";
+ print "$sync_to_ip $url, $port\n";
$method = 'pfsense.exec_php';
$execcmd = "require_once('/usr/local/www/postfix.php');\n";
$execcmd .= '$toreturn=get_sql('.$log_time.');';
@@ -93,7 +93,7 @@ function get_remote_log(){
die ("Cannot execute query. $error\n".$update['sql']."\n");
}
else{
- if ($debug=true)
+ if ($debug=true)
print "ok\n";
}
sqlite_close($dbhandle);
@@ -114,12 +114,12 @@ function get_remote_log(){
$resp = $cli->send($msg, "250");
}
}
- }
+ }
}
function get_sql($log_time){
global $config,$xmlrpc_g;
$server=$_SERVER['REMOTE_ADDR'];
-
+
if (is_array($config['installedpackages']['postfixsync']))
foreach($config['installedpackages']['postfixsync']['config'][0]['row'] as $sh){
$sync_to_ip = $sh['ipaddress'];
@@ -141,7 +141,7 @@ function flush_sql($log_time){
function grep_log(){
global $postfix_dir,$postfix_arg,$config,$g;
-
+
$total_lines=0;
$days=array();
$grep="\(MailScanner\|postfix.cleanup\|postfix.smtp\|postfix.error\|postfix.qmgr\)";
@@ -203,7 +203,7 @@ function grep_log(){
#Nov 16 00:00:14 srvch011 postfix/smtp[7363]: 7AEB91F797D: to=<alessandra.bueno@mg.test.com>, relay=mail.mg.test.com[172.25.3.5]:25, delay=39, delays=35/1.1/0.04/2.7, dsn=5.7.1, status=bounced (host mail.mg.test.com[172.25.3.5] said: 550 5.7.1 Unable to relay for alessandra.bueno@mg.test.com (in reply to RCPT TO command))
else if(preg_match("/(\w+\s+\d+\s+[0-9,:]+) (\w+) postfix.\w+\W\d+\W+(\w+): to=\<(.*)\>, relay=(.*), delay=([0-9,.]+), .* dsn=([0-9,.]+), status=(\w+) (.*)/",$line,$email)){
$stm_queue[$day].= "insert or ignore into mail_status (info) values ('".$email[8]."');\n";
- $stm_queue[$day].= "insert or ignore into mail_to (from_id,too,status,status_info,relay,delay,dsn) values ((select id from mail_from where sid='".$email[3]."' and server='".$email[2]."'),'".strtolower($email[4])."',(select id from mail_status where info='".$email[8]."'),'".preg_replace("/(\<|\>|\s+|\'|\")/"," ",$email[9])."','".$email[5]."','".$email[6]."','".$email[7]."');\n";
+ $stm_queue[$day].= "insert or ignore into mail_to (from_id,too,status,status_info,relay,delay,dsn) values ((select id from mail_from where sid='".$email[3]."' and server='".$email[2]."'),'".strtolower($email[4])."',(select id from mail_status where info='".$email[8]."'),'".preg_replace("/(\<|\>|\s+|\'|\")/"," ",$email[9])."','".$email[5]."','".$email[6]."','".$email[7]."');\n";
$stm_queue[$day].= "update or ignore mail_to set status=(select id from mail_status where info='".$email[8]."'), status_info='".preg_replace("/(\<|\>|\s+|\'|\")/"," ",$email[9])."', dsn='".$email[7]."', delay='".$email[6]."', relay='".$email[5]."', too='".strtolower($email[4])."' where from_id in (select id from mail_from where sid='".$email[3]."' and server='".$email[2]."');\n";
}
#Nov 13 01:48:44 srvch011 postfix/cleanup[16914]: D995B1F570B: message-id=<61.40.11745.10E3FBE4@ofertas6>
@@ -223,7 +223,7 @@ function grep_log(){
$stm_queue[$day].= "insert or ignore into mail_status (info) values ('".$email[8]."');\n";
$stm_queue[$day].= "update mail_to set status=(select id from mail_status where info='reject'), status_info='queue file size limit exceeded' where from_id in (select id from mail_from where sid='".$email[3]."' and server='".$email[2]."');\n";
}
-
+
#Nov 9 02:14:57 srvch011 postfix/cleanup[6856]: 617A51F5AC5: warning: header Subject: Mapeamento de Processos from lxalpha.12b.com.br[66.109.29.225]; from=<apache@lxalpha.12b.com.br> to=<ritiele.faria@mail.test.com> proto=ESMTP helo=<lxalpha.12b.com.br>
#Nov 8 09:31:50 srvch011 postfix/cleanup[11471]: 19C281F59C8: reject: header From: "Giuliana Flores - Parceiro do Grupo Virtual" <publicidade@parceiro-grupovirtual.com.br> from pm03-974.auinmeio.com.br[177.70.232.225]; from=<publicidade@parceiro-grupovirtual.com.br> to=<jorge.lustosa@mail.test.com> proto=ESMTP helo=<pm03-974.auinmeio.com.br>: 5.7.1 [SN007]
#Nov 13 00:03:24 srvch011 postfix/cleanup[4192]: 8A5B31F52D2: reject: body http://platform.roastcrack.info/mj0ie6p-48qtiyq from move2.igloojack.info[173.239.63.16]; from=<ljmd6u8lrxke4@move2.igloojack.info> to=<edileva@aasdf..br> proto=SMTP helo=<move2.igloojack.info>: 5.7.1 [BD040]
@@ -271,9 +271,9 @@ function grep_log(){
$status['status_info']=$email[4];
$status['from']=$email[5];
$status['to']=$email[6];
- $status['helo']=$email[7];
+ $status['helo']=$email[7];
$values="'".$status['date']."','".$status['status']."','".$status['status_info']."','".strtolower($status['from'])."','".strtolower($status['to'])."','".$status['helo']."','".$status['server']."'";
- $stm_noqueue[$day].='insert or ignore into mail_noqueue(date,status,status_info,fromm,too,helo,server) values ('.$values.');'."\n";
+ $stm_noqueue[$day].='insert or ignore into mail_noqueue(date,status,status_info,fromm,too,helo,server) values ('.$values.');'."\n";
}
if ($total_lines%1500 == 0){
#save log in database
@@ -295,7 +295,7 @@ function grep_log(){
$stm_queue[$d]="BEGIN;\n";
}
}
-
+
$config=parse_xml_config("{$g['conf_path']}/config.xml", $g['xml_rootobj']);
//print count($config['installedpackages']);
#start db replication if configured
@@ -310,7 +310,7 @@ function grep_log(){
postfix_do_xmlrpc_sync($sync_to_ip, $password,$sync_type);
print "ok\n";
}
-
+
}
function write_db($stm,$table,$days){
@@ -341,7 +341,7 @@ function write_db($stm,$table,$days){
if ($debug=true)
print " writing to local db $day...";
$dbhandle = sqlite_open($postfix_dir.$day.".db", 0666, $error);
- if (!$dbhandle) die ($error);
+ if (!$dbhandle) die ($error);
#file_put_contents("/tmp/".$key.'-'.$update['day'].".sql",gzuncompress(base64_decode($update['sql'])), LOCK_EX);
$ok = sqlite_exec($dbhandle, $stm[$day]."COMMIT;", $error);
if (!$ok){
@@ -356,13 +356,13 @@ function write_db($stm,$table,$days){
}
#write update sql files
if (count ($do_sync) > 0 ){
-
+
foreach($do_sync as $ip)
file_put_contents('/var/db/postfix/'.$ip.'.sql',${$ip},LOCK_EX);
conf_mount_ro();
}
#write local file
-
+
}
function create_db($postfix_db){
@@ -513,14 +513,14 @@ switch ($argv[1]){
'12:','13:','14:','15:','16:','17:','18:','19:','20:','21:','22:','23:'),
'time' => '-03 day');
break;
-
+
default:
die ("invalid parameters\n");
}
# get remote log from remote server
get_remote_log();
# get local log from logfile
-grep_log();
+grep_log();
}
#http client call
@@ -540,7 +540,7 @@ if ($_REQUEST['files']!= ""){
$stm_fetch=array();
$total_result=0;
foreach ($files as $postfix_db)
- if (file_exists($postfix_dir.'/'.$postfix_db)){
+ if (file_exists($postfix_dir.'/'.$postfix_db)){
$dbhandle = sqlite_open($postfix_dir.'/'.$postfix_db, 0666, $error);
if ($_REQUEST['from']!= ""){
$next=($last_next==" and "?" and ":" where ");
@@ -595,7 +595,7 @@ if ($_REQUEST['files']!= ""){
else
$stm .=$next."server = '".$_REQUEST['server']."'";
}
-
+
if ($_REQUEST['status']!= ""){
$next=($last_next==" and "?" and ":" where ");
$last_next=" and ";
@@ -604,7 +604,7 @@ if ($_REQUEST['files']!= ""){
#print "<pre>".$stm;
#$stm = "select * from mail_to,mail_status where mail_to.status=mail_status.id";
$result = sqlite_query($dbhandle, $stm." order by date desc $limit_prefix $limit ");
- #$result = sqlite_query($dbhandle, $stm." $limit_prefix $limit ");
+ #$result = sqlite_query($dbhandle, $stm." $limit_prefix $limit ");
if (preg_match("/\d+/",$_REQUEST['limit'])){
for ($i = 1; $i <= $limit; $i++) {
$row = sqlite_fetch_array($result, SQLITE_ASSOC);
@@ -744,8 +744,8 @@ if ($_REQUEST['files']!= ""){
print '<tr>';
print '<td ><strong>Total:</strong></td>';
print '<td ><strong>'.$total_result.'</strong></td>';
- print '</tr>';
+ print '</tr>';
print '</table>';
- }
+ }
}
?> \ No newline at end of file
diff --git a/config/postfix/postfix.widget.php b/config/postfix/postfix.widget.php
index b7fc7af9..e61274b9 100755
--- a/config/postfix/postfix.widget.php
+++ b/config/postfix/postfix.widget.php
@@ -1,6 +1,7 @@
-<?php
+<?php
/*
- Copyright 2011 Marcello Coutinho
+ postfix.widget.php
+ Copyright 2011-2014 Marcello Coutinho
Part of pfSense widgets (www.pfsense.org)
Redistribution and use in source and binary forms, with or without
@@ -31,7 +32,7 @@
$uname=posix_uname();
if ($uname['machine']=='amd64')
ini_set('memory_limit', '250M');
-
+
function open_table(){
echo "<table style=\"padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
echo" <tr>";
@@ -39,7 +40,7 @@ function open_table(){
function close_table(){
echo" </tr>";
echo"</table>";
-
+
}
$pfb_table=array();
@@ -49,20 +50,20 @@ $img['Healthy']="<img src ='/themes/{$g['theme']}/images/icons/icon_interface_up
#var_dump($pfb_table);
#exit;
-?><div id='postfix'><?php
+?><div id='postfix'><?php
global $config;
$size=$config['installedpackages']['postfix']['config'][0]['widget_size'];
if (preg_match('/\d+/',$config['installedpackages']['postfix']['config'][0]['widget_days']))
- $days=$config['installedpackages']['postfix']['config'][0]['widget_days'] * -1;
+ $days=$config['installedpackages']['postfix']['config'][0]['widget_days'] * -1;
else
$days=-3;
if (preg_match('/\d+/',$config['installedpackages']['postfix']['config'][0]['widget_size']))
- $size=$config['installedpackages']['postfix']['config'][0]['widget_size'];
+ $size=$config['installedpackages']['postfix']['config'][0]['widget_size'];
else
$size='100000000';#100mb
-
+
$postfix_dir="/var/db/postfix/";
$curr_time = time();
for ($z = 0; $z > $days; $z--){
@@ -71,7 +72,7 @@ if ($z==0)
$postfix_db=date("Y-m-d");
else
$postfix_db=date("Y-m-d",strtotime("$z day",$curr_time));
-
+
if (file_exists($postfix_dir.'/'.$postfix_db.".db")){
#noqueue
open_table();
@@ -83,7 +84,7 @@ if (file_exists($postfix_dir.'/'.$postfix_db.".db")){
$stm="select count(*) as total from mail_noqueue";
$result = sqlite_query($dbhandle, $stm);
$row_noqueue = sqlite_fetch_array($result, SQLITE_ASSOC);
-
+
#queue
$result = sqlite_query($dbhandle, $stm);
$stm="select mail_status.info as status,count(*) as total from mail_to,mail_status where mail_to.status=mail_status.id group by status order by mail_status.info";
@@ -96,7 +97,7 @@ if (file_exists($postfix_dir.'/'.$postfix_db.".db")){
if (preg_match("/\w+/",$row['status'])){
$reader.="<td class=\"listlr\"width=50%><strong>".ucfirst($row['status'])."</strong></td>\n";
if ($row['status']=="reject")
- $row['total']=+$row_noqueue['total'];
+ $row['total']=+$row_noqueue['total'];
$count.="<td class=\"listlr\">".$row['total']."</td>\n";
}
}
@@ -111,7 +112,7 @@ if (file_exists($postfix_dir.'/'.$postfix_db.".db")){
}
close_table();
echo "<br>";
-
+
}
}
echo" </tr>";
diff --git a/config/postfix/postfix.xml b/config/postfix/postfix.xml
index 59e58f41..8e70fd7a 100644
--- a/config/postfix/postfix.xml
+++ b/config/postfix/postfix.xml
@@ -10,7 +10,7 @@
postfix.xml
part of the Postfix package for pfSense
Copyright (C) 2010 Erik Fonnesbeck
- Copyright (C) 2011-2013 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
*/
@@ -354,7 +354,7 @@
postfix_php_deinstall_command();
</custom_php_deinstall_command>
<custom_php_validation_command>
- postfix_validate_input($_POST, &amp;$input_errors);
+ postfix_validate_input($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_postfix();
diff --git a/config/postfix/postfix_about.php b/config/postfix/postfix_about.php
index 87d0cf69..397c8e06 100755
--- a/config/postfix/postfix_about.php
+++ b/config/postfix/postfix_about.php
@@ -2,7 +2,7 @@
/*
postfix_about.php
part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2011-2013 Marcello Coutinho <marcellocoutinho@gmail.com>
+ Copyright (C) 2011-2014 Marcello Coutinho <marcellocoutinho@gmail.com>
based on varnish_view_config.
All rights reserved.
@@ -48,7 +48,7 @@ include("head.inc");
<?php if ($savemsg) print_info_box($savemsg); ?>
<!-- <form action="postfix_view_config.php" method="post"> -->
-
+
<div id="mainlevel">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
@@ -68,7 +68,7 @@ include("head.inc");
?>
</td></tr>
<tr>
-
+
<td>
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellpadding="8" cellspacing="0">
@@ -86,11 +86,11 @@ include("head.inc");
If you want that your donation goes to this package developer, make a note on donation forwarding it to me.<br><br>");?></td>
</tr>
</table>
-
+
</div>
</td>
</tr>
-
+
</table>
<br>
diff --git a/config/postfix/postfix_acl.xml b/config/postfix/postfix_acl.xml
index d704c189..8df5255e 100644
--- a/config/postfix/postfix_acl.xml
+++ b/config/postfix/postfix_acl.xml
@@ -9,7 +9,7 @@
/*
postfix.xml
part of the Postfix package for pfSense
- Copyright (C) 2011-2013 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
*/
/* ========================================================================== */
@@ -221,7 +221,7 @@
postfix_php_deinstall_command();
</custom_php_deinstall_command>
<custom_php_validation_command>
- postfix_validate_input($_POST, &amp;$input_errors);
+ postfix_validate_input($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_postfix();
diff --git a/config/postfix/postfix_antispam.xml b/config/postfix/postfix_antispam.xml
index 94f52f35..9d55e47e 100644
--- a/config/postfix/postfix_antispam.xml
+++ b/config/postfix/postfix_antispam.xml
@@ -7,9 +7,9 @@
/* $Id$ */
/* ========================================================================== */
/*
- postfix.xml
+ postfix_antispam.xml
part of the Postfix package for pfSense
- Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
*/
@@ -279,7 +279,7 @@
postfix_php_deinstall_command();
</custom_php_deinstall_command>
<custom_php_validation_command>
- postfix_validate_input($_POST, &amp;$input_errors);
+ postfix_validate_input($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_postfix();
diff --git a/config/postfix/postfix_domains.xml b/config/postfix/postfix_domains.xml
index 23d80e12..ea19297d 100644
--- a/config/postfix/postfix_domains.xml
+++ b/config/postfix/postfix_domains.xml
@@ -7,10 +7,10 @@
/* $Id$ */
/* ========================================================================== */
/*
- postfix.xml
+ postfix_domains.xml
part of the Postfix package for pfSense
Copyright (C) 2010 Erik Fonnesbeck
- Copyright (C) 2011 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
*/
@@ -137,7 +137,7 @@
postfix_php_deinstall_command();
</custom_php_deinstall_command>
<custom_php_validation_command>
- postfix_validate_input($_POST, &amp;$input_errors);
+ postfix_validate_input($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_postfix();
diff --git a/config/postfix/postfix_queue.php b/config/postfix/postfix_queue.php
index ba760259..a737340e 100755
--- a/config/postfix/postfix_queue.php
+++ b/config/postfix/postfix_queue.php
@@ -2,7 +2,7 @@
/*
postfix_view_config.php
part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2011-2013 Marcello Coutinho <marcellocoutinho@gmail.com>
+ Copyright (C) 2011-2014 Marcello Coutinho <marcellocoutinho@gmail.com>
based on varnish_view_config.
All rights reserved.
@@ -34,12 +34,11 @@ $uname=posix_uname();
if ($uname['machine']=='amd64')
ini_set('memory_limit', '250M');
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version > 2.0)
+if (is_dir('/usr/pbi/postfix-' . php_uname("m"))) {
define('POSTFIX_LOCALBASE', '/usr/pbi/postfix-' . php_uname("m"));
-else
- define('POSTFIX_LOCALBASE','/usr/local');
-
+} else {
+ define('POSTFIX_LOCALBASE','/usr/local');
+}
function get_cmd(){
if ($_REQUEST['cmd'] =='mailq'){
#exec("/usr/local/bin/mailq" . escapeshellarg('^'.$m.$j." ".$hour.".*".$grep)." /var/log/maillog", $lists);
@@ -67,13 +66,13 @@ function get_cmd(){
elseif (preg_match("/\s+(\w+.*)/",$line,$matches) && $sid !=""){
print $td.$matches[1].'</td></tr>';
$sid="";
- }
+ }
}
print '</table>';
}
if ($_REQUEST['cmd'] =='qshape'){
if ($_REQUEST['qshape']!="")
- exec(POSTFIX_LOCALBASE."/bin/qshape -".preg_replace("/\W/","",$_REQUEST['type'])." ". preg_replace("/\W/","",$_REQUEST['qshape']), $qshape);
+ exec(POSTFIX_LOCALBASE."/bin/qshape -".preg_replace("/\W/","",$_REQUEST['type'])." ". preg_replace("/\W/","",$_REQUEST['qshape']), $qshape);
else
exec(POSTFIX_LOCALBASE."/bin/qshape", $qshape);
print '<table class="tabcont" width="100%" border="0" cellpadding="8" cellspacing="0">';
@@ -107,22 +106,22 @@ else{
$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
if ($pf_version < 2.0)
$one_two = true;
-
+
$pgtitle = "Status: Postfix Mail Queue";
include("head.inc");
-
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-
+
<?php if($one_two): ?>
<p class="pgtitle"><?=$pgtitle?></font></p>
<?php endif; ?>
-
+
<?php if ($savemsg) print_info_box($savemsg); ?>
-
+
<form action="postfix_view_config.php" method="post">
-
+
<div id="mainlevel">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
@@ -167,7 +166,7 @@ else{
<option value="1" selected>Never</option>
</select><br><?=gettext("Select how often queue cmd will run.");?></td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("qshape Report flags: ");?></td>
<td width="78%" class="vtable">
<select name="drop3" id="qshape" multiple="multiple" size="5">
@@ -178,7 +177,7 @@ else{
<option value="maildrop">maildrop</option>
</select><br><?=gettext("Select how often queue will be queried.");?></td>
</tr>
- <tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("qshape Report type: ");?></td>
<td width="78%" class="vtable">
<select name="drop3" id="qtype">
@@ -201,7 +200,7 @@ else{
<tr>
<td class="tabcont" >
<div id="file_div"></div>
-
+
</td>
</tr>
</table>
@@ -223,7 +222,7 @@ else{
}
return(selectedArray);
}
-
+
function get_queue(loop) {
//prevent multiple instances
if ($('run').value=="show queue" || loop== 'running'){
@@ -255,7 +254,7 @@ else{
}
}
</script>
- <?php
+ <?php
include("fend.inc");
}
?>
diff --git a/config/postfix/postfix_recipients.xml b/config/postfix/postfix_recipients.xml
index 2b07bae8..946bd79f 100644
--- a/config/postfix/postfix_recipients.xml
+++ b/config/postfix/postfix_recipients.xml
@@ -9,7 +9,7 @@
/*
postfix_recipients.xml
part of the Postfix package for pfSense
- Copyright (C) 2011-2013 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
*/
/* ========================================================================== */
@@ -192,7 +192,7 @@
postfix_php_deinstall_command();
</custom_php_deinstall_command>
<custom_php_validation_command>
- postfix_validate_input($_POST, &amp;$input_errors);
+ postfix_validate_input($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_postfix();
diff --git a/config/postfix/postfix_search.php b/config/postfix/postfix_search.php
index c29d8cf2..5e146269 100755
--- a/config/postfix/postfix_search.php
+++ b/config/postfix/postfix_search.php
@@ -2,7 +2,7 @@
/*
postfix_search.php
part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2011-2013 Marcello Coutinho <marcellocoutinho@gmail.com>
+ Copyright (C) 2011-2014 Marcello Coutinho <marcellocoutinho@gmail.com>
based on varnish_view_config.
All rights reserved.
@@ -52,7 +52,7 @@ include("head.inc");
<?php if ($savemsg) print_info_box($savemsg); ?>
<!-- <form action="postfix_view_config.php" method="post"> -->
-
+
<div id="mainlevel">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
@@ -72,7 +72,7 @@ include("head.inc");
?>
</td></tr>
<tr>
-
+
<td>
<div id="mainarea">
<table class="tabcont" width="100%" border="0" cellpadding="8" cellspacing="0">
@@ -151,7 +151,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Sqlite files: ");?></td>
<td width="78%" class="vtable">
-
+
<?php if ($handle = opendir('/var/db/postfix')) {
$total_files=0;
$array_files=array();
@@ -159,14 +159,14 @@ include("head.inc");
if (preg_match("/(\d+-\d+-\d+).db$/",$file,$matches))
$array_files[]=array($file,$matches[1]);
closedir($handle);
- asort($array_files);
+ asort($array_files);
foreach ($array_files as $file)
$select_output= '<option value="'.$file[0].'">'.$file[1]."</option>\n" . $select_output;
-
+
echo '<select name="drop1" id="Select1" size="'.(count($array_files)>10?10:count($array_files)+2).'" multiple="multiple">';
echo $select_output;
echo '</select><br>'.gettext("Select what database files you want to use in your search.").'</td></td>';
- }?>
+ }?>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Message Fields: ");?></td>
@@ -188,17 +188,17 @@ include("head.inc");
<option value="helo">Helo</option>
</select><br><?=gettext("Max log messages to fetch per Sqlite file.");?></td>
</tr>
-
+
<tr>
<td width="22%" valign="top"></td>
<td width="78%"><input name="Submit" type="submit" class="formbtn" id="search" value="<?=gettext("Search");?>" onclick="getsearch_results('search')">
&nbsp;<input name="Submit" type="submit" class="formbtn" id="export" value="<?=gettext("Export");?>" onclick="getsearch_results('export')"></td>
</table>
-
+
</div>
</td>
</tr>
-
+
</table>
<br>
diff --git a/config/postfix/postfix_sync.xml b/config/postfix/postfix_sync.xml
index 88617fbf..727305ff 100644
--- a/config/postfix/postfix_sync.xml
+++ b/config/postfix/postfix_sync.xml
@@ -9,7 +9,7 @@
/*
postfix_sync.xml
part of the Postfix package for pfSense
- Copyright (C) 2011-2013 Marcello Coutinho
+ Copyright (C) 2011-2014 Marcello Coutinho
All rights reserved.
*/
/* ========================================================================== */
@@ -193,7 +193,7 @@
postfix_php_deinstall_command();
</custom_php_deinstall_command>
<custom_php_validation_command>
- postfix_validate_input($_POST, &amp;$input_errors);
+ postfix_validate_input($_POST, $input_errors);
</custom_php_validation_command>
<custom_php_resync_config_command>
sync_package_postfix();
diff --git a/config/postfix/postfix_view_config.php b/config/postfix/postfix_view_config.php
index 24bfd575..a844ce65 100644
--- a/config/postfix/postfix_view_config.php
+++ b/config/postfix/postfix_view_config.php
@@ -2,7 +2,7 @@
/*
postfix_view_config.php
part of pfSense (https://www.pfsense.org/)
- Copyright (C) 2011-2013 Marcello Coutinho <marcellocoutinho@gmail.com>
+ Copyright (C) 2011-2014 Marcello Coutinho <marcellocoutinho@gmail.com>
based on varnish_view_config.
All rights reserved.
@@ -29,12 +29,12 @@
*/
$shortcut_section = "postfix";
require("guiconfig.inc");
-$pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
-if ($pf_version > 2.0)
+if (is_dir('/usr/pbi/postfix-' . php_uname("m"))) {
define('POSTFIX_LOCALBASE', '/usr/pbi/postfix-' . php_uname("m"));
-else
- define('POSTFIX_LOCALBASE','/usr/local');
-
+} else {
+ define('POSTFIX_LOCALBASE','/usr/local');
+}
+
function get_file($file){
$files['main']=POSTFIX_LOCALBASE."/etc/postfix/main.cf";
$files['master']=POSTFIX_LOCALBASE."/etc/postfix/master.cf";
@@ -59,22 +59,22 @@ else{
$pfSversion = str_replace("\n", "", file_get_contents("/etc/version"));
if ($pf_version < 2.0)
$one_two = true;
-
+
$pgtitle = "Services: Postfix View Configuration";
include("head.inc");
-
+
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
-
+
<?php if($one_two): ?>
<p class="pgtitle"><?=$pgtitle?></font></p>
<?php endif; ?>
-
+
<?php if ($savemsg) print_info_box($savemsg); ?>
-
+
<form action="postfix_view_config.php" method="post">
-
+
<div id="mainlevel">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
@@ -117,7 +117,7 @@ else{
<tr>
<td class="tabcont" >
<div id="file_div"></div>
-
+
</td>
</tr>
</table>
@@ -153,8 +153,8 @@ else{
scroll(0,0);
}
</script>
- <?php
- include("fend.inc");
+ <?php
+ include("fend.inc");
}
?>
</body>
'>2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763