From 3d28caf759d4e290f794ee3fb14e5911f6c4d260 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 8 Aug 2016 05:00:39 +0000 Subject: [PATCH 1/4] change error message depending on whether templates_c is present or not git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1855 a1433add-5e2c-0410-b055-b7f2511e0802 --- setup.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/setup.php b/setup.php index da1fb5dc..e48a4662 100644 --- a/setup.php +++ b/setup.php @@ -152,10 +152,17 @@ else if (!is_writeable($incpath.'/templates_c')) { - print "
  • Error: Smarty template compile directory templates_c is not writable.
    \n"; - print "Please make it writable.
    \n"; - print "If you are using SELinux or AppArmor, you might need to adjust their setup to allow write access.
    \n"; - $error =+ 1; + if(!is_dir($incpath . '/templates_c')) { + print "
  • Error: Smarty template compile directory templates_c not found.
    \n"; + echo "Please mkdir -p $incpath/templates_c and make it writeable by the web server\n"; + $error =+ 1; + } + else { + print "
  • Error: Smarty template compile directory templates_c is not writable.
    \n"; + print "Please make it writable.
    \n"; + print "If you are using SELinux or AppArmor, you might need to adjust their setup to allow write access.
    \n"; + $error =+ 1; + } } else { print "
  • Smarty template compile directory is writable - OK
    \n"; } From 483bb83edc510a98d8387d7652df28f08c98cf3a Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Wed, 10 Aug 2016 10:54:53 +0000 Subject: [PATCH 2/4] see #377 - looks like the pg+mysql check is partly the wrong way around - mysql only has ints.... git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1856 a1433add-5e2c-0410-b055-b7f2511e0802 --- ADDITIONS/fetchmail.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ADDITIONS/fetchmail.pl b/ADDITIONS/fetchmail.pl index 5986d2b7..f68c4aa1 100644 --- a/ADDITIONS/fetchmail.pl +++ b/ADDITIONS/fetchmail.pl @@ -81,9 +81,9 @@ $lockmgr->lock($lock_file) || log_and_die "can't lock ${lock_file}"; $dbh = DBI->connect($dsn, $db_username, $db_password) || log_and_die "cannot connect the database"; if($db_type eq "Pg") { - $sql_cond = "active = 1 AND date_part('epoch',now())-date_part('epoch',date)"; + $sql_cond = "active = 't' AND date_part('epoch',now())-date_part('epoch',date)"; } elsif($db_type eq "mysql") { - $sql_cond = "active = 't' AND unix_timestamp(now())-unix_timestamp(date)"; + $sql_cond = "active = 1 AND unix_timestamp(now())-unix_timestamp(date)"; } $sql = " From 054d0a4c0e4d7853fa0998f62d769fe87ecb7a77 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Thu, 25 Aug 2016 18:56:02 +0000 Subject: [PATCH 3/4] vacation.pl: mime-decode original subject Reported by czbg, https://sourceforge.net/p/postfixadmin/bugs/366/ Note that the original subject will keep the encoding specified in the mime header (for example iso-8859-15) while we assume it to be utf8 (see "%mail =..."). Nevertheless, a broken character still looks better than having =?ISO-8858-1?Q?Gr=DFe?= in the subject ;-) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1857 a1433add-5e2c-0410-b055-b7f2511e0802 --- VIRTUAL_VACATION/vacation.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VIRTUAL_VACATION/vacation.pl b/VIRTUAL_VACATION/vacation.pl index b7f929a3..06a787c0 100644 --- a/VIRTUAL_VACATION/vacation.pl +++ b/VIRTUAL_VACATION/vacation.pl @@ -117,7 +117,7 @@ use utf8; use DBI; use MIME::Base64 qw(encode_base64); -use Encode qw(encode); +use Encode qw(encode decode); use MIME::EncWords qw(:all); use Email::Valid; use strict; @@ -522,6 +522,7 @@ sub send_vacation_email { $logger->debug("Will send vacation response for $orig_messageid: FROM: $email (orig_to: $orig_to), TO: $orig_from; VACATION SUBJECT: $row[0] ; VACATION BODY: $row[1]"); my $subject = $row[0]; + $orig_subject = decode("mime-header", $orig_subject); $subject =~ s/\$SUBJECT/$orig_subject/g; if ($subject ne $row[0]) { $logger->debug("Patched Subject of vacation message to: $subject"); From 2a6247a6d953cae83d8bcb271bb7250f0fb33ad7 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Fri, 9 Sep 2016 19:43:18 +0000 Subject: [PATCH 4/4] db_connect(): drop unused variable $succes(s) One of the variable names had a typo [1], and since those variables are unused, the best way is to drop them. [1] reported by tfarina, https://github.com/postfixadmin/postfixadmin/issues/15 git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1858 a1433add-5e2c-0410-b055-b7f2511e0802 --- functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index b116951c..734e74d2 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1250,7 +1250,7 @@ function db_connect ($ignore_errors = 0) { if ($link) { @mysql_query("SET CHARACTER SET utf8",$link); @mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'",$link); - $succes = @mysql_select_db ($CONF['database_name'], $link) or $error_text .= ("

    DEBUG INFORMATION:
    MySQL Select Database: " . mysql_error () . "$DEBUG_TEXT"); + @mysql_select_db ($CONF['database_name'], $link) or $error_text .= ("

    DEBUG INFORMATION:
    MySQL Select Database: " . mysql_error () . "$DEBUG_TEXT"); } } else { $error_text .= "

    DEBUG INFORMATION:
    MySQL 3.x / 4.0 functions not available! (php5-mysql installed?)
    database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; @@ -1261,7 +1261,7 @@ function db_connect ($ignore_errors = 0) { if ($link) { @mysqli_query($link,"SET CHARACTER SET utf8"); @mysqli_query($link,"SET COLLATION_CONNECTION='utf8_general_ci'"); - $success = @mysqli_select_db ($link, $CONF['database_name']) or $error_text .= ("

    DEBUG INFORMATION:
    MySQLi Select Database: " . mysqli_error ($link) . "$DEBUG_TEXT"); + @mysqli_select_db ($link, $CONF['database_name']) or $error_text .= ("

    DEBUG INFORMATION:
    MySQLi Select Database: " . mysqli_error ($link) . "$DEBUG_TEXT"); } } else { $error_text .= "

    DEBUG INFORMATION:
    MySQL 4.1 functions not available! (php5-mysqli installed?)
    database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT";