postfixadmin-svn Mailing List for PostfixAdmin (Page 99)
Brought to you by:
christian_boltz,
gingerdog
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
(63) |
Nov
(79) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(15) |
Feb
(8) |
Mar
(8) |
Apr
(44) |
May
(18) |
Jun
(20) |
Jul
(35) |
Aug
(21) |
Sep
(8) |
Oct
(9) |
Nov
(21) |
Dec
(14) |
2009 |
Jan
(53) |
Feb
(13) |
Mar
(36) |
Apr
(40) |
May
(22) |
Jun
(10) |
Jul
(18) |
Aug
(18) |
Sep
(7) |
Oct
(26) |
Nov
(32) |
Dec
(13) |
2010 |
Jan
(6) |
Feb
(7) |
Mar
(12) |
Apr
(2) |
May
(12) |
Jun
(8) |
Jul
(9) |
Aug
(12) |
Sep
(12) |
Oct
(7) |
Nov
(9) |
Dec
(42) |
2011 |
Jan
(10) |
Feb
(35) |
Mar
(43) |
Apr
(39) |
May
(8) |
Jun
(8) |
Jul
(83) |
Aug
(20) |
Sep
(20) |
Oct
(63) |
Nov
(33) |
Dec
(20) |
2012 |
Jan
(28) |
Feb
(3) |
Mar
(1) |
Apr
(37) |
May
(16) |
Jun
(7) |
Jul
(3) |
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(4) |
2013 |
Jan
(6) |
Feb
(16) |
Mar
(9) |
Apr
(11) |
May
(9) |
Jun
(30) |
Jul
(17) |
Aug
(6) |
Sep
(2) |
Oct
(30) |
Nov
(41) |
Dec
(26) |
2014 |
Jan
(16) |
Feb
(20) |
Mar
(5) |
Apr
(4) |
May
(14) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(18) |
Nov
(26) |
Dec
|
2015 |
Jan
(4) |
Feb
(9) |
Mar
(12) |
Apr
(26) |
May
(3) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(15) |
Oct
(13) |
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
(5) |
Mar
(4) |
Apr
(3) |
May
(19) |
Jun
|
Jul
|
Aug
(3) |
Sep
(16) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
2017 |
Jan
(1) |
Feb
(8) |
Mar
|
Apr
(7) |
May
(3) |
Jun
(16) |
Jul
(13) |
Aug
(16) |
Sep
(6) |
Oct
(4) |
Nov
(10) |
Dec
(7) |
2018 |
Jan
(16) |
Feb
(17) |
Mar
(11) |
Apr
(13) |
May
(20) |
Jun
(3) |
Jul
(10) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(6) |
Dec
(18) |
2019 |
Jan
(18) |
Feb
(31) |
Mar
(4) |
Apr
(4) |
May
(1) |
Jun
(8) |
Jul
(7) |
Aug
(10) |
Sep
(23) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2020 |
Jan
(10) |
Feb
(18) |
Mar
(34) |
Apr
(19) |
May
(6) |
Jun
(9) |
Jul
|
Aug
(10) |
Sep
(16) |
Oct
(6) |
Nov
(3) |
Dec
(11) |
2021 |
Jan
(118) |
Feb
(22) |
Mar
(13) |
Apr
(12) |
May
(48) |
Jun
(21) |
Jul
(17) |
Aug
(12) |
Sep
(19) |
Oct
(25) |
Nov
(16) |
Dec
(7) |
2022 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(4) |
May
|
Jun
(16) |
Jul
(18) |
Aug
(5) |
Sep
(12) |
Oct
(8) |
Nov
(10) |
Dec
(13) |
2023 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(6) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(2) |
Nov
(7) |
Dec
(13) |
2024 |
Jan
(8) |
Feb
(6) |
Mar
(5) |
Apr
(10) |
May
(8) |
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(4) |
Nov
(15) |
Dec
(10) |
2025 |
Jan
(3) |
Feb
(12) |
Mar
(3) |
Apr
(7) |
May
(18) |
Jun
(10) |
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <Gin...@us...> - 2009-01-18 12:09:18
|
Revision: 530 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=530&view=rev Author: GingerDog Date: 2009-01-18 12:05:14 +0000 (Sun, 18 Jan 2009) Log Message: ----------- quota_usage.pl: copying in from trunk Added Paths: ----------- branches/postfixadmin-2.3beta/ADDITIONS/quota_usage.pl Copied: branches/postfixadmin-2.3beta/ADDITIONS/quota_usage.pl (from rev 529, trunk/ADDITIONS/quota_usage.pl) =================================================================== --- branches/postfixadmin-2.3beta/ADDITIONS/quota_usage.pl (rev 0) +++ branches/postfixadmin-2.3beta/ADDITIONS/quota_usage.pl 2009-01-18 12:05:14 UTC (rev 530) @@ -0,0 +1,140 @@ +#!/usr/bin/perl +# vim:ts=4:sw=4:et +# +# Contributed to Postfixadmin by Jose Nilton <jni...@gm...> +# +# See also : http://www.russelldare.net/media/perl/dirsizeSource.pdf +# License: GPL v2. + +# Usage: +# perl quota_usage.pl --list or +# perl quota_usage.pl --addmysql for add mysql database postfix +# +# Requires: perl perl-DBD-mysql perl-DBD (may be named differently depending on your platform). +# and the 'du' binary in $ENV{'PATH'} (see below). +# +# You will need to modify the postfix DATABASE to add a quota_usage column. +# Mysql: +# ALTER TABLE mailbox ADD quota_usage INT(11) NOT NULL DEFAULT '0' AFTER modified, +# ADD quota_usage_date DATE NOT NULL DEFAULT '0000-00-00' AFTER quota_usage; +# PostgreSQL: +# ALTER TABLE mailbox ADD COLUMN quota_usage INTEGER NOT NULL DEFAULT 0; +# ALTER TABLE mailbox ADD COLUMN quota_usage_date DATE NOT NULL DEFAULT current_date; +# + +use strict; +use warnings; +use File::Path; +use DBI; +use Getopt::Long; + +##EDIT## +my $db_host = 'localhost'; +my $db_database = 'postfix'; +my $db_user = 'postfix'; +my $db_password = '123456'; +my $root_path = '/home/vmail'; +# Pg or mysql +my $db_type = 'Pg'; +##END EDIT## + +$ENV{'PATH'} = "/sbin:/bin:/usr/sbin:/usr/bin"; +my($domain_dir, $full_domain_dir, $user_dir, $usage, $email, $sql, $dbh); + +GetOptions ('list' => \&list_quota_usage, 'addmysql' => \&insert_to_db); + +sub list_quota_usage { + opendir(DOMAINDIR, $root_path) or die ("Unable to access directory '$root_path' ($!)"); + + foreach $domain_dir (sort readdir DOMAINDIR) { + next if $domain_dir =~ /^\./; # skip dotted dirs + $full_domain_dir = "$root_path/$domain_dir"; #print "$full_domain_dir\n"; + + opendir(USERDIR, $full_domain_dir) or die ("Unable to access directory '$full_domain_dir' ($!)"); + foreach $user_dir (sort readdir USERDIR) { + next if $user_dir =~ /^\./; # skip dotted dirs + $email = "$user_dir\@$domain_dir"; + + my $i = `du -0 --summarize $full_domain_dir/$user_dir`; + ($usage) = split(" ", $i); + + if ($usage < 100) { + $usage = 0; + } elsif ($usage < 1000) { + $usage = 1; + } else { + $usage = $usage + 500; + $usage = int $usage / 1000; + } + + list_out(); + } + } + close(DOMAINDIR); + close(USERDIR); +} + + +sub insert_to_db { + opendir(DOMAINDIR, $root_path) or die ("Unable to access directory '$root_path' ($!)"); + + $dbh = DBI->connect("DBI:$db_type:database=$db_database;host=$db_host", $db_user, $db_password) or die ("cannot connect the database"); + execSql("UPDATE mailbox set quota_usage = 0"); + + + foreach $domain_dir (sort readdir DOMAINDIR) { + next if $domain_dir =~ /^\./; # skip dotted dirs + $full_domain_dir = "$root_path/$domain_dir"; #print "$full_domain_dir\n"; + + opendir(USERDIR, $full_domain_dir) or die ("Unable to access directory '$full_domain_dir' ($!)"); + foreach $user_dir (sort readdir USERDIR) { + next if $user_dir =~ /^\./; # skip dotted dirs + $email = "$user_dir\@$domain_dir"; + + my $i = `du -0 --summarize $full_domain_dir/$user_dir`; + ($usage) = split(" ", $i); + + if ($usage < 100) { + $usage = 0; + } elsif ($usage < 1000) { + $usage = 1; + } else { + $usage = $usage + 500; + $usage = int $usage / 1000; + } + + execSql("UPDATE mailbox set quota_usage = $usage, quota_usage_date = CAST(NOW() AS DATE) WHERE username = '$email'"); +#list_out(); #Debug + } + + } + + close(DOMAINDIR); + close(USERDIR); + +} + + +sub execSql { + my $sql = shift; + my $ex; + $ex = $dbh->do($sql) or die ("error when running $sql"); +} + +sub list_out { +format STDOUT_TOP = +Report of Quota Used +-------------------------- +EMAIL QUOTA USED +------------------------------------------------------------------ +. + + +format = +@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<< +$email, "$usage\bMB" +. + + write; +} + Property changes on: branches/postfixadmin-2.3beta/ADDITIONS/quota_usage.pl ___________________________________________________________________ Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-17 20:15:09
|
Revision: 528 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=528&view=rev Author: GingerDog Date: 2009-01-17 20:15:04 +0000 (Sat, 17 Jan 2009) Log Message: ----------- branch to 2.3beta Added Paths: ----------- branches/postfixadmin-2.3beta/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-17 20:09:54
|
Revision: 527 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=527&view=rev Author: GingerDog Date: 2009-01-17 20:09:43 +0000 (Sat, 17 Jan 2009) Log Message: ----------- update in preparation for beta release Modified Paths: -------------- trunk/CHANGELOG.TXT trunk/debian/changelog Modified: trunk/CHANGELOG.TXT =================================================================== --- trunk/CHANGELOG.TXT 2009-01-16 18:17:18 UTC (rev 526) +++ trunk/CHANGELOG.TXT 2009-01-17 20:09:43 UTC (rev 527) @@ -14,7 +14,7 @@ Only in SVN trunk -------------------- -Version 2.3 Beta - 2009/01/15 - SVN r523 +Version 2.3 Beta - 2009/01/15 - SVN r527 ----------------------------------------- - added support for domain aliases (from lenix) (can be disabled with $CONF['alias_domain']) Modified: trunk/debian/changelog =================================================================== --- trunk/debian/changelog 2009-01-16 18:17:18 UTC (rev 526) +++ trunk/debian/changelog 2009-01-17 20:09:43 UTC (rev 527) @@ -1,3 +1,18 @@ +postfixadmin (2.3beta) unstable; urgency=low + + * Subversion revision 527 + * Fixes for MySQL upgrade issues + * Improved vacation.pl (renotification options, use SMTP headers, better + logging, optional external config file) + * Improved fetchmail.pl + * Domain aliases - new implementation should reduce backscatter etc. + * translation updates + * Added domain-postcreation script support + * Enhanced mailbox table to make it easier for people to customise where mailboxes live + * and much more + + -- David Goodwin <dav...@pa...> Sat, 17 Jan 2009 20:06:00 +0000 + postfixadmin (2.2.1.1) unstable; urgency=low * Subversion revision 412 (from branches/postfixadmin-2.2.1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-16 18:17:21
|
Revision: 526 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=526&view=rev Author: GingerDog Date: 2009-01-16 18:17:18 +0000 (Fri, 16 Jan 2009) Log Message: ----------- updated fi.lang from Jorma Tuomainen <jor...@wa...> Modified Paths: -------------- trunk/languages/fi.lang Modified: trunk/languages/fi.lang =================================================================== --- trunk/languages/fi.lang 2009-01-15 14:32:43 UTC (rev 525) +++ trunk/languages/fi.lang 2009-01-16 18:17:18 UTC (rev 526) @@ -3,38 +3,35 @@ // // Language file Finnish // by Palo +// additions by: Ecome Finland Oy, Jorma Tuomainen <jo...@wa...> // -# XXX @translators: This file has several untranslated strings that are NOT marked with XXX -# XXX Please check the whole file and remove this comment afterwards. - $PALANG['YES'] = 'Kyllä'; $PALANG['NO'] = 'Ei'; $PALANG['edit'] = 'muokkaa'; $PALANG['del'] = 'poista'; -$PALANG['exit'] = 'Exit'; # XXX -$PALANG['cancel'] = 'Cancel'; # XXX -$PALANG['save'] = 'Save'; # XXX +$PALANG['exit'] = 'Poistu'; +$PALANG['cancel'] = 'Peruuta'; +$PALANG['save'] = 'Tallenna'; $PALANG['confirm'] = 'Oletko varma että haluat poistaa tämän?\n'; $PALANG['confirm_domain'] = 'Oletko varma että haluat poistaa kaikki tietueet tästä domainista? Tätä komentoa ei voi perua!\n'; -$PALANG['check_update'] = 'Check for update'; # XXX -$PALANG['invalid_parameter'] = 'Invalid parameter!'; # XXX -$PALANG['pFooter_logged_as'] = 'Logged as %s'; # XXX +$PALANG['check_update'] = 'Tarkista päivitykset'; +$PALANG['invalid_parameter'] = 'Viallinen parametri!'; +$PALANG['pFooter_logged_as'] = 'Kirjautunut sisään tunnuksella %s'; $PALANG['pLogin_welcome'] = 'Kirjautuminen'; $PALANG['pLogin_username'] = 'Tunnus'; $PALANG['pLogin_password'] = 'Salasana'; $PALANG['pLogin_button'] = 'Kirjaudu'; -$PALANG['pLogin_username_incorrect'] = '<span class="error_msg">Tunnus tai salasana väärin!</span>'; -$PALANG['pLogin_password_incorrect'] = '<span class="error_msg">Tunnus tai salasana väärin!</span>'; +$PALANG['pLogin_failed'] = '<span class="error_msg">Sähköpostiosoite tai salasana väärin!</span>'; $PALANG['pLogin_login_users'] = 'Käyttäjien kirjautuminen.'; -$PALANG['pMenu_main'] = 'Main'; # XXX +$PALANG['pMenu_main'] = 'Etusivu'; $PALANG['pMenu_overview'] = 'Yleisnäkymä'; $PALANG['pMenu_create_alias'] = 'Lisää alias'; -$PALANG['pMenu_create_alias_domain'] = 'Add Alias Domain'; # XXX +$PALANG['pMenu_create_alias_domain'] = 'Lisää alias domain'; $PALANG['pMenu_create_mailbox'] = 'Lisää postilaatikko'; -$PALANG['pMenu_fetchmail'] = 'Fetch Email'; # XXX +$PALANG['pMenu_fetchmail'] = 'Hae sähköpostit'; $PALANG['pMenu_sendmail'] = 'Lähetä postia'; $PALANG['pMenu_password'] = 'Salasana'; $PALANG['pMenu_viewlog'] = 'Näytä loki'; @@ -49,62 +46,62 @@ $PALANG['pMain_viewlog'] = 'Näytä lokitiedostot.'; $PALANG['pMain_logout'] = 'Kirjaudu ulos järjestelmästä'; -$PALANG['pOverview_disabled'] = 'Disabled'; # XXX -$PALANG['pOverview_unlimited'] = 'Unlimited'; # XXX -$PALANG['pOverview_title'] = ':: Defined Domains'; # XXX -$PALANG['pOverview_up_arrow'] = 'Go Top'; # XXX -$PALANG['pOverview_right_arrow'] = 'Next Page'; # XXX -$PALANG['pOverview_left_arrow'] = 'Previous Page'; # XXX -$PALANG['pOverview_alias_domain_title'] = ':: Domain Aliases'; # XXX -$PALANG['pOverview_alias_title'] = ':: Alias'; # XXX -$PALANG['pOverview_mailbox_title'] = ':: Mailboxes'; # XXX +$PALANG['pOverview_disabled'] = 'Poissa käytöstä'; +$PALANG['pOverview_unlimited'] = 'Rajoittamaton'; +$PALANG['pOverview_title'] = ':: Määritellyt Domainit'; +$PALANG['pOverview_up_arrow'] = 'Mene ylös'; +$PALANG['pOverview_right_arrow'] = 'Seuraava sivu'; +$PALANG['pOverview_left_arrow'] = 'Edellinen sivu'; +$PALANG['pOverview_alias_domain_title'] = ':: Domain Aliakset'; +$PALANG['pOverview_alias_title'] = ':: Alias'; +$PALANG['pOverview_mailbox_title'] = ':: Sähköpostilaatikot'; $PALANG['pOverview_button'] = 'Siirry'; $PALANG['pOverview_welcome'] = 'Yleisnäkymä '; -$PALANG['pOverview_alias_domain_aliases'] = 'Alias Domains'; # XXX -$PALANG['pOverview_alias_domain_target'] = '%s is an Alias Domain for:'; # XXX +$PALANG['pOverview_alias_domain_aliases'] = 'Alias Domainit'; +$PALANG['pOverview_alias_domain_target'] = '%s on Alias Domaini domainille:'; $PALANG['pOverview_alias_alias_count'] = 'Aliakset'; $PALANG['pOverview_alias_mailbox_count'] = 'Postilaatikot'; $PALANG['pOverview_alias_address'] = 'Keneltä'; $PALANG['pOverview_alias_goto'] = 'Kenelle'; $PALANG['pOverview_alias_modified'] = 'Viimeksi muokattu'; -$PALANG['pOverview_alias_domain_modified'] = 'Last Modified'; # XXX -$PALANG['pOverview_alias_active'] = 'Active'; # XXX -$PALANG['pOverview_alias_domain_active'] = 'Active'; # XXX -$PALANG['pOverview_alias_edit'] = 'Alias'; # XXX -$PALANG['and_x_more'] = '[and %s more...]'; # XXX +$PALANG['pOverview_alias_domain_modified'] = 'Viimeksi muokattu'; +$PALANG['pOverview_alias_active'] = 'Aktiivinen'; +$PALANG['pOverview_alias_domain_active'] = 'Aktiivinen'; +$PALANG['pOverview_alias_edit'] = 'Alias'; +$PALANG['and_x_more'] = '[ja %s lisää...]'; $PALANG['pOverview_mailbox_username'] = 'Sähköposti'; $PALANG['pOverview_mailbox_name'] = 'Nimi'; $PALANG['pOverview_mailbox_quota'] = 'Kiintiö (MB)'; $PALANG['pOverview_mailbox_modified'] = 'Viimeksi muokattu'; $PALANG['pOverview_mailbox_active'] = 'Aktiivinen'; -$PALANG['pOverview_vacation_edit'] = 'VACATION IS ON'; # XXX -$PALANG['pOverview_vacation_option'] = 'Set Vacation'; # XXX +$PALANG['pOverview_vacation_edit'] = 'Lomavastaaja on päällä'; +$PALANG['pOverview_vacation_option'] = 'Aseta lomavastaaja'; $PALANG['pOverview_get_domain'] = 'Domain'; $PALANG['pOverview_get_aliases'] = 'Aliakset'; -$PALANG['pOverview_get_alias_domains'] = 'Domain Aliases'; # XXX +$PALANG['pOverview_get_alias_domains'] = 'Domain Aliakset'; $PALANG['pOverview_get_mailboxes'] = 'Postilaatikot'; $PALANG['pOverview_get_quota'] = 'Postilaatikon kiintiö (MB)'; $PALANG['pOverview_get_modified'] = 'Viimeksi muokattu'; $PALANG['pDelete_delete_error'] = '<span class="error_msg">Tietueen poisto ei onnistu '; -$PALANG['pDelete_delete_success'] = '%s deleted.'; # XXX -$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox '; # XXX +$PALANG['pDelete_delete_success'] = '%s poistettu.'; +$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Sähköpostilaatikkoa ei voitu poistaa '; $PALANG['pDelete_domain_error'] = '<span class="error_msg">Tämä ei ole sinun domainisi '; -$PALANG['pDelete_domain_alias_error'] = '<span class="error_msg">This domain is not yours '; # XXX -$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias '; # XXX -$PALANG['pCreate_alias_domain_welcome'] = 'Mirror addresses of one of your domains to another.'; # XXX -$PALANG['pCreate_alias_domain_alias'] = 'Alias Domain'; # XXX -$PALANG['pCreate_alias_domain_alias_text'] = 'The domain that mails come in for.'; # XXX -$PALANG['pCreate_alias_domain_target'] = 'Target Domain'; # XXX -$PALANG['pCreate_alias_domain_target_text'] = 'The domain where mails should go to.'; # XXX -$PALANG['pCreate_alias_domain_active'] = 'Active'; # XXX -$PALANG['pCreate_alias_domain_button'] = 'Add Alias Domain'; # XXX -$PALANG['pCreate_alias_domain_error1'] = 'You are not allowed to create the chosen configuration.'; # XXX -$PALANG['pCreate_alias_domain_error2'] = 'The chosen configuration is invalid, please choose a different one!'; # XXX -$PALANG['pCreate_alias_domain_error3'] = 'Database insert failed.'; # XXX -$PALANG['pCreate_alias_domain_error4'] = 'All domains are already aliased.'; # XXX -$PALANG['pCreate_alias_domain_success'] = 'The domain alias has been added to the alias domain table!'; # XXX +$PALANG['pDelete_domain_alias_error'] = '<span class="error_msg">Tämä ei ole sinun domainisi '; +$PALANG['pDelete_alias_error'] = '<span class="error_msg">Aliasta ei voitu poistaa '; +$PALANG['pCreate_alias_domain_welcome'] = 'Peiliosoitteet domainistasi toiseen.'; +$PALANG['pCreate_alias_domain_alias'] = 'Alias Domaini'; +$PALANG['pCreate_alias_domain_alias_text'] = 'Domaini johon sähköpostit tulevat.'; +$PALANG['pCreate_alias_domain_target'] = 'Kohde Domaini'; +$PALANG['pCreate_alias_domain_target_text'] = 'Domaini johon mailien pitäisi mennä.'; +$PALANG['pCreate_alias_domain_active'] = 'Aktiivinen'; +$PALANG['pCreate_alias_domain_button'] = 'Lisää Alias Domaini'; +$PALANG['pCreate_alias_domain_error1'] = 'Sinulla ei ole oikeutta luoda valittua konfiguraatiota.'; +$PALANG['pCreate_alias_domain_error2'] = 'Valittu konfiguraatio on viallinen, ole hyvä ja valitse toinen!'; +$PALANG['pCreate_alias_domain_error3'] = 'Syöttö tietokantaan epäonnistui.'; +$PALANG['pCreate_alias_domain_error4'] = 'Kaikilla domaineilla on jo alias.'; +$PALANG['pCreate_alias_domain_success'] = 'Domainin alias on lisätty domain alias tauluun!'; $PALANG['pCreate_alias_welcome'] = 'Luo uusi alias.'; $PALANG['pCreate_alias_address'] = 'Alias'; @@ -112,7 +109,7 @@ $PALANG['pCreate_alias_address_text_error2'] = '<br /><span class="error_msg">Tämä sähköpostiosoite on jo käytössä, ole hyvä ja valitse jokin toinen!</span>'; $PALANG['pCreate_alias_address_text_error3'] = '<br /><span class="error_msg">Aliasten maksimimäärä saavutettu. Et voi lisätä aliaksia enää!</span>'; $PALANG['pCreate_alias_goto'] = 'Kenelle'; -$PALANG['pCreate_alias_active'] = 'Active'; # XXX +$PALANG['pCreate_alias_active'] = 'Aktiivinen'; $PALANG['pCreate_alias_button'] = 'Lisää alias'; $PALANG['pCreate_alias_goto_text'] = 'Minne posti lähetetään.'; $PALANG['pCreate_alias_goto_text_error'] = 'Minne sähköposti lähetetään.<br /><span class="error_msg">"Kenelle" osoite ei ole oikean muotoinen!</span>'; @@ -123,13 +120,13 @@ $PALANG['pEdit_alias_address'] = 'Alias'; $PALANG['pEdit_alias_address_error'] = '<span class="error_msg">Aliasta ei löydy!</span>'; $PALANG['pEdit_alias_goto'] = 'Kenelle'; -$PALANG['pEdit_alias_active'] = 'Active'; # XXX +$PALANG['pEdit_alias_active'] = 'Aktiivinen'; $PALANG['pEdit_alias_goto_text_error1'] = '<span class="error_msg">Et kirjoitanut mitään Kenelle: -riville</span>'; $PALANG['pEdit_alias_goto_text_error2'] = '<span class="error_msg">Antamasi sähköpostiosoite ei ole oikean muotoinen: '; $PALANG['pEdit_alias_domain_error'] = '<span class="error_msg">Tämä ei ole sinun domainisi: '; -$PALANG['pEdit_alias_domain_result_error'] = '<span class="error_msg">Unable to modify the alias domain!</span>'; # XXX -$PALANG['pEdit_alias_forward_and_store'] = 'Deliver to the local mailbox.'; # XXX -$PALANG['pEdit_alias_forward_only'] = 'Forward to given email addresses only.'; # XXX +$PALANG['pEdit_alias_domain_result_error'] = '<span class="error_msg">Alias domainia ei voitu muokata!</span>'; +$PALANG['pEdit_alias_forward_and_store'] = 'Toimita paikalliseen laatikkoon.'; +$PALANG['pEdit_alias_forward_only'] = 'Edelleenlähetä ainoastaan annettuun sähköpostiosoitteeseen.'; $PALANG['pEdit_alias_button'] = 'Muokkaa aliasta'; $PALANG['pEdit_alias_result_error'] = '<span class="error_msg">Aliasta ei voi muokata!</span>'; @@ -152,7 +149,7 @@ $PALANG['pCreate_mailbox_button'] = 'Lisää postilaatikko'; $PALANG['pCreate_mailbox_result_error'] = '<span class="error_msg">Postilaatikon lisääminen ei onnistu!</span>'; $PALANG['pCreate_mailbox_result_success'] = 'Postilaatikko on lisätty!'; -$PALANG['pCreate_mailbox_result_succes_nosubfolders'] = 'The mailbox has been added to the mailbox table, but none (or only some) of the predefined sub-folders could be created'; # XXX +$PALANG['pCreate_mailbox_result_succes_nosubfolders'] = 'Sähköpostilaatikko on lisätty tauluun, mutta ennaltamääriteltyjen alikansioiden luonneista yksi tai useampi epäonnistui'; $PALANG['pEdit_mailbox_welcome'] = 'Muokkaa postilaatikkoa.'; $PALANG['pEdit_mailbox_username'] = 'Käyttäjätunnus'; @@ -161,7 +158,7 @@ $PALANG['pEdit_mailbox_password2'] = 'Uusi salasana (toistamiseen)'; $PALANG['pEdit_mailbox_password_text_error'] = '<span class="error_msg">Antamasi salasanat eivät täsmää!</span>'; $PALANG['pEdit_mailbox_name'] = 'Nimi'; -$PALANG['pEdit_mailbox_name_text'] = 'Full name'; # XXX +$PALANG['pEdit_mailbox_name_text'] = 'Koko nimi'; $PALANG['pEdit_mailbox_quota'] = 'Kiintiö'; $PALANG['pEdit_mailbox_quota_text'] = 'MB'; $PALANG['pEdit_mailbox_quota_text_error'] = 'MB<br /><span class="error_msg">Antamasi kiintiö on liian korkea!</span>'; @@ -180,11 +177,11 @@ $PALANG['pPassword_button'] = 'Vaihda salasana'; $PALANG['pPassword_result_error'] = '<span class="error_msg">Salasanan vaihto ei onnistunut!</span>'; $PALANG['pPassword_result_success'] = 'Salasana vaihdettu!'; -$PALANG['pEdit_vacation_set'] = 'Change / Set away message'; # XXX -$PALANG['pEdit_vacation_remove'] = 'Remove away message'; # XXX -$PALANG['pVacation_result_error'] = '<span class="error_msg">Unable to update auto response settings!</span>'; # XXX -$PALANG['pVacation_result_removed'] = 'Auto response has been removed!'; # XXX -$PALANG['pVacation_result_added'] = 'Auto response has been enabled!'; # XXX +$PALANG['pEdit_vacation_set'] = 'Muuta / Aseta poissaoloviesti'; +$PALANG['pEdit_vacation_remove'] = 'Poista poissaoloviesti'; +$PALANG['pVacation_result_error'] = '<span class="error_msg">Automaattivastauksen asetuksia ei voitu päivittää!</span>'; +$PALANG['pVacation_result_removed'] = 'Automaattivastaus poistettu!'; +$PALANG['pVacation_result_added'] = 'Automaattivastaus päällä!'; $PALANG['pViewlog_welcome'] = 'Näytä viimeiset kymmenen tapahtumaa domainille '; $PALANG['pViewlog_timestamp'] = 'Aikaleima'; @@ -192,18 +189,18 @@ $PALANG['pViewlog_domain'] = 'Domain'; $PALANG['pViewlog_action'] = 'Tapahtuma'; $PALANG['pViewlog_data'] = 'Tiedot'; -$PALANG['pViewlog_action_create_mailbox'] = 'create mailbox'; # XXX -$PALANG['pViewlog_action_delete_mailbox'] = 'delete mailbox'; # XXX -$PALANG['pViewlog_action_edit_mailbox'] = 'edit mailbox'; # XXX -$PALANG['pViewlog_action_edit_mailbox_state'] = 'edit mailbox active'; # XXX -$PALANG['pViewlog_action_create_alias'] = 'create alias'; # XXX -$PALANG['pViewlog_action_create_alias_domain'] = 'create alias domain'; # XXX -$PALANG['pViewlog_action_delete_alias'] = 'delete alias'; # XXX -$PALANG['pViewlog_action_delete_alias_domain'] = 'delete alias domain'; # XXX -$PALANG['pViewlog_action_edit_alias'] = 'edit alias'; # XXX -$PALANG['pViewlog_action_edit_alias_state'] = 'edit alias active'; # XXX -$PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; # XXX -$PALANG['pViewlog_action_edit_password'] = 'change password'; # XXX +$PALANG['pViewlog_action_create_mailbox'] = 'luo sähköpostilaatikko'; +$PALANG['pViewlog_action_delete_mailbox'] = 'poista sähköpostilaatikko'; +$PALANG['pViewlog_action_edit_mailbox'] = 'muokkaa sähköpostilaatikkoa'; +$PALANG['pViewlog_action_edit_mailbox_state'] = 'muokkaa aktiivista sähköpostilaatikkoa'; +$PALANG['pViewlog_action_create_alias'] = 'luo alias'; +$PALANG['pViewlog_action_create_alias_domain'] = 'luo alias domaini'; +$PALANG['pViewlog_action_delete_alias'] = 'poista alias'; +$PALANG['pViewlog_action_delete_alias_domain'] = 'poista alias domaini'; +$PALANG['pViewlog_action_edit_alias'] = 'muokkaa aliasta'; +$PALANG['pViewlog_action_edit_alias_state'] = 'muokkaa aktiivista aliasta'; +$PALANG['pViewlog_action_edit_alias_domain_state'] = 'muokkaa aktiivista alias domainia'; +$PALANG['pViewlog_action_edit_password'] = 'vaihda salasana'; $PALANG['pViewlog_button'] = 'Siirry'; $PALANG['pViewlog_result_error'] = '<span class="error_msg">Lokeja ei löydy!</span>'; @@ -216,10 +213,10 @@ $PALANG['pSendmail_subject_text'] = 'Tervetuloa'; $PALANG['pSendmail_body'] = 'Viesti'; $PALANG['pSendmail_button'] = 'Lähetä viesti'; -$PALANG['pSendmail_result_error'] = '<span class="error_msg">Postilaatikon luonti ei onnistunut!</span>'; # XXX text change - new: <span class="error_msg">Unable to send email!</span> -$PALANG['pSendmail_result_success'] = 'Postilaatikko on luotu!'; # XXX text change - new: Email sent! +$PALANG['pSendmail_result_error'] = '<span class="error_msg">Sähköpostin lähetys ei onnistunut!</span>'; +$PALANG['pSendmail_result_success'] = 'Sähköposti lähetetty!'; -$PALANG['pAdminMenu_list_admin'] = 'Admin Lista'; +$PALANG['pAdminMenu_list_admin'] = 'Ylläpitäjä Lista'; $PALANG['pAdminMenu_list_domain'] = 'Domain Lista'; $PALANG['pAdminMenu_list_virtual'] = 'Virtual Lista'; $PALANG['pAdminMenu_viewlog'] = 'Näytä loki'; @@ -231,7 +228,7 @@ $PALANG['pAdminMenu_create_mailbox'] = 'Lisää postilaatikko'; $PALANG['pAdminList_admin_domain'] = 'Domain'; -$PALANG['pAdminList_admin_username'] = 'Admin'; +$PALANG['pAdminList_admin_username'] = 'Ylläpitäjä'; $PALANG['pAdminList_admin_count'] = 'Domainit'; $PALANG['pAdminList_admin_modified'] = 'Viimeksi muokattu'; $PALANG['pAdminList_admin_active'] = 'Aktiivinen'; @@ -241,8 +238,8 @@ $PALANG['pAdminList_domain_aliases'] = 'Aliakset'; $PALANG['pAdminList_domain_mailboxes'] = 'Postilaatikot'; $PALANG['pAdminList_domain_maxquota'] = 'Suurin sallittu kiintiö (MB)'; -$PALANG['pAdminList_domain_transport'] = 'Transport'; # XXX -$PALANG['pAdminList_domain_backupmx'] = 'Backup MX'; # XXX +$PALANG['pAdminList_domain_transport'] = 'Transport'; +$PALANG['pAdminList_domain_backupmx'] = 'Vara MX'; $PALANG['pAdminList_domain_modified'] = 'Viimeksi muokattu'; $PALANG['pAdminList_domain_active'] = 'Atiivinen'; @@ -257,12 +254,12 @@ $PALANG['pAdminList_virtual_mailbox_name'] = 'Nimi'; $PALANG['pAdminList_virtual_mailbox_quota'] = 'Kiintiö (MB)'; $PALANG['pAdminList_virtual_mailbox_modified'] = 'Viimeksi muokattu'; -$PALANG['pAdminList_virtual_mailbox_active'] = 'Atiivinen'; +$PALANG['pAdminList_virtual_mailbox_active'] = 'Aktiivinen'; $PALANG['pAdminCreate_domain_welcome'] = 'Lisää uusi domain'; $PALANG['pAdminCreate_domain_domain'] = 'Domain'; $PALANG['pAdminCreate_domain_domain_text_error'] = '<span class="error_msg">Domain on jo järjestelmässä!</span>'; -$PALANG['pAdminCreate_domain_domain_text_error2'] = '<span class="error_msg">The domain is invalid!</span>'; # XXX +$PALANG['pAdminCreate_domain_domain_text_error2'] = '<span class="error_msg">Domain on virheellinen!</span>'; $PALANG['pAdminCreate_domain_description'] = 'Kuvaus'; $PALANG['pAdminCreate_domain_aliases'] = 'Aliakset'; $PALANG['pAdminCreate_domain_aliases_text'] = '-1 = ei käytössä | 0 = rajoittamaton'; @@ -270,16 +267,16 @@ $PALANG['pAdminCreate_domain_mailboxes_text'] = '-1 = ei käytössä | 0 = rajoittamaton'; $PALANG['pAdminCreate_domain_maxquota'] = 'Max kiintiö'; $PALANG['pAdminCreate_domain_maxquota_text'] = 'MB <br /> -1 = ei käytössä | 0 = rajoittamaton'; -$PALANG['pAdminCreate_domain_transport'] = 'Transport'; # XXX -$PALANG['pAdminCreate_domain_transport_text'] = 'Define transport'; # XXX +$PALANG['pAdminCreate_domain_transport'] = 'Transport'; +$PALANG['pAdminCreate_domain_transport_text'] = 'Määritä transport'; $PALANG['pAdminCreate_domain_defaultaliases'] = 'Lisää oletus aliakset'; -$PALANG['pAdminCreate_domain_defaultaliases_text'] = ''; # XXX -$PALANG['pAdminCreate_domain_backupmx'] = 'Mail server is backup MX'; # XXX +$PALANG['pAdminCreate_domain_defaultaliases_text'] = ''; +$PALANG['pAdminCreate_domain_backupmx'] = 'Sähköpostipalvelin on vara MX'; $PALANG['pAdminCreate_domain_button'] = 'Lisää domain'; $PALANG['pAdminCreate_domain_result_error'] = '<span class="error_msg">Domainin lisäys ei onnistunut!</span>'; $PALANG['pAdminCreate_domain_result_success'] = 'Domain on lisätty!'; -$PALANG['pAdminDelete_domain_error'] = '<span class="error_msg">Unable to remove domain!</span>'; # XXX -$PALANG['pAdminDelete_alias_domain_error'] = '<span class="error_msg">Unable to remove domain alias!</span>'; # XXX +$PALANG['pAdminDelete_domain_error'] = '<span class="error_msg">Domainin voitu poistaa!</span>'; +$PALANG['pAdminDelete_alias_domain_error'] = '<span class="error_msg">Domainin aliasta ei voitu poistaa!</span>'; $PALANG['pAdminEdit_domain_welcome'] = 'Muokkaa domainia'; $PALANG['pAdminEdit_domain_domain'] = 'Domain'; @@ -290,15 +287,15 @@ $PALANG['pAdminEdit_domain_mailboxes_text'] = '-1 = ei käytössä | 0 = rajoittamaton'; $PALANG['pAdminEdit_domain_maxquota'] = 'Max kiintiö'; $PALANG['pAdminEdit_domain_maxquota_text'] = 'MB<br /> -1 = ei käytössä | 0 = rajoittamaton'; -$PALANG['pAdminEdit_domain_transport'] = 'Transport'; # XXX -$PALANG['pAdminEdit_domain_transport_text'] = 'Define transport'; # XXX -$PALANG['pAdminEdit_domain_backupmx'] = 'Mail server is backup MX'; # XXX +$PALANG['pAdminEdit_domain_transport'] = 'Transport'; +$PALANG['pAdminEdit_domain_transport_text'] = 'Määritä transport'; +$PALANG['pAdminEdit_domain_backupmx'] = 'Sähköpostipalvelin on vara MX'; $PALANG['pAdminEdit_domain_active'] = 'Aktiivinen'; $PALANG['pAdminEdit_domain_button'] = 'Muokkaa domainia'; $PALANG['pAdminEdit_domain_result_error'] = '<span class="error_msg">Domainin muokkaus ei onnistu!</span>'; $PALANG['pAdminCreate_admin_welcome'] = 'Lisää uusi domainin ylläpitäjä'; -$PALANG['pAdminCreate_admin_username'] = 'Admin'; +$PALANG['pAdminCreate_admin_username'] = 'Ylläpitäjä'; $PALANG['pAdminCreate_admin_username_text'] = 'Sähköpostiosoite'; $PALANG['pAdminCreate_admin_username_text_error1'] = 'Sähköpostiosoite<br /><span class="error_msg">Ylläpitäjän sähköpostiosoite ei ole oikeanmuotoinen!</span>'; $PALANG['pAdminCreate_admin_username_text_error2'] = 'Sähköpostiosoite<br /><span class="error_msg">Ylläpitäjän sähköpostiosoite on jo olemassa tai se ei ole oikean muotoinen</span>'; @@ -316,7 +313,7 @@ $PALANG['pAdminEdit_admin_password2'] = 'Salasana (toistamiseen)'; $PALANG['pAdminEdit_admin_password_text_error'] = '<span class="error_msg">Antamasi salasanat eivät täsmää!<br />Tai ne ovat tyhjiä!</span>'; $PALANG['pAdminEdit_admin_active'] = 'Aktiivinen'; -$PALANG['pAdminEdit_admin_super_admin'] = 'Super admin'; # XXX +$PALANG['pAdminEdit_admin_super_admin'] = 'Pääylläpitäjä'; $PALANG['pAdminEdit_admin_button'] = 'Muokkaa ylläpitäjää'; $PALANG['pAdminEdit_admin_result_error'] = '<span class="error_msg">Ylläpitäjän muokkaaminen ei onnistu!</span>'; $PALANG['pAdminEdit_admin_result_success'] = 'Ylläpitäjän muokkaus onnistui!'; @@ -333,7 +330,7 @@ $PALANG['pUsersMenu_password'] = 'Vaihda salasana'; $PALANG['pUsersMain_vacation'] = 'Aseta lomavastaaja tai automaattivastaus sähköpostiisi.'; -$PALANG['pUsersMain_vacationSet'] = $PALANG['pUsersMenu_vacation'] . ' is ON, click \'' . $PALANG['pUsersMenu_vacation'] . '\' to ' . $PALANG['edit'] . '/remove'; # XXX +$PALANG['pUsersMain_vacationSet'] = $PALANG['pUsersMenu_vacation'] . ' on päällä, paina \'' . $PALANG['pUsersMenu_vacation'] . '\' muokataksesi tai poistaaksesi'; $PALANG['pUsersMain_edit_alias'] = 'Muuta uudelleenohjauksen osoitetta.'; $PALANG['pUsersMain_password'] = 'Vaihda nykyinen salasanasi.'; @@ -351,75 +348,75 @@ $PALANG['pUsersVacation_result_error'] = '<span class="error_msg">Automaattivastauksen asettaminen epäonnistui!</span>'; $PALANG['pUsersVacation_result_success'] = 'Automaattivastaus on poistettu käytöstä!'; -$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox'; # XXX -$PALANG['pCreate_dbLog_createalias'] = 'create alias'; # XXX -$PALANG['pDelete_dbLog_deletealias'] = 'delete alias'; # XXX -$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox'; # XXX +$PALANG['pCreate_dbLog_createmailbox'] = 'luo sähköpostilaatikko'; +$PALANG['pCreate_dbLog_createalias'] = 'luo alias'; +$PALANG['pDelete_dbLog_deletealias'] = 'poista alias'; +$PALANG['pDelete_dbLog_deletemailbox'] = 'poista sähköpostilaatikko'; -$PALANG['pEdit_dbLog_editactive'] = 'change active state'; # XXX -$PALANG['pEdit_dbLog_editalias'] = 'edit alias'; # XXX -$PALANG['pEdit_dbLog_editmailbox'] = 'edit mailbox'; # XXX +$PALANG['pEdit_dbLog_editactive'] = 'vaihda aktiivisuus tilaa'; +$PALANG['pEdit_dbLog_editalias'] = 'muokkaa aliasta'; +$PALANG['pEdit_dbLog_editmailbox'] = 'muokkaa sähköpostilaatikkoa'; -$PALANG['pSearch'] = 'search'; # XXX -$PALANG['pSearch_welcome'] = 'Searching for: '; -$PALANG['pReturn_to'] = 'Return to'; # XXX -$PALANG['pBroadcast_title'] = 'Send broadcast message'; # XXX -$PALANG['pBroadcast_from'] = 'From'; # XXX -$PALANG['pBroadcast_name'] = 'Your name'; # XXX -$PALANG['pBroadcast_subject'] = 'Subject'; # XXX -$PALANG['pBroadcast_message'] = 'Message'; # XXX -$PALANG['pBroadcast_send'] = 'Send message'; # XXX -$PALANG['pBroadcast_success'] = 'Your broadcast message was sent.'; # XXX -$PALANG['pAdminMenu_broadcast_message'] = 'Broadcast message'; # XXX -$PALANG['pBroadcast_error_empty'] = 'The fields Name, Subject and Message should\'t be empty !'; # XXX -$PALANG['pStatus_undeliverable'] = 'maybe UNDELIVERABLE '; # XXX -$PALANG['pStatus_custom'] = 'Delivers to '; # XXX -$PALANG['pStatus_popimap'] = 'POP/IMAP '; # XXX -$PALANG['pPasswordTooShort'] = "Password is too short - requires %s characters"; # XXX -$PALANG['pInvalidDomainRegex'] = "Invalid domain name %s, fails regexp check"; # XXX -$PALANG['pInvalidDomainDNS'] = "Invalid domain %s, and/or not discoverable in DNS"; # XXX -$PALANG['pInvalidMailRegex'] = "Invalid email address, fails regexp check"; # XXX -$PALANG['pFetchmail_welcome'] = 'Fetch mail for:'; # XXX -$PALANG['pFetchmail_new_entry'] = 'New entry'; # XXX -$PALANG['pFetchmail_database_save_error'] = 'Could not save this entry in the database!'; # XXX -$PALANG['pFetchmail_database_save_success'] = 'Entry saved in database.'; # XXX -$PALANG['pFetchmail_error_invalid_id'] = 'No entry with ID %s found!'; # XXX -$PALANG['pFetchmail_invalid_mailbox'] = 'Invalid mailbox!'; # XXX -$PALANG['pFetchmail_server_missing'] = 'Please enter the remote server name!'; # XXX -$PALANG['pFetchmail_user_missing'] = 'Please enter the remote username!'; # XXX -$PALANG['pFetchmail_password_missing'] = 'Please enter the remote password!'; # XXX -$PALANG['pFetchmail_field_id'] = 'ID'; # XXX -$PALANG['pFetchmail_field_mailbox'] = 'Mailbox'; # XXX -$PALANG['pFetchmail_field_src_server'] = 'Server'; # XXX -$PALANG['pFetchmail_field_src_auth'] = 'Auth Type'; # XXX -$PALANG['pFetchmail_field_src_user'] = 'User'; # XXX -$PALANG['pFetchmail_field_src_password'] = 'Password'; # XXX -$PALANG['pFetchmail_field_src_folder'] = 'Folder'; # XXX -$PALANG['pFetchmail_field_poll_time'] = 'Poll'; # XXX -$PALANG['pFetchmail_field_fetchall'] = 'Fetch All'; # XXX -$PALANG['pFetchmail_field_keep'] = 'Keep'; # XXX -$PALANG['pFetchmail_field_protocol'] = 'Protocol'; # XXX -$PALANG['pFetchmail_field_usessl'] = 'SSL active'; # XXX -$PALANG['pFetchmail_field_extra_options'] = 'Extra Options'; # XXX -$PALANG['pFetchmail_field_mda'] = 'MDA'; # XXX -$PALANG['pFetchmail_field_date'] = 'Date'; # XXX -$PALANG['pFetchmail_field_returned_text'] = 'Returned Text'; # XXX -$PALANG['pFetchmail_desc_id'] = 'Record ID'; # XXX -$PALANG['pFetchmail_desc_mailbox'] = 'Local mailbox'; # XXX -$PALANG['pFetchmail_desc_src_server'] = 'Remote Server'; # XXX -$PALANG['pFetchmail_desc_src_auth'] = 'Mostly \'password\''; # Translators: Please do NOT translate 'password' here # XXX -$PALANG['pFetchmail_desc_src_user'] = 'Remote User'; # XXX -$PALANG['pFetchmail_desc_src_password'] = 'Remote Password'; # XXX -$PALANG['pFetchmail_desc_src_folder'] = 'Remote Folder'; # XXX -$PALANG['pFetchmail_desc_poll_time'] = 'Poll every ... minutes'; # XXX -$PALANG['pFetchmail_desc_fetchall'] = 'Retrieve both old (seen) and new messages'; # XXX -$PALANG['pFetchmail_desc_keep'] = 'Keep retrieved messages on the remote mailserver'; # XXX -$PALANG['pFetchmail_desc_protocol'] = 'Protocol to use'; # XXX -$PALANG['pFetchmail_desc_usessl'] = 'SSL encryption'; # XXX -$PALANG['pFetchmail_desc_extra_options'] = 'Extra fetchmail Options'; # XXX -$PALANG['pFetchmail_desc_mda'] = 'Mail Delivery Agent'; # XXX -$PALANG['pFetchmail_desc_date'] = 'Date of last polling/configuration change'; # XXX -$PALANG['pFetchmail_desc_returned_text'] = 'Text message from last polling'; # XXX +$PALANG['pSearch'] = 'hae'; +$PALANG['pSearch_welcome'] = 'Haetaan: '; +$PALANG['pReturn_to'] = 'Palaa osoitteeseen'; +$PALANG['pBroadcast_title'] = 'Lähetä tiedotusviesti'; +$PALANG['pBroadcast_from'] = 'Lähettäjä'; +$PALANG['pBroadcast_name'] = 'Nimesi'; +$PALANG['pBroadcast_subject'] = 'Aihe'; +$PALANG['pBroadcast_message'] = 'Viesti'; +$PALANG['pBroadcast_send'] = 'Lähetä viesti'; +$PALANG['pBroadcast_success'] = 'Tiedostusviestisi on lähetetty.'; +$PALANG['pAdminMenu_broadcast_message'] = 'Tiedotusviesti'; +$PALANG['pBroadcast_error_empty'] = 'Nimi, Aihe tai Viesti kenttien ei pidä olla tyhjiä!'; +$PALANG['pStatus_undeliverable'] = 'ehkä ei voida toimittaa '; +$PALANG['pStatus_custom'] = 'Toimittaa osoiteeseen '; +$PALANG['pStatus_popimap'] = 'POP/IMAP '; +$PALANG['pPasswordTooShort'] = "Salasana on liian lyhyt, vaaditaan %s merkkiä"; +$PALANG['pInvalidDomainRegex'] = "Virheellinen domain nimi %s, ei läpäise regexp testiä"; +$PALANG['pInvalidDomainDNS'] = "Virheellinen domain %s ja/tai ei löydy nimipalvelimista"; +$PALANG['pInvalidMailRegex'] = "Virheellinen sähköpostiosoite, ei läpäise regexp testiä"; +$PALANG['pFetchmail_welcome'] = 'Hae postit:'; +$PALANG['pFetchmail_new_entry'] = 'Uusi tietue'; +$PALANG['pFetchmail_database_save_error'] = 'Tätä tietuetta ei voitu tallentaa tietokantaan!'; +$PALANG['pFetchmail_database_save_success'] = 'Tietue tallennettu tietokantaan.'; +$PALANG['pFetchmail_error_invalid_id'] = 'Tietuetta ID:llä %s ei löytynyt!'; +$PALANG['pFetchmail_invalid_mailbox'] = 'Viallinen sähköpostilaatikko!'; +$PALANG['pFetchmail_server_missing'] = 'Ole hyvä ja syötä etäpalvelimen nimi!'; +$PALANG['pFetchmail_user_missing'] = 'Ole hyvä ja syötä etäkäyttäjän tunnus!'; +$PALANG['pFetchmail_password_missing'] = 'Ole hyvä ja syötä etäkäyttäjän salasana!'; +$PALANG['pFetchmail_field_id'] = 'ID'; +$PALANG['pFetchmail_field_mailbox'] = 'Sähköpostilaatikko'; +$PALANG['pFetchmail_field_src_server'] = 'Palvelin'; +$PALANG['pFetchmail_field_src_auth'] = 'Tunnistautumisen tyyppi'; +$PALANG['pFetchmail_field_src_user'] = 'Käyttäjä'; +$PALANG['pFetchmail_field_src_password'] = 'Salasana'; +$PALANG['pFetchmail_field_src_folder'] = 'Kansio'; +$PALANG['pFetchmail_field_poll_time'] = 'Tarkista'; +$PALANG['pFetchmail_field_fetchall'] = 'Hae kaikki'; +$PALANG['pFetchmail_field_keep'] = 'Pidä'; +$PALANG['pFetchmail_field_protocol'] = 'Protokolla'; +$PALANG['pFetchmail_field_usessl'] = 'SSL aktiivinen'; +$PALANG['pFetchmail_field_extra_options'] = 'Lisämääritteet'; +$PALANG['pFetchmail_field_mda'] = 'MDA'; +$PALANG['pFetchmail_field_date'] = 'Päivämäärä'; +$PALANG['pFetchmail_field_returned_text'] = 'Palautettu teksti'; +$PALANG['pFetchmail_desc_id'] = 'Tietue ID'; +$PALANG['pFetchmail_desc_mailbox'] = 'Paikallinen sähköpostilaatikko'; +$PALANG['pFetchmail_desc_src_server'] = 'Etäpalvelin'; +$PALANG['pFetchmail_desc_src_auth'] = 'Useimmiten \'password\''; +$PALANG['pFetchmail_desc_src_user'] = 'Etäkäyttäjä'; +$PALANG['pFetchmail_desc_src_password'] = 'Etäkäyttäjän salasana'; +$PALANG['pFetchmail_desc_src_folder'] = 'Etäpalvelimen kansio'; +$PALANG['pFetchmail_desc_poll_time'] = 'Tarkista joka ... minuutti'; +$PALANG['pFetchmail_desc_fetchall'] = 'Hae sekä vanhat(luetut) että uudet viestit'; +$PALANG['pFetchmail_desc_keep'] = 'Jätä kopio haetuista viesteistä etäpalvelimelle'; +$PALANG['pFetchmail_desc_protocol'] = 'Käytettävä protokolla'; +$PALANG['pFetchmail_desc_usessl'] = 'SSL salaus'; +$PALANG['pFetchmail_desc_extra_options'] = 'Lisämääritteet fetchmailílle'; +$PALANG['pFetchmail_desc_mda'] = 'Mail Delivery Agent'; +$PALANG['pFetchmail_desc_date'] = 'Viimeisen tarkistuksen/konfiguraatio muutoksen päivämäärä'; +$PALANG['pFetchmail_desc_returned_text'] = 'Viesti edellisestä tarkistuksesta'; $PALANG['please_keep_this_as_last_entry'] = ''; # needed for language-check.sh /* vim: set expandtab ft=php softtabstop=3 tabstop=3 shiftwidth=3: */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 14:32:48
|
Revision: 525 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=525&view=rev Author: GingerDog Date: 2009-01-15 14:32:43 +0000 (Thu, 15 Jan 2009) Log Message: ----------- config.inc.php, functions.inc.php - add support for mysql_encrypt method for password encrpytion - useful for pam integration, apparently - see https://sourceforge.net/tracker/?func=detail&atid=937966&aid=1793352&group_id=191583 Modified Paths: -------------- trunk/config.inc.php trunk/functions.inc.php Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-01-15 12:27:55 UTC (rev 524) +++ trunk/config.inc.php 2009-01-15 14:32:43 UTC (rev 525) @@ -88,6 +88,7 @@ // md5 = md5 sum of the password // system = whatever you have set as your PHP system default // cleartext = clear text passwords (ouch!) +// mysql_encrypt = useful for PAM integration $CONF['encrypt'] = 'md5crypt'; // Minimum length required for passwords. Postfixadmin will not Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-01-15 12:27:55 UTC (rev 524) +++ trunk/functions.inc.php 2009-01-15 14:32:43 UTC (rev 525) @@ -1146,6 +1146,20 @@ if ($CONF['encrypt'] == 'cleartext') { $password = $pw; } + + // See https://sourceforge.net/tracker/?func=detail&atid=937966&aid=1793352&group_id=191583 + // this is apparently useful for pam_mysql etc. + if ($CONF['encrypt'] == 'mysql_encrypt') + { + if ($pw_db!="") { + $salt=substr($pw_db,0,2); + $res=db_query("SELECT ENCRYPT('".$pw."','".$salt."');"); + } else { + $res=db_query("SELECT ENCRYPT('".$pw."');"); + } + $l = db_row($res["result"]); + $password = $l[0]; + } $password = escape_string ($password); return $password; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 13:22:35
|
Revision: 524 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=524&view=rev Author: GingerDog Date: 2009-01-15 12:27:55 +0000 (Thu, 15 Jan 2009) Log Message: ----------- functions.inc.php / CHANGELOG.txt - bump version numbers etc Modified Paths: -------------- trunk/CHANGELOG.TXT trunk/functions.inc.php Modified: trunk/CHANGELOG.TXT =================================================================== --- trunk/CHANGELOG.TXT 2009-01-15 12:25:41 UTC (rev 523) +++ trunk/CHANGELOG.TXT 2009-01-15 12:27:55 UTC (rev 524) @@ -14,7 +14,7 @@ Only in SVN trunk -------------------- -Version 2.3 Beta - 2009/01/15 - SVN r518 +Version 2.3 Beta - 2009/01/15 - SVN r523 ----------------------------------------- - added support for domain aliases (from lenix) (can be disabled with $CONF['alias_domain']) Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-01-15 12:25:41 UTC (rev 523) +++ trunk/functions.inc.php 2009-01-15 12:27:55 UTC (rev 524) @@ -22,7 +22,7 @@ exit; } -$version = '2.2.0'; +$version = '2.3 beta'; /** * check_session This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 13:02:47
|
Revision: 519 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=519&view=rev Author: GingerDog Date: 2009-01-15 12:21:08 +0000 (Thu, 15 Jan 2009) Log Message: ----------- delete.php: fix alias_domain deletion and reindent Modified Paths: -------------- trunk/delete.php Modified: trunk/delete.php =================================================================== --- trunk/delete.php 2009-01-15 11:38:11 UTC (rev 518) +++ trunk/delete.php 2009-01-15 12:21:08 UTC (rev 519) @@ -45,122 +45,124 @@ if ($fTable == "admin") { - authentication_require_role('global-admin'); - $fWhere = 'username'; - $result_admin = db_delete ($table_admin,$fWhere,$fDelete); - $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete); + authentication_require_role('global-admin'); + $fWhere = 'username'; + $result_admin = db_delete ($table_admin,$fWhere,$fDelete); + $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete); - if (!($result_admin == 1) and ($result_domain_admins >= 0)) - { - $error = 1; - $tMessage = $PALANG['pAdminDelete_admin_error']; - } - else - { - $url = "list-admin.php"; - header ("Location: $url"); - } + if (!($result_admin == 1) and ($result_domain_admins >= 0)) + { + $error = 1; + $tMessage = $PALANG['pAdminDelete_admin_error']; + } + else + { + $url = "list-admin.php"; + header ("Location: $url"); + } } # ($fTable == "admin") elseif ($fTable == "domain") { - authentication_require_role('global-admin'); - $fWhere = 'domain'; - $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete); - $result_alias = db_delete ($table_alias,$fWhere,$fDelete); - $result_mailbox = db_delete ($table_mailbox,$fWhere,$fDelete); - $result_log = db_delete ($table_log,$fWhere,$fDelete); - if ($CONF['vacation'] == "YES") - { - $result_vacation = db_delete ($table_vacation,$fWhere,$fDelete); - } - $result_domain = db_delete ($table_domain,$fWhere,$fDelete); + authentication_require_role('global-admin'); + $fWhere = 'domain'; + $result_domain_admins = db_delete ($table_domain_admins,$fWhere,$fDelete); + $result_alias = db_delete ($table_alias,$fWhere,$fDelete); + $result_mailbox = db_delete ($table_mailbox,$fWhere,$fDelete); + $result_log = db_delete ($table_log,$fWhere,$fDelete); + if ($CONF['vacation'] == "YES") + { + $result_vacation = db_delete ($table_vacation,$fWhere,$fDelete); + } + $result_domain = db_delete ($table_domain,$fWhere,$fDelete); - if (!$result_domain || !domain_postdeletion($fDelete)) - { - $error = 1; - $tMessage = $PALANG['pAdminDelete_domain_error']; - } - else - { - $url = "list-domain.php"; - header ("Location: $url"); - } + if (!$result_domain || !domain_postdeletion($fDelete)) + { + $error = 1; + $tMessage = $PALANG['pAdminDelete_domain_error']; + } + else + { + $url = "list-domain.php"; + header ("Location: $url"); + } } # ($fTable == "domain") elseif ($fTable == "alias_domain") { - authentication_require_role('global-admin'); - $fWhere = 'domain'; - if(db_delete ($table_domain_alias,$fWhere,$fDelete)) { - $url = "list-domain.php"; - header ("Location: $url"); - } + authentication_require_role('global-admin'); + $table_domain_alias = table_by_key('alias_domain'); + $fWhere = 'alias_domain'; + $fDelete = $fDomain; + if(db_delete($table_domain_alias,$fWhere,$fDelete)) { + $url = "list-domain.php"; + header ("Location: $url"); + } } # ($fTable == "alias_domain") elseif ($fTable == "alias" or $fTable == "mailbox") { - if (!check_owner ($SESSID_USERNAME, $fDomain)) - { - $error = 1; - $tMessage = $PALANG['pDelete_domain_error'] . "<b>$fDomain</b>!</span>"; - } - elseif (!check_alias_owner ($SESSID_USERNAME, $fDelete)) - { - $error = 1; - $tMessage = $PALANG['pDelete_alias_error'] . "<b>$fDelete</b>!</span>"; - } - else - { - if ($CONF['database_type'] == "pgsql") db_query('BEGIN'); - /* there may be no aliases to delete */ - $result = db_query("SELECT * FROM $table_alias WHERE address = '$fDelete' AND domain = '$fDomain'"); - if($result['rows'] == 1) { - $result = db_query ("DELETE FROM $table_alias WHERE address='$fDelete' AND domain='$fDomain'"); - db_log ($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete); - } + if (!check_owner ($SESSID_USERNAME, $fDomain)) + { + $error = 1; + $tMessage = $PALANG['pDelete_domain_error'] . "<b>$fDomain</b>!</span>"; + } + elseif (!check_alias_owner ($SESSID_USERNAME, $fDelete)) + { + $error = 1; + $tMessage = $PALANG['pDelete_alias_error'] . "<b>$fDelete</b>!</span>"; + } + else + { + if ($CONF['database_type'] == "pgsql") db_query('BEGIN'); + /* there may be no aliases to delete */ + $result = db_query("SELECT * FROM $table_alias WHERE address = '$fDelete' AND domain = '$fDomain'"); + if($result['rows'] == 1) { + $result = db_query ("DELETE FROM $table_alias WHERE address='$fDelete' AND domain='$fDomain'"); + db_log ($SESSID_USERNAME, $fDomain, 'delete_alias', $fDelete); + } - /* is there a mailbox? if do delete it from orbit; it's the only way to be sure */ - $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'"); - if ($result['rows'] == 1) - { - $result = db_query ("DELETE FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'"); - $postdel_res=mailbox_postdeletion($fDelete,$fDomain); - if ($result['rows'] != 1 || !$postdel_res) - { - $error = 1; - $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> ("; - if ($result['rows']!=1) + /* is there a mailbox? if do delete it from orbit; it's the only way to be sure */ + $result = db_query ("SELECT * FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'"); + if ($result['rows'] == 1) + { + $result = db_query ("DELETE FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'"); + $postdel_res=mailbox_postdeletion($fDelete,$fDomain); + if ($result['rows'] != 1 || !$postdel_res) { - $tMessage.='mailbox'; - if (!$postdel_res) $tMessage.=', '; + $error = 1; + $tMessage = $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> ("; + if ($result['rows']!=1) + { + $tMessage.='mailbox'; + if (!$postdel_res) $tMessage.=', '; + } + if (!$postdel_res) + { + $tMessage.='post-deletion'; + } + $tMessage.=')</span>'; } - if (!$postdel_res) - { - $tMessage.='post-deletion'; - } - $tMessage.=')</span>'; - } - } - $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fDelete' AND domain = '$fDomain'"); - if($result['rows'] == 1) { - db_query ("DELETE FROM $table_vacation WHERE email='$fDelete' AND domain='$fDomain'"); - db_query ("DELETE FROM $table_vacation_notification WHERE on_vacation ='$fDelete' "); /* should be caught by cascade, if PgSQL */ - } - } + } + $result = db_query("SELECT * FROM $table_vacation WHERE email = '$fDelete' AND domain = '$fDomain'"); + if($result['rows'] == 1) { + db_query ("DELETE FROM $table_vacation WHERE email='$fDelete' AND domain='$fDomain'"); + db_query ("DELETE FROM $table_vacation_notification WHERE on_vacation ='$fDelete' "); /* should be caught by cascade, if PgSQL */ + } + } - if ($error != 1) - { - if ($CONF['database_type'] == "pgsql") db_query('COMMIT'); - header ("Location: list-virtual.php?domain=$fDomain"); - exit; - } else { - $tMessage .= $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (physical mail)!</span>"; - if ($CONF['database_type'] == "pgsql") db_query('ROLLBACK'); - } + if ($error != 1) + { + if ($CONF['database_type'] == "pgsql") db_query('COMMIT'); + header ("Location: list-virtual.php?domain=$fDomain"); + exit; + } else { + $tMessage .= $PALANG['pDelete_delete_error'] . "<b>$fDelete</b> (physical mail)!</span>"; + if ($CONF['database_type'] == "pgsql") db_query('ROLLBACK'); + } } else { - flash_error($PALANG['invalid_parameter']); + flash_error($PALANG['invalid_parameter']); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 13:02:28
|
Revision: 520 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=520&view=rev Author: GingerDog Date: 2009-01-15 12:24:36 +0000 (Thu, 15 Jan 2009) Log Message: ----------- functions.inc.php: reindent Modified Paths: -------------- trunk/functions.inc.php Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-01-15 12:21:08 UTC (rev 519) +++ trunk/functions.inc.php 2009-01-15 12:24:36 UTC (rev 520) @@ -18,8 +18,8 @@ if (ereg ("functions.inc.php", $_SERVER['PHP_SELF'])) { - header ("Location: login.php"); - exit; + header ("Location: login.php"); + exit; } $version = '2.2.0'; @@ -32,13 +32,13 @@ */ function authentication_get_username() { - global $CONF; - if (!isset($_SESSION['sessid'])) { - header ("Location: " . $CONF['postfix_admin_url'] . "/login.php"); - exit(0); - } - $SESSID_USERNAME = $_SESSION['sessid']['username']; - return $SESSID_USERNAME; + global $CONF; + if (!isset($_SESSION['sessid'])) { + header ("Location: " . $CONF['postfix_admin_url'] . "/login.php"); + exit(0); + } + $SESSID_USERNAME = $_SESSION['sessid']['username']; + return $SESSID_USERNAME; } /** @@ -47,12 +47,12 @@ * @return String admin or user or (boolean) false. */ function authentication_get_usertype() { - if(isset($_SESSION['sessid'])) { - if(isset($_SESSION['sessid']['type'])) { - return $_SESSION['sessid']['type']; - } - } - return false; + if(isset($_SESSION['sessid'])) { + if(isset($_SESSION['sessid']['type'])) { + return $_SESSION['sessid']['type']; + } + } + return false; } /** * @@ -62,15 +62,15 @@ * Note, user < admin < global-admin */ function authentication_has_role($role) { - global $CONF; - if(isset($_SESSION['sessid'])) { - if(isset($_SESSION['sessid']['roles'])) { - if(in_array($role, $_SESSION['sessid']['roles'])) { - return true; - } - } - } - return false; + global $CONF; + if(isset($_SESSION['sessid'])) { + if(isset($_SESSION['sessid']['roles'])) { + if(in_array($role, $_SESSION['sessid']['roles'])) { + return true; + } + } + } + return false; } /** @@ -82,26 +82,26 @@ * Note, user < admin < global-admin */ function authentication_require_role($role) { - global $CONF; - // redirect to appropriate page? - if(authentication_has_role($role)) { - return True; - } - header("Location: " . $CONF['postfix_admin_url'] . "/login.php"); - exit(0); + global $CONF; + // redirect to appropriate page? + if(authentication_has_role($role)) { + return True; + } + header("Location: " . $CONF['postfix_admin_url'] . "/login.php"); + exit(0); } /** * @return boolean TRUE if a admin, FALSE otherwise. */ function authentication_is_admin() { - return authentication_get_usertype() == 'admin'; + return authentication_get_usertype() == 'admin'; } /** * @return boolean TRUE if a user, FALSE otherwise. */ function authentication_is_user() { - return authentication_get_usertype() == 'user'; + return authentication_get_usertype() == 'user'; } @@ -113,7 +113,7 @@ * @see _flash_string() */ function flash_error($string) { - _flash_string('error', $string); + _flash_string('error', $string); } /** @@ -123,19 +123,19 @@ * @see _flash_string() */ function flash_info($string) { - _flash_string('info', $string); + _flash_string('info', $string); } /** * 'Private' method used for flash_info() and flash_error(). */ function _flash_string($type, $string) { - if(!isset($_SESSION['flash'])) { - $_SESSION['flash'] = array(); - } - if(!isset($_SESSION['flash'][$type])) { - $_SESSION['flash'][$type] = array(); - } - $_SESSION['flash'][$type][] = $string; + if(!isset($_SESSION['flash'])) { + $_SESSION['flash'] = array(); + } + if(!isset($_SESSION['flash'][$type])) { + $_SESSION['flash'][$type] = array(); + } + $_SESSION['flash'][$type][] = $string; } // @@ -146,33 +146,33 @@ // function check_language ($use_post = 1) { - global $CONF; - global $supported_languages; # from languages/languages.php + global $CONF; + global $supported_languages; # from languages/languages.php - $lang = $CONF['default_language']; + $lang = $CONF['default_language']; - if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) - { - $lang_array = preg_split ('/(\s*,\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); - if (safecookie('lang')) { - array_unshift($lang_array, safecookie('lang')); # prefer language from cookie - } - if ( $use_post && safepost('lang')) { - array_unshift($lang_array, safepost('lang')); # but prefer $_POST['lang'] even more - } + if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + $lang_array = preg_split ('/(\s*,\s*)/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + if (safecookie('lang')) { + array_unshift($lang_array, safecookie('lang')); # prefer language from cookie + } + if ( $use_post && safepost('lang')) { + array_unshift($lang_array, safepost('lang')); # but prefer $_POST['lang'] even more + } - for($i = 0; $i < count($lang_array); $i++) - { - $lang_next = $lang_array[$i]; - $lang_next = strtolower(trim($lang_next)); - if(array_key_exists($lang_next, $supported_languages)) - { - $lang = $lang_next; - break; - } - } - } - return $lang; + for($i = 0; $i < count($lang_array); $i++) + { + $lang_next = $lang_array[$i]; + $lang_next = strtolower(trim($lang_next)); + if(array_key_exists($lang_next, $supported_languages)) + { + $lang = $lang_next; + break; + } + } + } + return $lang; } // @@ -182,22 +182,22 @@ // function language_selector() { - global $supported_languages; # from languages/languages.php + global $supported_languages; # from languages/languages.php - $current_lang = check_language(); + $current_lang = check_language(); - $selector = '<select name="lang" xml:lang="en" dir="ltr">'; + $selector = '<select name="lang" xml:lang="en" dir="ltr">'; - foreach($supported_languages as $lang => $lang_name) { - if ($lang == $current_lang) { - $selected = ' selected="selected"'; - } else { - $selected = ''; - } - $selector .= "<option value='$lang'$selected>$lang_name</option>"; - } - $selector .= "</select>"; - return $selector; + foreach($supported_languages as $lang => $lang_name) { + if ($lang == $current_lang) { + $selected = ' selected="selected"'; + } else { + $selected = ''; + } + $selector .= "<option value='$lang'$selected>$lang_name</option>"; + } + $selector .= "</select>"; + return $selector; } // @@ -207,14 +207,14 @@ // function check_string ($var) { - if (preg_match ('/^([A-Za-z0-9 ]+)+$/', $var)) - { - return true; - } - else - { - return false; - } + if (preg_match ('/^([A-Za-z0-9 ]+)+$/', $var)) + { + return true; + } + else + { + return false; + } } @@ -227,37 +227,37 @@ // TODO: make check_domain able to handle as example .local domains function check_domain ($domain) { - global $CONF; - global $PALANG; + global $CONF; + global $PALANG; - if (!preg_match ('/([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,6}$/i', trim ($domain))) - { - flash_error(sprintf($PALANG['pInvalidDomainRegex'], htmlentities($domain))); - return false; - } + if (!preg_match ('/([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,6}$/i', trim ($domain))) + { + flash_error(sprintf($PALANG['pInvalidDomainRegex'], htmlentities($domain))); + return false; + } - if (isset($CONF['emailcheck_resolve_domain']) && 'YES' == $CONF['emailcheck_resolve_domain'] && 'WINDOWS'!=(strtoupper(substr(php_uname('s'), 0, 7)))) - { + if (isset($CONF['emailcheck_resolve_domain']) && 'YES' == $CONF['emailcheck_resolve_domain'] && 'WINDOWS'!=(strtoupper(substr(php_uname('s'), 0, 7)))) + { - // Look for an AAAA, A, or MX record for the domain + // Look for an AAAA, A, or MX record for the domain - if(function_exists('checkdnsrr')) { - // AAAA (IPv6) is only available in PHP v. >= 5 - if (version_compare(phpversion(), "5.0.0", ">=")) - { - if (checkdnsrr($domain,'AAAA')) return true; - } - if (checkdnsrr($domain,'A')) return true; - if (checkdnsrr($domain,'MX')) return true; - flash_error(sprintf($PALANG['pInvalidDomainDNS'], htmlentities($domain))); - return false; - } - else { - flash_error("emailcheck_resolve_domain is enabled, but function (checkdnsrr) missing!"); - } - } + if(function_exists('checkdnsrr')) { + // AAAA (IPv6) is only available in PHP v. >= 5 + if (version_compare(phpversion(), "5.0.0", ">=")) + { + if (checkdnsrr($domain,'AAAA')) return true; + } + if (checkdnsrr($domain,'A')) return true; + if (checkdnsrr($domain,'MX')) return true; + flash_error(sprintf($PALANG['pInvalidDomainDNS'], htmlentities($domain))); + return false; + } + else { + flash_error("emailcheck_resolve_domain is enabled, but function (checkdnsrr) missing!"); + } + } - return true; + return true; } @@ -270,38 +270,38 @@ */ function check_email ($email) { - global $CONF; - global $PALANG; + global $CONF; + global $PALANG; - $ce_email=$email; + $ce_email=$email; - //strip the vacation domain out if we are using it - //and change from blah#fo...@au... to bl...@fo... - if ($CONF['vacation'] == 'YES') - { - $vacation_domain = $CONF['vacation_domain']; - $ce_email = preg_replace("/@$vacation_domain/", '', $ce_email); - $ce_email = preg_replace("/#/", '@', $ce_email); - } + //strip the vacation domain out if we are using it + //and change from blah#fo...@au... to bl...@fo... + if ($CONF['vacation'] == 'YES') + { + $vacation_domain = $CONF['vacation_domain']; + $ce_email = preg_replace("/@$vacation_domain/", '', $ce_email); + $ce_email = preg_replace("/#/", '@', $ce_email); + } - // Perform non-domain-part sanity checks - if (!preg_match ('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_{|}~]+' . '@' . '[^@]+$/i', trim ($ce_email))) - { - flash_error($PALANG['pInvalidMailRegex']); - return false; - } + // Perform non-domain-part sanity checks + if (!preg_match ('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_{|}~]+' . '@' . '[^@]+$/i', trim ($ce_email))) + { + flash_error($PALANG['pInvalidMailRegex']); + return false; + } - // Determine domain name - $matches=array(); - if (!preg_match('|@(.+)$|',$ce_email,$matches)) - { - flash_error($PALANG['pInvalidMailRegex']); - return false; - } - $domain=$matches[1]; + // Determine domain name + $matches=array(); + if (!preg_match('|@(.+)$|',$ce_email,$matches)) + { + flash_error($PALANG['pInvalidMailRegex']); + return false; + } + $domain=$matches[1]; - # check domain name - return check_domain($domain); + # check domain name + return check_domain($domain); } @@ -316,49 +316,49 @@ */ function escape_string ($string) { - global $CONF; - // if the string is actually an array, do a recursive cleaning. - // Note, the array keys are not cleaned. - if(is_array($string)) { - $clean = array(); - foreach(array_keys($string) as $row) { - $clean[$row] = escape_string($string[$row]); - } - return $clean; - } - if (get_magic_quotes_gpc ()) - { - $string = stripslashes($string); - } - if (!is_numeric($string)) - { - $link = db_connect(); - if ($CONF['database_type'] == "mysql") - { - $escaped_string = mysql_real_escape_string($string, $link); - } - if ($CONF['database_type'] == "mysqli") - { - $escaped_string = mysqli_real_escape_string($link, $string); - } - if ($CONF['database_type'] == "pgsql") - { - // php 5.2+ allows for $link to be specified. - if (version_compare(phpversion(), "5.2.0", ">=")) - { - $escaped_string = pg_escape_string($link, $string); - } - else - { - $escaped_string = pg_escape_string($string); - } - } - } - else - { - $escaped_string = $string; - } - return $escaped_string; + global $CONF; + // if the string is actually an array, do a recursive cleaning. + // Note, the array keys are not cleaned. + if(is_array($string)) { + $clean = array(); + foreach(array_keys($string) as $row) { + $clean[$row] = escape_string($string[$row]); + } + return $clean; + } + if (get_magic_quotes_gpc ()) + { + $string = stripslashes($string); + } + if (!is_numeric($string)) + { + $link = db_connect(); + if ($CONF['database_type'] == "mysql") + { + $escaped_string = mysql_real_escape_string($string, $link); + } + if ($CONF['database_type'] == "mysqli") + { + $escaped_string = mysqli_real_escape_string($link, $string); + } + if ($CONF['database_type'] == "pgsql") + { + // php 5.2+ allows for $link to be specified. + if (version_compare(phpversion(), "5.2.0", ">=")) + { + $escaped_string = pg_escape_string($link, $string); + } + else + { + $escaped_string = pg_escape_string($string); + } + } + } + else + { + $escaped_string = $string; + } + return $escaped_string; } @@ -374,9 +374,9 @@ * @return String */ function safeget ($param, $default="") { - $retval=$default; - if (isset($_GET[$param])) $retval=$_GET[$param]; - return $retval; + $retval=$default; + if (isset($_GET[$param])) $retval=$_GET[$param]; + return $retval; } /** @@ -388,9 +388,9 @@ * same as safeget, but for $_POST */ function safepost ($param, $default="") { - $retval=$default; - if (isset($_POST[$param])) $retval=$_POST[$param]; - return $retval; + $retval=$default; + if (isset($_POST[$param])) $retval=$_POST[$param]; + return $retval; } /** @@ -401,9 +401,9 @@ * @return String value from $_SERVER[$param] or $default */ function safeserver ($param, $default="") { - $retval=$default; - if (isset($_SERVER[$param])) $retval=$_SERVER[$param]; - return $retval; + $retval=$default; + if (isset($_SERVER[$param])) $retval=$_SERVER[$param]; + return $retval; } /** @@ -414,9 +414,9 @@ * @return String value from $_COOKIE[$param] or $default */ function safecookie ($param, $default="") { - $retval=$default; - if (isset($_COOKIE[$param])) $retval=$_COOKIE[$param]; - return $retval; + $retval=$default; + if (isset($_COOKIE[$param])) $retval=$_COOKIE[$param]; + return $retval; } @@ -427,128 +427,128 @@ // function get_domain_properties ($domain) { - global $CONF; - global $table_alias, $table_mailbox, $table_domain; - $list = array (); + global $CONF; + global $table_alias, $table_mailbox, $table_domain; + $list = array (); - $result = db_query ("SELECT COUNT(*) FROM $table_alias WHERE domain='$domain'"); - $row = db_row ($result['result']); - $list['alias_count'] = $row[0]; + $result = db_query ("SELECT COUNT(*) FROM $table_alias WHERE domain='$domain'"); + $row = db_row ($result['result']); + $list['alias_count'] = $row[0]; - $result = db_query ("SELECT COUNT(*) FROM $table_mailbox WHERE domain='$domain'"); - $row = db_row ($result['result']); - $list['mailbox_count'] = $row[0]; + $result = db_query ("SELECT COUNT(*) FROM $table_mailbox WHERE domain='$domain'"); + $row = db_row ($result['result']); + $list['mailbox_count'] = $row[0]; - $result = db_query ("SELECT SUM(quota) FROM $table_mailbox WHERE domain='$domain'"); - $row = db_row ($result['result']); - $list['quota_sum'] = $row[0]; - $list['alias_count'] = $list['alias_count'] - $list['mailbox_count']; + $result = db_query ("SELECT SUM(quota) FROM $table_mailbox WHERE domain='$domain'"); + $row = db_row ($result['result']); + $list['quota_sum'] = $row[0]; + $list['alias_count'] = $list['alias_count'] - $list['mailbox_count']; - $list['alias_pgindex']=array (); - $list['mbox_pgindex']=array (); - $list['mbox_pgindex_count'] = 0; - //while loop to figure index names. use page_size and loop of queries - $i=0; - $current=0; - $page_size = $CONF['page_size']; - $tmpstr=""; - $idxlabel=""; - $list['alias_pgindex_count'] = 0; + $list['alias_pgindex']=array (); + $list['mbox_pgindex']=array (); + $list['mbox_pgindex_count'] = 0; + //while loop to figure index names. use page_size and loop of queries + $i=0; + $current=0; + $page_size = $CONF['page_size']; + $tmpstr=""; + $idxlabel=""; + $list['alias_pgindex_count'] = 0; - if ( $list['alias_count'] > $page_size ) - { - while ( $current < $list['alias_count'] ) - { - $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; - $query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql"; - $result = db_query ("$query"); - $row = db_array ($result['result']); - $tmpstr = $row['address']; - //get first 2 chars - $idxlabel = $tmpstr[0] . $tmpstr[1] . "-"; - ($current + $page_size - 1 <= $list['alias_count']) ? $current = $current + $page_size - 1 : $current = $list['alias_count'] - 1; - $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; - $query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql"; - $result = db_query ("$query"); - $row = db_array ($result['result']); - $tmpstr = $row['address']; - $idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1]; + if ( $list['alias_count'] > $page_size ) + { + while ( $current < $list['alias_count'] ) + { + $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; + $query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql"; + $result = db_query ("$query"); + $row = db_array ($result['result']); + $tmpstr = $row['address']; + //get first 2 chars + $idxlabel = $tmpstr[0] . $tmpstr[1] . "-"; + ($current + $page_size - 1 <= $list['alias_count']) ? $current = $current + $page_size - 1 : $current = $list['alias_count'] - 1; + $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; + $query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql"; + $result = db_query ("$query"); + $row = db_array ($result['result']); + $tmpstr = $row['address']; + $idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1]; - $current = $current + 1; + $current = $current + 1; - $list['alias_pgindex'][]=$idxlabel; - $i++; - } - $list['alias_pgindex_count']=$i; - } + $list['alias_pgindex'][]=$idxlabel; + $i++; + } + $list['alias_pgindex_count']=$i; + } - $i=0; - $current=0; - $page_size = $CONF['page_size']; - $tmpstr=""; - $idxlabel=""; + $i=0; + $current=0; + $page_size = $CONF['page_size']; + $tmpstr=""; + $idxlabel=""; - if ( $list['mailbox_count'] > $page_size ) - { - while ( $current < $list['mailbox_count'] ) - { - $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; - $query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql"; - $result = db_query ("$query"); - $row = db_array ($result['result']); - $tmpstr = $row['username']; - //get first 2 chars - $idxlabel = $tmpstr[0] . $tmpstr[1] . "-"; - ($current + $page_size - 1 <= $list['mailbox_count']) ? $current = $current + $page_size - 1 : $current = $list['mailbox_count'] - 1; - $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; - $query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql"; - $result = db_query ("$query"); - $row = db_array ($result['result']); - $tmpstr = $row['username']; - $idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1]; + if ( $list['mailbox_count'] > $page_size ) + { + while ( $current < $list['mailbox_count'] ) + { + $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; + $query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql"; + $result = db_query ("$query"); + $row = db_array ($result['result']); + $tmpstr = $row['username']; + //get first 2 chars + $idxlabel = $tmpstr[0] . $tmpstr[1] . "-"; + ($current + $page_size - 1 <= $list['mailbox_count']) ? $current = $current + $page_size - 1 : $current = $list['mailbox_count'] - 1; + $limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1"; + $query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql"; + $result = db_query ("$query"); + $row = db_array ($result['result']); + $tmpstr = $row['username']; + $idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1]; - $current = $current + 1; + $current = $current + 1; - $list['mbox_pgindex'][]=$idxlabel; - $i++; - } - $list['mbox_pgindex_count']=$i; - } + $list['mbox_pgindex'][]=$idxlabel; + $i++; + } + $list['mbox_pgindex_count']=$i; + } - // end mod + // end mod - $query="SELECT * FROM $table_domain WHERE domain='$domain'"; - if ('pgsql'==$CONF['database_type']) - { - $query=" SELECT *, EXTRACT(epoch FROM created) AS uts_created, EXTRACT(epoch FROM modified) AS uts_modified FROM $table_domain WHERE domain='$domain' "; - } - $result = db_query ($query); - $row = db_array ($result['result']); - $list['description'] = $row['description']; - $list['aliases'] = $row['aliases']; - $list['mailboxes'] = $row['mailboxes']; - $list['maxquota'] = $row['maxquota']; - $list['quota'] = $row['quota']; - $list['transport'] = $row['transport']; - $list['backupmx'] = $row['backupmx']; - $list['created'] = $row['created']; - $list['modified'] = $row['modified']; - $list['active'] = $row['active']; + $query="SELECT * FROM $table_domain WHERE domain='$domain'"; + if ('pgsql'==$CONF['database_type']) + { + $query=" SELECT *, EXTRACT(epoch FROM created) AS uts_created, EXTRACT(epoch FROM modified) AS uts_modified FROM $table_domain WHERE domain='$domain' "; + } + $result = db_query ($query); + $row = db_array ($result['result']); + $list['description'] = $row['description']; + $list['aliases'] = $row['aliases']; + $list['mailboxes'] = $row['mailboxes']; + $list['maxquota'] = $row['maxquota']; + $list['quota'] = $row['quota']; + $list['transport'] = $row['transport']; + $list['backupmx'] = $row['backupmx']; + $list['created'] = $row['created']; + $list['modified'] = $row['modified']; + $list['active'] = $row['active']; - if ($CONF['database_type'] == "pgsql") - { - $list['active']=('t'==$row['active']) ? 1 : 0; - $list['backupmx']=('t'==$row['backupmx']) ? 1 : 0; - $list['created']= gmstrftime('%c %Z',$row['uts_created']); - $list['modified']= gmstrftime('%c %Z',$row['uts_modified']); - } - else - { - $list['active'] = $row['active']; - $list['backupmx'] = $row['backupmx']; - } + if ($CONF['database_type'] == "pgsql") + { + $list['active']=('t'==$row['active']) ? 1 : 0; + $list['backupmx']=('t'==$row['backupmx']) ? 1 : 0; + $list['created']= gmstrftime('%c %Z',$row['uts_created']); + $list['modified']= gmstrftime('%c %Z',$row['uts_modified']); + } + else + { + $list['active'] = $row['active']; + $list['backupmx'] = $row['backupmx']; + } - return $list; + return $list; } @@ -560,42 +560,42 @@ // function get_mailbox_properties ($username) { - global $CONF; - global $table_mailbox; - $query="SELECT * FROM $table_mailbox WHERE username='$username'"; - if ('pgsql'==$CONF['database_type']) - { - $query=" - SELECT - *, - EXTRACT(epoch FROM created) AS uts_created, - EXTRACT(epoch FROM modified) AS uts_modified - FROM $table_mailbox - WHERE username='$username' - "; - } - $result = db_query ($query); - $row = db_array ($result['result']); - $list['name'] = $row['name']; - $list['maildir'] = $row['maildir']; - $list['quota'] = $row['quota']; - $list['domain'] = $row['domain']; - $list['created'] = $row['created']; - $list['modified'] = $row['modified']; - $list['active'] = $row['active']; + global $CONF; + global $table_mailbox; + $query="SELECT * FROM $table_mailbox WHERE username='$username'"; + if ('pgsql'==$CONF['database_type']) + { + $query=" + SELECT + *, + EXTRACT(epoch FROM created) AS uts_created, + EXTRACT(epoch FROM modified) AS uts_modified + FROM $table_mailbox + WHERE username='$username' + "; + } + $result = db_query ($query); + $row = db_array ($result['result']); + $list['name'] = $row['name']; + $list['maildir'] = $row['maildir']; + $list['quota'] = $row['quota']; + $list['domain'] = $row['domain']; + $list['created'] = $row['created']; + $list['modified'] = $row['modified']; + $list['active'] = $row['active']; - if ($CONF['database_type'] == "pgsql") - { - $list['active']=('t'==$row['active']) ? 1 : 0; - $list['created']= gmstrftime('%c %Z',$row['uts_created']); - $list['modified']= gmstrftime('%c %Z',$row['uts_modified']); - } - else - { - $list['active'] = $row['active']; - } + if ($CONF['database_type'] == "pgsql") + { + $list['active']=('t'==$row['active']) ? 1 : 0; + $list['created']= gmstrftime('%c %Z',$row['uts_created']); + $list['modified']= gmstrftime('%c %Z',$row['uts_modified']); + } + else + { + $list['active'] = $row['active']; + } - return $list; + return $list; } @@ -607,24 +607,24 @@ // function check_alias ($domain) { - $limit = get_domain_properties ($domain); - if ($limit['aliases'] == 0) - { - # 0 = unlimited, -1 = disabled - return true; - } - if ($limit['aliases'] < 0) - { - return false; - } - if ($limit['alias_count'] >= $limit['aliases']) - { - return false; - } - else - { - return true; - } + $limit = get_domain_properties ($domain); + if ($limit['aliases'] == 0) + { + # 0 = unlimited, -1 = disabled + return true; + } + if ($limit['aliases'] < 0) + { + return false; + } + if ($limit['alias_count'] >= $limit['aliases']) + { + return false; + } + else + { + return true; + } } @@ -636,24 +636,24 @@ // function check_mailbox ($domain) { - $limit = get_domain_properties ($domain); - /* -1 = disable, 0 = unlimited */ - if ($limit['mailboxes'] == 0) - { - return true; - } - if ($limit['mailboxes'] < 0) - { - return false; - } - if ($limit['mailbox_count'] >= $limit['mailboxes']) - { - return false; - } - else - { - return true; - } + $limit = get_domain_properties ($domain); + /* -1 = disable, 0 = unlimited */ + if ($limit['mailboxes'] == 0) + { + return true; + } + if ($limit['mailboxes'] < 0) + { + return false; + } + if ($limit['mailbox_count'] >= $limit['mailboxes']) + { + return false; + } + else + { + return true; + } } @@ -665,27 +665,27 @@ // function check_quota ($quota, $domain) { - $limit = get_domain_properties ($domain); - if ($limit['maxquota'] == 0) - { - return true; - } - if (($limit['maxquota'] < 0) and ($quota < 0)) - { - return true; - } - if (($limit['maxquota'] > 0) and ($quota == 0)) - { - return false; - } - if ($quota > $limit['maxquota']) - { - return false; - } - else - { - return true; - } + $limit = get_domain_properties ($domain); + if ($limit['maxquota'] == 0) + { + return true; + } + if (($limit['maxquota'] < 0) and ($quota < 0)) + { + return true; + } + if (($limit['maxquota'] > 0) and ($quota == 0)) + { + return false; + } + if ($quota > $limit['maxquota']) + { + return false; + } + else + { + return true; + } } @@ -697,10 +697,10 @@ // function multiply_quota ($quota) { - global $CONF; - if ($quota == -1) return $quota; - $value = $quota * $CONF['quota_multiplier']; - return $value; + global $CONF; + if ($quota == -1) return $quota; + $value = $quota * $CONF['quota_multiplier']; + return $value; } @@ -712,10 +712,10 @@ // function divide_quota ($quota) { - global $CONF; - if ($quota == -1) return $quota; - $value = round($quota / $CONF['quota_multiplier'],2); - return $value; + global $CONF; + if ($quota == -1) return $quota; + $value = round($quota / $CONF['quota_multiplier'],2); + return $value; } @@ -727,16 +727,16 @@ // function check_owner ($username, $domain) { - global $table_domain_admins; - $result = db_query ("SELECT 1 FROM $table_domain_admins WHERE username='$username' AND (domain='$domain' OR domain='ALL') AND active='1'"); - if ($result['rows'] != 1) - { - return false; - } - else - { - return true; - } + global $table_domain_admins; + $result = db_query ("SELECT 1 FROM $table_domain_admins WHERE username='$username' AND (domain='$domain' OR domain='ALL') AND active='1'"); + if ($result['rows'] != 1) + { + return false; + } + else + { + return true; + } } @@ -748,17 +748,17 @@ // function check_alias_owner ($username, $alias) { - global $CONF; - if (authentication_has_role('global-admin')) return true; - $tmp = preg_split('/\@/', $alias); - if (($CONF['special_alias_control'] == 'NO') && array_key_exists($tmp[0], $CONF['default_aliases'])) - { - return false; - } - else - { - return true; - } + global $CONF; + if (authentication_has_role('global-admin')) return true; + $tmp = preg_split('/\@/', $alias); + if (($CONF['special_alias_control'] == 'NO') && array_key_exists($tmp[0], $CONF['default_aliases'])) + { + return false; + } + else + { + return true; + } } @@ -769,30 +769,30 @@ */ function list_domains_for_admin ($username) { - global $CONF; - global $table_domain, $table_domain_admins; - $list = array (); - // does $username need escaping here? - $active_sql = db_get_boolean(True); - $backupmx_sql = db_get_boolean(False); - $query = "SELECT $table_domain.domain, $table_domain_admins.username FROM $table_domain - LEFT JOIN $table_domain_admins ON $table_domain.domain=$table_domain_admins.domain - WHERE $table_domain_admins.username='$username' - AND $table_domain.active=$active_sql - AND $table_domain.backupmx=$backupmx_sql - ORDER BY $table_domain_admins.domain"; + global $CONF; + global $table_domain, $table_domain_admins; + $list = array (); + // does $username need escaping here? + $active_sql = db_get_boolean(True); + $backupmx_sql = db_get_boolean(False); + $query = "SELECT $table_domain.domain, $table_domain_admins.username FROM $table_domain + LEFT JOIN $table_domain_admins ON $table_domain.domain=$table_domain_admins.domain + WHERE $table_domain_admins.username='$username' + AND $table_domain.active=$active_sql + AND $table_domain.backupmx=$backupmx_sql + ORDER BY $table_domain_admins.domain"; - $result = db_query ($query); - if ($result['rows'] > 0) - { - $i = 0; - while ($row = db_array ($result['result'])) - { - $list[$i] = $row['domain']; - $i++; - } - } - return $list; + $result = db_query ($query); + if ($result['rows'] > 0) + { + $i = 0; + while ($row = db_array ($result['result'])) + { + $list[$i] = $row['domain']; + $i++; + } + } + return $list; } @@ -804,20 +804,20 @@ // function list_domains () { - global $table_domain; - $list = array(); + global $table_domain; + $list = array(); - $result = db_query ("SELECT domain FROM $table_domain WHERE domain!='ALL' ORDER BY domain"); - if ($result['rows'] > 0) - { - $i = 0; - while ($row = db_array ($result['result'])) - { - $list[$i] = $row['domain']; - $i++; - } - } - return $list; + $result = db_query ("SELECT domain FROM $table_domain WHERE domain!='ALL' ORDER BY domain"); + if ($result['rows'] > 0) + { + $i = 0; + while ($row = db_array ($result['result'])) + { + $list[$i] = $row['domain']; + $i++; + } + } + return $list; } @@ -830,15 +830,15 @@ // function admin_exist ($username) { - $result = db_query ("SELECT 1 FROM " . table_by_key ('admin') . " WHERE username='$username'"); - if ($result['rows'] != 1) - { - return false; - } - else - { - return true; - } + $result = db_query ("SELECT 1 FROM " . table_by_key ('admin') . " WHERE username='$username'"); + if ($result['rows'] != 1) + { + return false; + } + else + { + return true; + } } @@ -850,17 +850,17 @@ // function domain_exist ($domain) { - global $table_domain; + global $table_domain; - $result = db_query("SELECT 1 FROM $table_domain WHERE domain='$domain'"); - if ($result['rows'] != 1) - { - return false; - } - else - { - return true; - } + $result = db_query("SELECT 1 FROM $table_domain WHERE domain='$domain'"); + if ($result['rows'] != 1) + { + return false; + } + else + { + return true; + } } @@ -874,20 +874,20 @@ // function list_admins () { - global $table_admin; - $list = ""; + global $table_admin; + $list = ""; - $result = db_query ("SELECT username FROM $table_admin ORDER BY username"); - if ($result['rows'] > 0) - { - $i = 0; - while ($row = db_array ($result['result'])) - { - $list[$i] = $row['username']; - $i++; - } - } - return $list; + $result = db_query ("SELECT username FROM $table_admin ORDER BY username"); + if ($result['rows'] > 0) + { + $i = 0; + while ($row = db_array ($result['result'])) + { + $list[$i] = $row['username']; + $i++; + } + } + return $list; } @@ -899,45 +899,45 @@ // function get_admin_properties ($username) { - global $CONF; - global $table_admin, $table_domain_admins; - $list = array (); + global $CONF; + global $table_admin, $table_domain_admins; + $list = array (); - $result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username' AND domain='ALL'"); - if ($result['rows'] == 1) - { - $list['domain_count'] = 'ALL'; - } - else - { - $result = db_query ("SELECT COUNT(*) FROM $table_domain_admins WHERE username='$username'"); - $row = db_row ($result['result']); - $list['domain_count'] = $row[0]; - } + $result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username' AND domain='ALL'"); + if ($result['rows'] == 1) + { + $list['domain_count'] = 'ALL'; + } + else + { + $result = db_query ("SELECT COUNT(*) FROM $table_domain_admins WHERE username='$username'"); + $row = db_row ($result['result']); + $list['domain_count'] = $row[0]; + } - $query = "SELECT * FROM $table_admin WHERE username='$username'"; - if ('pgsql'==$CONF['database_type']) { - $query=" - SELECT - *, - EXTRACT(epoch FROM created) AS uts_created, - EXTRACT (epoch FROM modified) AS uts_modified - FROM $table_admin - WHERE username='$username' - "; - } + $query = "SELECT * FROM $table_admin WHERE username='$username'"; + if ('pgsql'==$CONF['database_type']) { + $query=" + SELECT + *, + EXTRACT(epoch FROM created) AS uts_created, + EXTRACT (epoch FROM modified) AS uts_modified + FROM $table_admin + WHERE username='$username' + "; + } - $result = db_query ($query); - $row = db_array ($result['result']); - $list['created'] = $row['created']; - $list['modified'] = $row['modified']; - $list['active'] = $row['active']; - if ('pgsql'==$CONF['database_type']) { - $list['active'] = ('t'==$row['active']) ? 1 : 0; - $list['created']= gmstrftime('%c %Z',$row['uts_created']); - $list['modified']= gmstrftime('%c %Z',$row['uts_modified']); - } - return $list; + $result = db_query ($query); + $row = db_array ($result['result']); + $list['created'] = $row['created']; + $list['modified'] = $row['modified']; + $list['active'] = $row['active']; + if ('pgsql'==$CONF['database_type']) { + $list['active'] = ('t'==$row['active']) ? 1 : 0; + $list['created']= gmstrftime('%c %Z',$row['uts_created']); + $list['modified']= gmstrftime('%c %Z',$row['uts_modified']); + } + return $list; } @@ -949,143 +949,143 @@ // function encode_header ($string, $default_charset = "utf-8") { - if (strtolower ($default_charset) == 'iso-8859-1') - { - $string = str_replace ("\240",' ',$string); - } + if (strtolower ($default_charset) == 'iso-8859-1') + { + $string = str_replace ("\240",' ',$string); + } - $j = strlen ($string); - $max_l = 75 - strlen ($default_charset) - 7; - $aRet = array (); - $ret = ''; - $iEncStart = $enc_init = false; - $cur_l = $iOffset = 0; + $j = strlen ($string); + $max_l = 75 - strlen ($default_charset) - 7; + $aRet = array (); + $ret = ''; + $iEncStart = $enc_init = false; + $cur_l = $iOffset = 0; - for ($i = 0; $i < $j; ++$i) - { - switch ($string{$i}) - { - case '=': - case '<': - case '>': - case ',': - case '?': - case '_': - if ($iEncStart === false) - { - $iEncStart = $i; - } - $cur_l+=3; - if ($cur_l > ($max_l-2)) - { - $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); - $aRet[] = "=?$default_charset?Q?$ret?="; - $iOffset = $i; - $cur_l = 0; - $ret = ''; - $iEncStart = false; - } - else - { - $ret .= sprintf ("=%02X",ord($string{$i})); - } - break; - case '(': - case ')': - if ($iEncStart !== false) - { - $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); - $aRet[] = "=?$default_charset?Q?$ret?="; - $iOffset = $i; - $cur_l = 0; - $ret = ''; - $iEncStart = false; - } - break; - case ' ': - if ($iEncStart !== false) - { - $cur_l++; - if ($cur_l > $max_l) + for ($i = 0; $i < $j; ++$i) + { + switch ($string{$i}) + { + case '=': + case '<': + case '>': + case ',': + case '?': + case '_': + if ($iEncStart === false) { - $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); - $aRet[] = "=?$default_charset?Q?$ret?="; - $iOffset = $i; - $cur_l = 0; - $ret = ''; - $iEncStart = false; + $iEncStart = $i; } - else + $cur_l+=3; + if ($cur_l > ($max_l-2)) { - $ret .= '_'; + $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); + $aRet[] = "=?$default_charset?Q?$ret?="; + $iOffset = $i; + $cur_l = 0; + $ret = ''; + $iEncStart = false; } - } - break; - default: - $k = ord ($string{$i}); - if ($k > 126) - { - if ($iEncStart === false) + else { - // do not start encoding in the middle of a string, also take the rest of the word. - $sLeadString = substr ($string,0,$i); - $aLeadString = explode (' ',$sLeadString); - $sToBeEncoded = array_pop ($aLeadString); - $iEncStart = $i - strlen ($sToBeEncoded); - $ret .= $sToBeEncoded; - $cur_l += strlen ($sToBeEncoded); + $ret .= sprintf ("=%02X",ord($string{$i})); } - $cur_l += 3; - // first we add the encoded string that reached it's max size - if ($cur_l > ($max_l-2)) + break; + case '(': + case ')': + if ($iEncStart !== false) { - $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); - $aRet[] = "=?$default_charset?Q?$ret?= "; - $cur_l = 3; - $ret = ''; - $iOffset = $i; - $iEncStart = $i; + $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); + $aRet[] = "=?$default_charset?Q?$ret?="; + $iOffset = $i; + $cur_l = 0; + $ret = ''; + $iEncStart = false; } - $enc_init = true; - $ret .= sprintf ("=%02X", $k); - } - else - { + break; + case ' ': if ($iEncStart !== false) { - $cur_l++; - if ($cur_l > $max_l) - { - $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); - $aRet[] = "=?$default_charset?Q?$ret?="; - $iEncStart = false; - $iOffset = $i; - $cur_l = 0; - $ret = ''; - } - else - { - $ret .= $string{$i}; - } + $cur_l++; + if ($cur_l > $max_l) + { + $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); + $aRet[] = "=?$default_charset?Q?$ret?="; + $iOffset = $i; + $cur_l = 0; + $ret = ''; + $iEncStart = false; + } + else + { + $ret .= '_'; + } } - } - break; - } - } - if ($enc_init) - { - if ($iEncStart !== false) - { - $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); - $aRet[] = "=?$default_charset?Q?$ret?="; - } - else - { - $aRet[] = substr ($string,$iOffset); - } - $string = implode ('',$aRet); - } - return $string; + break; + default: + $k = ord ($string{$i}); + if ($k > 126) + { + if ($iEncStart === false) + { + // do not start encoding in the middle of a string, also take the rest of the word. + $sLeadString = substr ($string,0,$i); + $aLeadString = explode (' ',$sLeadString); + $sToBeEncoded = array_pop ($aLeadString); + $iEncStart = $i - strlen ($sToBeEncoded); + $ret .= $sToBeEncoded; + $cur_l += strlen ($sToBeEncoded); + } + $cur_l += 3; + // first we add the encoded string that reached it's max size + if ($cur_l > ($max_l-2)) + { + $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); + $aRet[] = "=?$default_charset?Q?$ret?= "; + $cur_l = 3; + $ret = ''; + $iOffset = $i; + $iEncStart = $i; + } + $enc_init = true; + $ret .= sprintf ("=%02X", $k); + } + else + { + if ($iEncStart !== false) + { + $cur_l++; + if ($cur_l > $max_l) + { + $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); + $aRet[] = "=?$default_charset?Q?$ret?="; + $iEncStart = false; + $iOffset = $i; + $cur_l = 0; + $ret = ''; + } + else + { + $ret .= $string{$i}; + } + } + } + break; + } + } + if ($enc_init) + { + if ($iEncStart !== false) + { + $aRet[] = substr ($string,$iOffset,$iEncStart-$iOffset); + $aRet[] = "=?$default_charset?Q?$ret?="; + } + else + { + $aRet[] = substr ($string,$iOffset); + } + $string = implode ('',$aRet); + } + return $string; } @@ -1097,8 +1097,8 @@ // function generate_password () { - $password = substr (md5 (mt_rand ()), 0, 8); - return $password; + $password = substr (md5 (mt_rand ()), 0, 8); + return $password; } @@ -1110,44 +1110,44 @@ // function pacrypt ($pw, $pw_db="") { - global $CONF; - $pw = stripslashes($pw); - $password = ""; - $salt = ""; + global $CONF; + $pw = stripslashes($pw); + $password = ""; + $salt = ""; - if ($CONF['encrypt'] == 'md5crypt') { - $split_salt = preg_split ('/\$/', $pw_db); - if (isset ($split_salt[2])) { - $salt = $split_salt[2]; - } - $password = md5crypt ($pw, $salt); - } + if ($CONF['encrypt'] == 'md5crypt') { + $split_salt = preg_split ('/\$/', $pw_db); + if (isset ($split_salt[2])) { + $salt = $split_salt[2]; + } + $password = md5crypt ($pw, $salt); + } - if ($CONF['encrypt'] == 'md5') { - $password = md5($pw); - } + if ($CONF['encrypt'] == 'md5') { + $password = md5($pw); + } - if ($CONF['encrypt'] == 'system') { - if (ereg ("\$1\$", $pw_db)) { - $split_salt = preg_split ('/\$/', $pw_db); - $salt = $split_salt[2]; - } - else { - if (strlen($pw_db) == 0) { - $salt = substr (md5 (mt_rand ()), 0, 2); - } - else { - $salt = substr ($pw_db, 0, 2); - } - } - $password = crypt ($pw, $salt); - } + if ($CONF['encrypt'] == 'system') { + if (ereg ("\$1\$", $pw_db)) { + $split_salt = preg_split ('/\$/', $pw_db); + $salt = $split_salt[2]; + } + else { + if (strlen($pw_db) == 0) { + $salt = substr (md5 (mt_rand ()), 0, 2); + } + else { + $salt = substr ($pw_db, 0, 2); + } + } + $password = crypt ($pw, $salt); + } - if ($CONF['encrypt'] == 'cleartext') { - $password = $pw; - } - $password = escape_string ($password); - return $password; + if ($CONF['encrypt'] == 'cleartext') { + $password = $pw; + } + $password = escape_string ($password); + return $password; } // @@ -1158,101 +1158,101 @@ function md5crypt ($pw, $salt="", $magic="") { - $MAGIC = "$1$"; + $MAGIC = "$1$"; - if ($magic == "") $magic = $MAGIC; - if ($salt == "") $salt = create_salt (); - $slist = explode ("$", $salt); - if ($slist[0] == "1") $salt = $slist[1]; + if ($magic == "") $magic = $MAGIC; + if ($salt == "") $salt = create_salt (); + $slist = explode ("$", $salt); + if ($slist[0] == "1") $salt = $slist[1]; - $salt = substr ($salt, 0, 8); - $ctx = $pw . $magic . $salt; - $final = hex2bin (md5 ($pw . $salt . $pw)); + $salt = substr ($salt, 0, 8); + $ctx = $pw . $magic . $salt; + $final = hex2bin (md5 ($pw . $salt . $pw)); - for ($i=strlen ($pw); $i>0; $i-=16) - { - if ($i > 16) - { - $ctx .= substr ($final,0,16); - } - else - { - $ctx .= substr ($final,0,$i); - } - } - $i = strlen ($pw); + for ($i=strlen ($pw); $i>0; $i-=16) + { + if ($i > 16) + { + $ctx .= substr ($final,0,16); + } + else + { + $ctx .= substr ($final,0,$i); + } + } + $i = strlen ($pw); - while ($i > 0) - { - if ($i & 1) $ctx .= chr (0); - else $ctx .= $pw[0]; - $i = $i >> 1; - } - $final = hex2bin (md5 ($ctx)); + while ($i > 0) + { + if ($i & 1) $ctx .= chr (0); + else $ctx .= $pw[0]; + $i = $i >> 1; + } + $final = hex2bin (md5 ($ctx)); - for ($i=0;$i<1000;$i++) - { - $ctx1 = ""; - if ($i & 1) - { - $ctx1 .= $pw; - } - else - { - $ctx1 .= substr ($final,0,16); - } - if ($i % 3) $ctx1 .= $salt; - if ($i % 7) $ctx1 .= $pw; - if ($i & 1) - { - $ctx1 .= substr ($final,0,16); - } - else - { - $ctx1 .= $pw; - } - $final = hex2bin (md5 ($ctx1)); - } - $passwd = ""; - $passwd .= to64 (((ord ($final[0]) << 16) | (ord ($final[6]) << 8) | (ord ($final[12]))), 4); - $passwd .= to64 (((ord ($final[1]) << 16) | (ord ($final[7]) << 8) | (ord ($final[13]))), 4); - $passwd .= to64 (((ord ($final[2]) << 16) | (ord ($final[8]) << 8) | (ord ($final[14]))), 4); - $passwd .= to64 (((ord ($final[3]) << 16) | (ord ($final[9]) << 8) | (ord ($final[15]))), 4); - $passwd .= to64 (((ord ($final[4]) << 16) | (ord ($final[10]) << 8) | (ord ($final[5]))), 4); - $passwd .= to64 (ord ($final[11]), 2); - return "$magic$salt\$$passwd"; + for ($i=0;$i<1000;$i++) + { + $ctx1 = ""; + if ($i & 1) + { + $ctx1 .= $pw; + } + else + { + $ctx1 .= substr ($final,0,16); + } + if ($i % 3) $ctx1 .= $salt; + if ($i % 7) $ctx1 .= $pw; + if ($i & 1) + { + $ctx1 .= substr ($final,0,16); + } + else + { + $ctx1 .= $pw; + } + $final = hex2bin (md5 ($ctx1)); + } + $passwd = ""; + $passwd .= to64 (((ord ($final[0]) << 16) | (ord ($final[6]) << 8) | (ord ($final[12]))), 4); + $passwd .= to64 (((ord ($final[1]) << 16) | (ord ($final[7]) << 8) | (ord ($final[13]))), 4); + $passwd .= to64 (((ord ($final[2]) << 16) | (ord ($final[8]) << 8) | (ord ($final[14]))), 4); + $passwd .= to64 (((ord ($final[3]) << 16) | (ord ($final[9]) << 8) | (ord ($final[15]))), 4); + $passwd .= to64 (((ord ($final[4]) << 16) | (ord ($final[10]) << 8) | (ord ($final[5]))), 4); + $passwd .= to64 (ord ($final[11]), 2); + return "$magic$salt\$$passwd"; } function create_salt () { - srand ((double) microtime ()*1000000); - $salt = substr (md5 (rand (0,9999999)), 0, 8); - return $salt; + srand ((double) microtime ()*1000000); + $salt = substr (md5 (rand (0,9999999)), 0, 8); + return $salt; } function hex2bin ($str) { - $len = strlen ($str); - $nstr = ""; - for ($i=0;$i<$len;$i+=2) - { - $num = sscanf (substr ($str,$i,2), "%x"); - $nstr.=chr ($num[0]); - } - return $nstr; + $len = strlen ($str); + $nstr = ""; + for ($i=0;$i<$len;$i+=2) + { + $num = sscanf (substr ($str,$i,2), "%x"); + $nstr.=chr ($num[0]); + } + return $nstr; } function to64 ($v, $n) { - $ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - $ret = ""; - while (($n - 1) >= 0) - { - $n--; - $ret .= $ITOA64[$v & 0x3f]; - $v = $v >> 6; - } - return $ret; + $ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + $ret = ""; + while (($n - 1) >= 0) + { + $n--; + $ret .= $ITOA64[$v & 0x3f]; + $v = $v >> 6; + } + return $ret; } @@ -1264,37 +1264,37 @@ // function smtp_mail ($to, $from, $data) { - global $CONF; - $smtpd_server = $CONF['smtp_server']; - $smtpd_port = $CONF['smtp_port']; - $smtp_server = $_SERVER["SERVER_NAME"]; - $errno = "0"; - $errstr = "0"; - $timeout = "30"; + global $CONF; + $smtpd_server = $CONF['smtp_server']; + $smtpd_port = $CONF['smtp_port']; + $smtp_server = $_SERVER["SERVER_NAME"]; + $errno = "0"; + $errstr = "0"; + $timeout = "30"; - $fh = @fsockopen ($smtpd_server, $smtpd_port, $errno, $errstr, $timeout); + $fh = @fsockopen ($smtpd_server, $smtpd_port, $errno, $errstr, $timeout); - if (!$fh) - { - return false; - } - else - { - fputs ($fh, "EHLO $smtp_server\r\n"); - $res = smtp_get_response($fh); - fputs ($fh, "MAIL FROM:<$from>\r\n"); - $res = smtp_get_response($fh); - fputs ($fh, "RCPT TO:<$to>\r\n"); - $res = smtp_get_response($fh); - fputs ($fh, "DATA\r\n"); - $res = smtp_get_response($fh); - fputs ($fh, "$data\r\n.\r\n"); - $res = smtp_get_response($fh); - fputs ($fh, "QUIT\r\n"); - $res = smtp_get_response($fh); - fclose ($fh); - } - return true; + if (!$fh) + { + return false; + } + else + { + fputs ($fh, "EHLO $smtp_server\r\n"); + $res = smtp_get_response($fh); + fputs ($fh, "MAIL FROM:<$from>\r\n"); + $res = smtp_get_response($fh); + fputs ($fh, "RCPT TO:<$to>\r\n"); + $res = smtp_get_response($fh); + fputs ($fh, "DATA\r\n"); + $res = smtp_get_response($fh); + fputs ($fh, "$data\r\n.\r\n"); + $res = smtp_get_response($fh); + fputs ($fh, "QUIT\r\n"); + $res = smtp_get_response($fh); + fclose ($fh); + } + return true; } @@ -1306,11 +1306,11 @@ // function smtp_get_response ($fh) { - $res =''; - do + $res =''; + do { - $line = fgets($fh, 256); - $res .= $line; + $line = fgets($fh, 256); + $res .= $line; } while (preg_match("/^\d\d\d\-/", $line)); return $res; @@ -1319,12 +1319,12 @@ $DEBUG_TEXT = "\n - <p />\n - Please check the documentation and website for more information.\n - <p />\n - <a href=\"http://postfixadmin.sf.net/\">Postfix Admin</a><br />\n - <a href='https://sourceforge.net/forum/forum.php?forum_id=676076'>Forums</a> - "; + <p />\n + Please check the documentation and website for more information.\n + <p />\n + <a href=\"http://postfixadmin.sf.net/\">Postfix Admin</a><br />\n + <a href='https://sourceforge.net/forum/forum.php?forum_id=676076'>Forums</a> + "; /** @@ -1342,84 +1342,84 @@ */ function db_connect ($ignore_errors = 0) { - global $CONF; - global $DEBUG_TEXT; - if ($ignore_errors != 0) $DEBUG_TEXT = ''; - $error_text = ''; - $link = 0; + global $CONF; + global $DEBUG_TEXT; + if ($ignore_errors != 0) $DEBUG_TEXT = ''; + $error_text = ''; + $link = 0; - if ($CONF['database_type'] == "mysql") - { - if (function_exists ("mysql_connect")) - { - $link = @mysql_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " . mysql_error () . "$DEBUG_TEXT"); - 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 .= ("<p />DEBUG INFORMATION:<br />MySQL Select Database: " . mysql_error () . "$DEBUG_TEXT"); - } - } - else - { - $error_text .= "<p />DEBUG INFORMATION:<br />MySQL 3.x / 4.0 functions not available!<br />database_type = 'mysql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; - } - } - elseif ($CONF['database_type'] == "mysqli") - { - if (function_exists ("mysqli_connect")) - { - $link = @mysqli_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " . mysqli_connect_error () . "$DEBUG_TEXT"); - 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 .= ("<p />DEBUG INFORMATION:<br />MySQLi Select Database: " . mysqli_error ($link) . "$DEBUG_TEXT"); - } - } - else - { - $error_text .= "<p />DEBUG INFORMATION:<br />MySQL 4.1 functions not available!<br />database_type = 'mysqli' in config.inc.php, are you using a different database? $DEBUG_TEXT"; - } - } - elseif ($CONF['database_type'] == "pgsql") - { - if (function_exists ("pg_pconnect")) - { - $connect_string = "host=" . $CONF['database_host'] . " dbname=" . $CONF['database_name'] . " user=" . $CONF['database_user'] . " password=" . $CONF['database_password']; - $link = @pg_pconnect ($connect_string) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: failed to connect to database. $DEBUG_TEXT"); - if ($link) pg_set_client_encoding($link, 'UNICODE'); - } - else - { - $error_text .= "<p />DEBUG INFORMATION:<br />PostgreSQL functions not available!<br />database_type = 'pgsql' in config.inc.php, are you using a different database? $DEBUG_TEXT"; - } - } - else - { - $error_text = "<p />DEBUG INFORMATION:<br />Invalid \$CONF['database_type']! Please fix your config.inc.php! $DEBUG_TEXT"; - } + if ($CONF['database_type'] == "mysql") + { + if (function_exists ("mysql_connect")) + { + $link = @mysql_connect ($CONF['database_host'], $CONF['database_user'], $CONF['database_password']) or $error_text .= ("<p />DEBUG INFORMATION:<br />Connect: " ... [truncated message content] |
From: <Gin...@us...> - 2009-01-15 13:02:25
|
Revision: 521 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=521&view=rev Author: GingerDog Date: 2009-01-15 12:24:56 +0000 (Thu, 15 Jan 2009) Log Message: ----------- CHANGELOG.TXT: 2.3beta.. soon perhaps Modified Paths: -------------- trunk/CHANGELOG.TXT Modified: trunk/CHANGELOG.TXT =================================================================== --- trunk/CHANGELOG.TXT 2009-01-15 12:24:36 UTC (rev 520) +++ trunk/CHANGELOG.TXT 2009-01-15 12:24:56 UTC (rev 521) @@ -14,6 +14,9 @@ Only in SVN trunk -------------------- +Version 2.3 Beta - 2009/01/15 - SVN r518 +----------------------------------------- + - added support for domain aliases (from lenix) (can be disabled with $CONF['alias_domain']) Important: If you update from a previous version, you'll have to adapt your postfix configuration (see DOCUMENTS/POSTFIX_CONF.txt) - or just disable alias domain support, @@ -40,7 +43,7 @@ - show links to create mailboxes or alias even on disabled domains - added support for fetchmail's "ssl" option - superadmin can now setup fetchmail for all users, not only for himself - - force username to be lowercase - this helps some IMAP clients apprently + - force username to be lowercase - this helps some IMAP clients apparently - the "probably undeliverable" marker now honors catchall targets - on mailbox creation, show password if $CONF['generate_password'] == 'YES', but do not show it if it was _not_ autogenerated and $CONF['show_password'] == 'NO' @@ -48,7 +51,10 @@ - dropped obsolete VIRTUAL_VACATION/mail-filter script - translation updates - several small bugfixes - - SVN revision ******************************* + - Added domain-postcreation script support + - Added dovecot quota support (documentation + viewing in postfixadmin) + - Enhanced mailbox table to make it easier for people to customise where mailboxes live + - Enhanced fetchmail.pl script (file locking, syslog logging, configuration file etc) Version 2.2.1.1 - 2008/07/23 - SVN r412 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 13:02:24
|
Revision: 522 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=522&view=rev Author: GingerDog Date: 2009-01-15 12:25:19 +0000 (Thu, 15 Jan 2009) Log Message: ----------- config.inc.php: do not default to this being enabled Modified Paths: -------------- trunk/config.inc.php Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-01-15 12:24:56 UTC (rev 521) +++ trunk/config.inc.php 2009-01-15 12:25:19 UTC (rev 522) @@ -312,7 +312,7 @@ // Note that this may fail if PHP is run in "safe mode", or if // operating system features (such as SELinux) or limitations // prevent the web-server from executing external scripts. -$CONF['domain_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postcreation.sh'; +//$CONF['domain_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postcreation.sh'; // Optional: // Script to run after deletion of domains. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 13:02:15
|
Revision: 523 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=523&view=rev Author: GingerDog Date: 2009-01-15 12:25:41 +0000 (Thu, 15 Jan 2009) Log Message: ----------- try to be more helpful Modified Paths: -------------- trunk/setup.php Modified: trunk/setup.php =================================================================== --- trunk/setup.php 2009-01-15 12:25:19 UTC (rev 522) +++ trunk/setup.php 2009-01-15 12:25:41 UTC (rev 523) @@ -320,7 +320,7 @@ if (isset ($_POST['fUsername'])) $tUsername = escape_string ($_POST['fUsername']); } else { print "<p><b>$tMessage</b></p>"; - echo "<p><b>You can now log in to Postfix Admin.</b></p>"; + echo "<p><b>Delete (or rename) setup.php, and then click <a href='login.php'>here to login</a>.</b></p>"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 12:53:56
|
Revision: 518 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=518&view=rev Author: GingerDog Date: 2009-01-15 11:38:11 +0000 (Thu, 15 Jan 2009) Log Message: ----------- merge patch for dovecot quota viewing - see https://sourceforge.net/tracker/index.php?func=detail&aid=2060309&group_id=191583&atid=937966 - thank you shario; sorry it took so long to merge! Modified Paths: -------------- trunk/DOCUMENTS/DOVECOT.txt trunk/DOCUMENTS/POSTFIX_CONF.txt trunk/config.inc.php trunk/functions.inc.php trunk/list-virtual.php trunk/templates/list-virtual.php Modified: trunk/DOCUMENTS/DOVECOT.txt =================================================================== --- trunk/DOCUMENTS/DOVECOT.txt 2009-01-15 11:25:54 UTC (rev 517) +++ trunk/DOCUMENTS/DOVECOT.txt 2009-01-15 11:38:11 UTC (rev 518) @@ -1,41 +1,50 @@ # # Dovecot configuration for Postfix Admin -# Written by: Massimo <AndyCapp> Danieli +# Originally written by: Massimo <AndyCapp> Danieli +# Revised by: Sampsa Hario <shario> for Dovecot v1.0 # -1. Dovecot setup ------------------ +More complete Dovecot documentation: -dovecot.conf relevant part for postfixadmin setup +http://wiki.dovecot.org/Quota +http://wiki.dovecot.org/Quota/Dict +http://www.opensourcehowto.org/how-to/mysql/mysql-users-postfixadmin-postfix-dovecot--squirrelmail-with-userprefs-stored-in-mysql.html + +Here are the relevant parts of Dovecot v1.0.x configuration for Postfixadmin setup. Please refer to Dovecot documentation for complete information. -default_mail_env = maildir:/usr/local/virtual/%u/ +The setup gets userdb and passdb info from MySQL as well as quotas, and +uses dict backend to store used quotas as key=value pairs so that they can +be viewed real-time in Postfixadmin. -# auth_userdb specifies maildir location and user/group ID to use -auth_userdb = mysql /etc/dovecot/dovecot-mysql.conf +1. Dovecot setup +----------------- -# auth_passdb specifies user passwords -auth_passdb = mysql /etc/dovecot/dovecot-mysql.conf +default_mail_env = maildir:/usr/local/virtual/%u/ +auth default { + userdb sql { + # Path for SQL configuration file, see doc/dovecot-sql-example.conf + args = /etc/dovecot-mysql.conf + } + passdb sql { + # Path for SQL configuration file, see doc/dovecot-sql-example.conf + args = /etc/dovecot-mysql.conf + } +} + # Valid UID range for users, defaults to 500 and above. -first_valid_uid = 1001 # Change this to your postifx UID +first_valid_uid = 1001 # Change this to your postfix UID 2. Dovecot mysql setup ---------------------- -Below you'll find the relevant part of dovecot-mysql.conf file regarding our setup -Things you may need to change are db_password, uid and gid +Below you'll find the relevant part of dovecot-mysql.conf file regarding our +setup. Things you may need to change are db_password, uid and gid: -db_host = localhost -db_port = 3306 -# Default sock for Debian sarge -db_unix_socket = /var/run/mysqld/mysqld.sock -db = postfix -db_user = postfix -db_passwd = postfix -db_client_flags = 0 +connect = host=localhost dbname=postfix user=postfix password=postfix # Default password scheme. # depends on your $CONF['encrypt'] setting: @@ -44,12 +53,80 @@ # cleartext -> PLAIN default_pass_scheme = MD5-CRYPT -# Query to retrieve password. +# Query to retrieve password. user can be used to retrieve username in other +# formats also. -password_query = SELECT password FROM mailbox WHERE username = '%u' +password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' AND active='1' # Query to retrieve user information. -user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' +user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' AND active='1' -NB The GID and UID are for postfix user and group ID, NOT MySQL user and group ID. +NB! The GID and UID are for postfix user and group ID, NOT MySQL user and group ID. + + +3. Dovecot v1.0 quota support (optional) +---------------------------------------- + +Please note that you need to use Dovecot's own local delivery agent to +enforce and update quotas. Then you can view real-time used quotas in +Postfixadmin. + +Add to dovecot.conf: + +## IMAP quota +protocol imap { + quota = dict:storage=200000 proxy::quota +} + +## POP quota +protocol pop3 { + mail_plugins = quota +} + +## Local Delivery Agent +protocol lda { + mail_plugins = quota +} + +## Dictionary DB proxy +dict { + quota = mysql:/etc/dovecot-dict-quota.conf +} + +## Default quota values +plugin { +quota = dict:storage=200000 proxy::quota +} + + +Change dovecot-mysql.conf to return quota values: + +user_query = SELECT maildir, 1001 AS uid, 1001 AS gid, CONCAT('dict:storage=',floor(quota/1000),' proxy::quota') as quota FROM mailbox WHERE username = '%u' + + +Create file dovecot-dict-quota.conf: + +driver = mysql +connect = host=localhost dbname=postfix user=postfix password=postfix +default_pass_scheme = MD5-CRYPT +table = quota +select_field = current +where_field = path +username_field = username + + +Create database in Mysql: + +create table quota ( + username varchar(255) not null, + path varchar(100) not null, + current integer, + primary key (username, path) +); + + +Enable quota support in Postfixadmin config.inc.php: + +$CONF['used_quotas'] = 'YES'; +$CONF['quota'] = 'YES'; Modified: trunk/DOCUMENTS/POSTFIX_CONF.txt =================================================================== --- trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-01-15 11:25:54 UTC (rev 517) +++ trunk/DOCUMENTS/POSTFIX_CONF.txt 2009-01-15 11:38:11 UTC (rev 518) @@ -18,6 +18,15 @@ proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf +# Additional for quota support +virtual_create_maildirsize = yes +virtual_mailbox_extended = yes +virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf +virtual_mailbox_limit_override = yes +virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his +diskspace quota, please try again later. +virtual_overquota_bounce = yes + Where you chose to store the .cf files doesn't really matter, but they will have database passwords stored in plain text so they should be readable only by user postfix, or in a directory only accessible to user postfix. @@ -84,6 +93,15 @@ dbname = postfix query = SELECT CONCAT(domain,'/',maildir) FROM mailbox,alias_domain WHERE alias_domain.alias_domain = '%d' and mailbox.username = CONCAT('%u', '@', alias_domain.target_domain) AND mailbox.active = 1 +# For quota support + +mysql-virtual-mailbox-limit-maps.cf: +user = postfix +password = password +hosts = localhost +dbname = postfix +query = SELECT quota FROM mailbox WHERE username='%s' AND active = '1' + ------------------------- More information - HowTo docs that use PostfixAdmin Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-01-15 11:25:54 UTC (rev 517) +++ trunk/config.inc.php 2009-01-15 11:38:11 UTC (rev 518) @@ -68,6 +68,7 @@ 'mailbox' => 'mailbox', 'vacation' => 'vacation', 'vacation_notification' => 'vacation_notification', + 'quota' => 'quota', ); // Site Admin @@ -333,7 +334,16 @@ // // Specify '' for Dovecot and 'INBOX.' for Courier. $CONF['create_mailbox_subdirs_prefix']='INBOX.'; + +// Optional: +// Show used quotas from Dovecot dictionary backend in virtual +// mailbox listing. +// See: DOCUMENTATION/DOVECOT.txt +// http://wiki.dovecot.org/Quota/Dict // +// $CONF['used_quotas'] = 'YES'; + +// // Normally, the TCP port number does not have to be specified. // $CONF['create_mailbox_subdirs_hostport']=143; // Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-01-15 11:25:54 UTC (rev 517) +++ trunk/functions.inc.php 2009-01-15 11:38:11 UTC (rev 518) @@ -714,7 +714,7 @@ { global $CONF; if ($quota == -1) return $quota; - $value = $quota / $CONF['quota_multiplier']; + $value = round($quota / $CONF['quota_multiplier'],2); return $value; } @@ -2257,4 +2257,5 @@ $table_mailbox = table_by_key ('mailbox'); $table_vacation = table_by_key ('vacation'); $table_vacation_notification = table_by_key('vacation_notification'); +$table_quota = table_by_key ('quota'); /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ Modified: trunk/list-virtual.php =================================================================== --- trunk/list-virtual.php 2009-01-15 11:25:54 UTC (rev 517) +++ trunk/list-virtual.php 2009-01-15 11:38:11 UTC (rev 518) @@ -139,7 +139,10 @@ if ($CONF['vacation_control_admin'] == 'YES') { - $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + if ($CONF['used_quotas'] == 'YES') + $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active, $table_quota.current FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email LEFT JOIN $table_quota ON $table_mailbox.username=$table_quota.username WHERE $table_mailbox.domain='$fDomain' AND $table_quota.path='quota/storage' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; + else + $query = "SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $page_size OFFSET $fDisplay"; } else { Modified: trunk/templates/list-virtual.php =================================================================== --- trunk/templates/list-virtual.php 2009-01-15 11:25:54 UTC (rev 517) +++ trunk/templates/list-virtual.php 2009-01-15 11:38:11 UTC (rev 518) @@ -296,6 +296,8 @@ } else { + if ($CONF['used_quotas'] == 'YES') + print divide_quota ($tMailbox[$i]['current']).'/'; print divide_quota ($tMailbox[$i]['quota']); } print "</td>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 11:26:04
|
Revision: 517 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=517&view=rev Author: GingerDog Date: 2009-01-15 11:25:54 +0000 (Thu, 15 Jan 2009) Log Message: ----------- fetchmail.pl: applied patch from albanpeignier - add locking, config file and syslog stuff to fetchmail.pl Modified Paths: -------------- trunk/ADDITIONS/fetchmail.pl Modified: trunk/ADDITIONS/fetchmail.pl =================================================================== --- trunk/ADDITIONS/fetchmail.pl 2009-01-15 11:19:51 UTC (rev 516) +++ trunk/ADDITIONS/fetchmail.pl 2009-01-15 11:25:54 UTC (rev 517) @@ -3,19 +3,53 @@ use DBI; use MIME::Base64; # use Data::Dumper; +use File::Temp qw/ mkstemp /; +use Sys::Syslog; +# require liblockfile-simple-perl +use LockFile::Simple qw(lock trylock unlock); -# the home dir of vmail user: -$vmail_dir="/home/maildirs"; +openlog("fetchmail-all", "pid", "mail"); +sub log_and_die { + my($message) = @_; + syslog("err", $message); + die $message; +} + +# read options and arguments + +$configfile = "/etc/fetchmail-all/config"; + +@ARGS1 = @ARGV; + +while ($_ = shift @ARGS1) { + if (/^-/) { + if (/^--config$/) { + $configfile = shift @ARGS1 + } + } +} + # mysql settings $database="mailadmin"; $hostname="127.0.0.1"; $user="mail"; -$password="*****"; + +$run_dir="/var/run/fetchmail"; + +# use specified config file +if (-e $configfile) { + do $configfile; +} + $dsn = "DBI:mysql:database=$database;host=$hostname"; +$lock_file=$run_dir . "/fetchmail-all.lock"; +$lockmgr = LockFile::Simple->make(-autoclean => 1, -max => 1); +$lockmgr->lock($lock_file) || log_and_die "can't lock ${lock_file}"; + #mysql connect -$dbh = DBI->connect($dsn, $user, $password) || die "cannot connect the database"; +$dbh = DBI->connect($dsn, $user, $password) || log_and_die "cannot connect the database"; $sql=<<SQL; SELECT id,mailbox,src_server,src_auth,src_user,src_password,src_folder,fetchall,keep,protocol,mda,extra_options,usessl @@ -26,6 +60,8 @@ my (%config); map{ my ($id,$mailbox,$src_server,$src_auth,$src_user,$src_password,$src_folder,$fetchall,$keep,$protocol,$mda,$extra_options,$usessl)=@$_; + + syslog("info","fetch ${src_user}@${src_server} for ${mailbox}"); $cmd="user '${src_user}' there with password '".decode_base64($src_password)."'"; $cmd.=" folder '${src_folder}'" if ($src_folder); @@ -44,21 +80,24 @@ set nobouncemail set no spambounce set properties "" +set syslog poll ${src_server} with proto ${protocol} $cmd TXT - open X,"> ${vmail_dir}/.fetchmailrc" || die "cannot open/create ${vmail_dir}/.fetchmailrc"; - print X $text; - close X; - chmod 0600,"${vmail_dir}/.fetchmailrc"; - $ret=`/usr/bin/fetchmail`; - $sql="UPDATE fetchmail SET returned_text=".$dbh->quote($ret).", date=now() WHERE id=".$id; - $dbh->do($sql); + ($file_handler, $filename) = mkstemp( "/tmp/fetchmail-all-XXXXX" ) or log_and_die "cannot open/create fetchmail temp file"; + print $file_handler $text; + close $file_handler; + $ret=`/usr/bin/fetchmail -f $filename -i $run_dir/fetchmail.pid`; + + unlink $filename; + + $sql="UPDATE fetchmail SET returned_text=".$dbh->quote($ret).", date=now() WHERE id=".$id; + $dbh->do($sql); }@{$dbh->selectall_arrayref($sql)}; -unlink "${vmail_dir}/.fetchmailrc"; - +$lockmgr->unlock($lock_file); +closelog(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-15 11:19:57
|
Revision: 516 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=516&view=rev Author: GingerDog Date: 2009-01-15 11:19:51 +0000 (Thu, 15 Jan 2009) Log Message: ----------- add patch for domain postcreation script; see https://sourceforge.net/tracker/index.php?func=detail&aid=2508593&group_id=191583&atid=937966 Modified Paths: -------------- trunk/config.inc.php trunk/create-domain.php trunk/functions.inc.php Modified: trunk/config.inc.php =================================================================== --- trunk/config.inc.php 2009-01-14 16:03:50 UTC (rev 515) +++ trunk/config.inc.php 2009-01-15 11:19:51 UTC (rev 516) @@ -307,6 +307,13 @@ // $CONF['mailbox_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postdeletion.sh'; // Optional: +// Script to run after creation of domains. +// Note that this may fail if PHP is run in "safe mode", or if +// operating system features (such as SELinux) or limitations +// prevent the web-server from executing external scripts. +$CONF['domain_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postcreation.sh'; + +// Optional: // Script to run after deletion of domains. // Note that this may fail if PHP is run in "safe mode", or if // operating system features (such as SELinux) or limitations Modified: trunk/create-domain.php =================================================================== --- trunk/create-domain.php 2009-01-14 16:03:50 UTC (rev 515) +++ trunk/create-domain.php 2009-01-15 11:19:51 UTC (rev 516) @@ -136,6 +136,10 @@ } $tMessage = $PALANG['pAdminCreate_domain_result_success'] . "<br />($fDomain)</br />"; } + if (!domain_postcreation($fDomain)) + { + $tMessage = $PALANG['pAdminCreate_domain_error']; + } } } Modified: trunk/functions.inc.php =================================================================== --- trunk/functions.inc.php 2009-01-14 16:03:50 UTC (rev 515) +++ trunk/functions.inc.php 2009-01-15 11:19:51 UTC (rev 516) @@ -1805,6 +1805,42 @@ } /* + Called after a domain has been added in the DBMS. + Returns: boolean. + */ +function domain_postcreation($domain) +{ + global $CONF; + $confpar='domain_postcreation_script'; + + if (!isset($CONF[$confpar]) || empty($CONF[$confpar])) + { + return true; + } + + if (empty($domain)) + { + print '<p>Warning: empty domain parameter.</p>'; + return false; + } + + $cmdarg1=escapeshellarg($domain); + $command=$CONF[$confpar]." $cmdarg1"; + $retval=0; + $output=array(); + $firstline=''; + $firstline=exec($command,$output,$retval); + if (0!=$retval) + { + error_log("Running $command yielded return value=$retval, first line of output=$firstline"); + print '<p>WARNING: Problems running domain postcreation script!</p>'; + return FALSE; + } + + return TRUE; +} + +/* Called after a domain has been deleted in the DBMS. Returns: boolean. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-14 16:04:00
|
Revision: 515 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=515&view=rev Author: GingerDog Date: 2009-01-14 16:03:50 +0000 (Wed, 14 Jan 2009) Log Message: ----------- en.lang: see ticket 2359801 - make login messages more generic Modified Paths: -------------- trunk/languages/en.lang trunk/login.php Modified: trunk/languages/en.lang =================================================================== --- trunk/languages/en.lang 2009-01-14 13:13:25 UTC (rev 514) +++ trunk/languages/en.lang 2009-01-14 16:03:50 UTC (rev 515) @@ -24,8 +24,7 @@ $PALANG['pLogin_username'] = 'Login (email)'; $PALANG['pLogin_password'] = 'Password'; $PALANG['pLogin_button'] = 'Login'; -$PALANG['pLogin_username_incorrect'] = '<span class="error_msg">Your login is not correct. Make sure that you login with your email address!</span>'; -$PALANG['pLogin_password_incorrect'] = '<span class="error_msg">Your password is not correct!</span>'; +$PALANG['pLogin_failed'] = '<span class="error_msg">Your email address or password are not correct.</span>'; $PALANG['pLogin_login_users'] = 'Users click here to login to the user section.'; $PALANG['pMenu_main'] = 'Main'; Modified: trunk/login.php =================================================================== --- trunk/login.php 2009-01-14 13:13:25 UTC (rev 514) +++ trunk/login.php 2009-01-14 16:03:50 UTC (rev 515) @@ -71,14 +71,14 @@ if ($result['rows'] != 1) { $error = 1; - $tMessage = $PALANG['pLogin_password_incorrect']; + $tMessage = $PALANG['pLogin_failed']; $tUsername = $fUsername; } } else { $error = 1; - $tMessage = $PALANG['pLogin_username_incorrect']; + $tMessage = $PALANG['pLogin_failed']; } if ($error != 1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-14 13:13:33
|
Revision: 514 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=514&view=rev Author: GingerDog Date: 2009-01-14 13:13:25 +0000 (Wed, 14 Jan 2009) Log Message: ----------- upgrade.php: see tdiehl on irc.. perhaps this fixes his problem (i hate mysql) Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-01-13 14:22:00 UTC (rev 513) +++ trunk/upgrade.php 2009-01-14 13:13:25 UTC (rev 514) @@ -756,8 +756,6 @@ $result = db_query_parsed($sql, TRUE); } - # creation of vacation_notification table moved to upgrade_318_mysql because - # the query in this function was broken (key length vs. utf8 charset) } /** @@ -793,7 +791,7 @@ db_query_parsed( " CREATE TABLE {IF_NOT_EXISTS} $table_vacation_notification ( - on_vacation varchar(255) NOT NULL, + on_vacation varchar(255) {LATIN1} NOT NULL, notified varchar(255) NOT NULL, notified_at timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY on_vacation (`on_vacation`, `notified`), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-13 14:22:12
|
Revision: 513 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=513&view=rev Author: GingerDog Date: 2009-01-13 14:22:00 +0000 (Tue, 13 Jan 2009) Log Message: ----------- wiza thinks this is hte correct behaviour (i.e return true not false Modified Paths: -------------- trunk/VIRTUAL_VACATION/vacation.pl Modified: trunk/VIRTUAL_VACATION/vacation.pl =================================================================== --- trunk/VIRTUAL_VACATION/vacation.pl 2009-01-12 21:14:08 UTC (rev 512) +++ trunk/VIRTUAL_VACATION/vacation.pl 2009-01-13 14:22:00 UTC (rev 513) @@ -247,7 +247,7 @@ if ($e !~ /(?:_pkey|^Duplicate entry)/) { $logger->error("Failed to insert into vacation_notification table (to:$to from:$from error:'$e' query:'$query')"); # Let's play safe and notify anyway - return 0; + return 1; } if ($interval) { $query = qq{SELECT NOW()-notified_at FROM vacation_notification WHERE on_vacation=? AND notified=?}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-12 21:14:12
|
Revision: 512 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=512&view=rev Author: GingerDog Date: 2009-01-12 21:14:08 +0000 (Mon, 12 Jan 2009) Log Message: ----------- delete.php: this probably allows you to delete domains Modified Paths: -------------- trunk/delete.php Modified: trunk/delete.php =================================================================== --- trunk/delete.php 2009-01-12 21:08:51 UTC (rev 511) +++ trunk/delete.php 2009-01-12 21:14:08 UTC (rev 512) @@ -61,7 +61,6 @@ header ("Location: $url"); } } # ($fTable == "admin") - elseif ($fTable == "domain") { authentication_require_role('global-admin'); @@ -87,6 +86,15 @@ header ("Location: $url"); } } # ($fTable == "domain") +elseif ($fTable == "alias_domain") +{ + authentication_require_role('global-admin'); + $fWhere = 'domain'; + if(db_delete ($table_domain_alias,$fWhere,$fDelete)) { + $url = "list-domain.php"; + header ("Location: $url"); + } +} # ($fTable == "alias_domain") elseif ($fTable == "alias" or $fTable == "mailbox") { @@ -150,7 +158,6 @@ if ($CONF['database_type'] == "pgsql") db_query('ROLLBACK'); } } - else { flash_error($PALANG['invalid_parameter']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-12 21:08:56
|
Revision: 511 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=511&view=rev Author: GingerDog Date: 2009-01-12 21:08:51 +0000 (Mon, 12 Jan 2009) Log Message: ----------- upgrade.php: fix mysql alter table add columns to only take place if hte field does not exist Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-01-12 20:53:45 UTC (rev 510) +++ trunk/upgrade.php 2009-01-12 21:08:51 UTC (rev 511) @@ -326,11 +326,12 @@ # upgrade pre-2.1 database # from TABLE_BACKUP_MX.TXT $table_domain = table_by_key ('domain'); - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", TRUE); - // don't think PGSQL supports 'AFTER transport' - $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} DEFAULT {BOOL_FALSE} AFTER transport;", TRUE); - # possible errors that can be ignored: - # - Invalid query: Table 'postfix.domain' doesn't exist + if(!_mysql_field_exists($table_domain, 'transport')) { + $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;", TRUE); + } + if(!_mysql_field_exists($table_domain, 'backupmx')) { + $result = db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx {BOOLEAN} DEFAULT {BOOL_FALSE} AFTER transport;", TRUE); + } } function upgrade_2_pgsql() { @@ -468,36 +469,60 @@ $table_mailbox = table_by_key ('mailbox'); $table_vacation = table_by_key ('vacation'); - // these will not work on PostgreSQL; syntax is : - // ALTER TABLE foo RENAME f1 TO f2 - $all_sql = split("\n", trim(" - ALTER TABLE $table_admin {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_admin {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_alias {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_alias {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_domain {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_domain {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_domain ADD COLUMN aliases INT(10) DEFAULT '-1' NOT NULL AFTER description; - ALTER TABLE $table_domain ADD COLUMN mailboxes INT(10) DEFAULT '-1' NOT NULL AFTER aliases; - ALTER TABLE $table_domain ADD COLUMN maxquota INT(10) DEFAULT '-1' NOT NULL AFTER mailboxes; - ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota; - ALTER TABLE $table_domain ADD COLUMN backupmx TINYINT(1) DEFAULT '0' NOT NULL AFTER transport; - ALTER TABLE $table_mailbox {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_mailbox {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL; - ALTER TABLE $table_mailbox ADD COLUMN quota INT(10) DEFAULT '-1' NOT NULL AFTER maildir; - ALTER TABLE $table_vacation ADD COLUMN domain VARCHAR(255) DEFAULT '' NOT NULL AFTER cache; - ALTER TABLE $table_vacation ADD COLUMN created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL AFTER domain; - ALTER TABLE $table_vacation ADD COLUMN active TINYINT(1) DEFAULT '1' NOT NULL AFTER created; - ALTER TABLE $table_vacation DROP PRIMARY KEY - ALTER TABLE $table_vacation ADD PRIMARY KEY(email) - UPDATE $table_vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email; - ")); - - foreach ($all_sql as $sql) { - $result = db_query_parsed($sql, TRUE); + if(!_mysql_field_exists($table_admin, 'created')) { + db_query_parsed("ALTER TABLE $table_admin {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); } - # Possible errors that can be ignored: - # - Invalid query: Table 'postfix.*' doesn't exist + if(!_mysql_field_exists($table_admin, 'modified')) { + db_query_parsed("ALTER TABLE $table_admin {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_alias, 'created')) { + db_query_parsed("ALTER TABLE $table_alias {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_alias, 'modified')) { + db_query_parsed("ALTER TABLE $table_alias {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_domain, 'created')) { + db_query_parsed("ALTER TABLE $table_domain {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_domain, 'modified')) { + db_query_parsed("ALTER TABLE $table_domain {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_domain, 'aliases')) { + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN aliases INT(10) DEFAULT '-1' NOT NULL AFTER description;"); + } + if(!_mysql_field_exists($table_domain, 'mailboxes')) { + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN mailboxes INT(10) DEFAULT '-1' NOT NULL AFTER aliases;"); + } + if(!_mysql_field_exists($table_domain, 'maxquota')) { + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN maxquota INT(10) DEFAULT '-1' NOT NULL AFTER mailboxes;"); + } + if(!_mysql_field_exists($table_domain, 'transport')) { + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN transport VARCHAR(255) AFTER maxquota;"); + } + if(!_mysql_field_exists($table_domain, 'backupmx')) { + db_query_parsed("ALTER TABLE $table_domain ADD COLUMN backupmx TINYINT(1) DEFAULT '0' NOT NULL AFTER transport;"); + } + if(!_mysql_field_exists($table_mailbox, 'created')) { + db_query_parsed("ALTER TABLE $table_mailbox {RENAME_COLUMN} create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_mailbox, 'modified')) { + db_query_parsed("ALTER TABLE $table_mailbox {RENAME_COLUMN} change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;"); + } + if(!_mysql_field_exists($table_mailbox, 'quota')) { + db_query_parsed("ALTER TABLE $table_mailbox ADD COLUMN quota INT(10) DEFAULT '-1' NOT NULL AFTER maildir;"); + } + if(!_mysql_field_exists($table_vacation, 'domain')) { + db_query_parsed("ALTER TABLE $table_vacation ADD COLUMN domain VARCHAR(255) DEFAULT '' NOT NULL AFTER cache;"); + } + if(!_mysql_field_exists($table_vacation, 'created')) { + db_query_parsed("ALTER TABLE $table_vacation ADD COLUMN created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL AFTER domain;"); + } + if(!_mysql_field_exists($table_vacation, 'active')) { + db_query_parsed("ALTER TABLE $table_vacation ADD COLUMN active TINYINT(1) DEFAULT '1' NOT NULL AFTER created;"); + } + db_query_parsed("ALTER TABLE $table_vacation DROP PRIMARY KEY"); + db_query_parsed("ALTER TABLE $table_vacation ADD PRIMARY KEY(email)"); + db_query_parsed("UPDATE $table_vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email;"); } function upgrade_4_mysql() { # MySQL only @@ -929,9 +954,9 @@ */ function upgrade_439_mysql() { $table_fetchmail = table_by_key('fetchmail'); - db_query_parsed(" - ALTER TABLE `$table_fetchmail` ADD `ssl` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `protocol` ; - "); + if(!_mysql_field_exists($table_fetchmail, 'ssl')) { + db_query_parsed("ALTER TABLE `$table_fetchmail` ADD `ssl` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `protocol` ; "); + } } function upgrade_439_pgsql() { $table_fetchmail = table_by_key('fetchmail'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-12 20:53:55
|
Revision: 510 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=510&view=rev Author: GingerDog Date: 2009-01-12 20:53:45 +0000 (Mon, 12 Jan 2009) Log Message: ----------- upgrade.php: add _mysql_field_exists() so we do not add fields that are already there; fix bugs -hopefully fix errors seen by Tom me...@td... - see postfixadmin-devel mailing list etc Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-01-07 19:59:33 UTC (rev 509) +++ trunk/upgrade.php 2009-01-12 20:53:45 UTC (rev 510) @@ -49,6 +49,15 @@ return false; } +function _mysql_field_exists($table, $field) { + $sql = "SHOW COLUMNS FROM $table LIKE '$field'"; + $r = db_query($sql); + $row = db_row($r['result']); + if($row) { + return true; + } + return false; +} $table = table_by_key('config'); if($CONF['database_type'] == 'pgsql') { @@ -772,7 +781,6 @@ # in case someone has manually created the table with utf8 fields before: $all_sql = split("\n", trim(" - ALTER TABLE `$table_vacation_notification` CHANGE `on_vacation` `on_vacation` VARCHAR( 255 ) NOT NULL ALTER TABLE `$table_vacation_notification` CHANGE `notified` `notified` VARCHAR( 255 ) NOT NULL ALTER TABLE `$table_vacation_notification` DEFAULT CHARACTER SET utf8 ")); @@ -990,11 +998,15 @@ function upgrade_479_mysql () { # ssl is a reserved word in MySQL and causes several problems. Renaming the field... $table_fmail = table_by_key('fetchmail'); - db_query_parsed("ALTER TABLE `$table_fmail` CHANGE `ssl` `usessl` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); + if(!_mysql_field_exists($table_fmail, 'usessl')) { + db_query_parsed("ALTER TABLE `$table_fmail` CHANGE `ssl` `usessl` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); + } } function upgrade_479_pgsql () { $table_fmail = table_by_key('fetchmail'); - db_query_parsed("alter table $table_fmail rename column ssl to usessl"); + if(!_pgsql_field_exists($table_fmail, 'usessl')) { + db_query_parsed("alter table $table_fmail rename column ssl to usessl"); + } } function upgrade_483_mysql () { @@ -1016,9 +1028,11 @@ # See https://sourceforge.net/forum/message.php?msg_id=5394663 function upgrade_495_mysql() { $table_mailbox = table_by_key('mailbox'); - db_query_parsed("ALTER TABLE $table_mailbox add local_part varchar(255) AFTER quota"); // allow to be null - db_query_parsed("UPDATE $table_mailbox SET local_part = substring_index(username, '@', 1)"); - db_query_parsed("ALTER TABLE $table_mailbox change local_part local_part varchar(255) NOT NULL"); // remove null-ness... + if(!_mysql_field_exists($table_mailbox, 'local_part')) { + db_query_parsed("ALTER TABLE $table_mailbox add local_part varchar(255) AFTER quota"); // allow to be null + db_query_parsed("UPDATE $table_mailbox SET local_part = substring_index(username, '@', 1)"); + db_query_parsed("ALTER TABLE $table_mailbox change local_part local_part varchar(255) NOT NULL"); // remove null-ness... + } } function upgrade_504_mysql() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-07 19:59:47
|
Revision: 509 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=509&view=rev Author: GingerDog Date: 2009-01-07 19:59:33 +0000 (Wed, 07 Jan 2009) Log Message: ----------- upgrade.php: this makes it work for me... Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-01-06 19:51:45 UTC (rev 508) +++ trunk/upgrade.php 2009-01-07 19:59:33 UTC (rev 509) @@ -766,7 +766,7 @@ CONSTRAINT `vacation_notification_pkey` FOREIGN KEY (`on_vacation`) REFERENCES $table_vacation(`email`) ON DELETE CASCADE ) - ENGINE=InnoDB DEFAULT {LATIN1} TYPE=InnoDB + ENGINE=InnoDB TYPE=InnoDB COMMENT='Postfix Admin - Virtual Vacation Notifications' "); @@ -774,7 +774,7 @@ $all_sql = split("\n", trim(" ALTER TABLE `$table_vacation_notification` CHANGE `on_vacation` `on_vacation` VARCHAR( 255 ) NOT NULL ALTER TABLE `$table_vacation_notification` CHANGE `notified` `notified` VARCHAR( 255 ) NOT NULL - ALTER TABLE `$table_vacation_notification` DEFAULT {LATIN1} + ALTER TABLE `$table_vacation_notification` DEFAULT CHARACTER SET utf8 ")); # Possible errors that can be ignored: # None. @@ -785,10 +785,6 @@ $result = db_query_parsed($sql); } - # create constraint... - $result = db_query_parsed(" - ALTER TABLE $table_vacation_notification ADD CONSTRAINT `vacation_notification_pkey` - FOREIGN KEY (`on_vacation`) REFERENCES $table_vacation(`email`) ON DELETE CASCADE "); } @@ -800,7 +796,7 @@ $table_fetchmail = table_by_key('fetchmail'); db_query_parsed( " - create table $table_fetchmail( + CREATE TABLE IF NOT EXISTS $table_fetchmail( id int(11) unsigned not null auto_increment, mailbox varchar(255) not null default '', src_server varchar(255) not null default '', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-06 19:51:52
|
Revision: 508 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=508&view=rev Author: GingerDog Date: 2009-01-06 19:51:45 +0000 (Tue, 06 Jan 2009) Log Message: ----------- upgrade.php: Fixes from Thiago Silva - see https://sourceforge.net/forum/forum.php?thread_id=2789651&forum_id=676076 Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-01-05 19:44:15 UTC (rev 507) +++ trunk/upgrade.php 2009-01-06 19:51:45 UTC (rev 508) @@ -714,7 +714,7 @@ ALTER TABLE `$table_vacation` CHANGE `cache` `cache` TEXT {LATIN1} NOT NULL ALTER TABLE `$table_vacation` CHANGE `domain` `domain` VARCHAR( 255 ) {LATIN1} NOT NULL ALTER TABLE `$table_vacation` CHANGE `active` `active` TINYINT( 1 ) NOT NULL DEFAULT '1' - ALTER TABLE `$table_vacation` DEFAULT {LATIN1} + ALTER TABLE `$table_vacation` DEFAULT {LATIN1} ALTER TABLE `$table_vacation` ENGINE = INNODB ")); @@ -774,7 +774,7 @@ $all_sql = split("\n", trim(" ALTER TABLE `$table_vacation_notification` CHANGE `on_vacation` `on_vacation` VARCHAR( 255 ) NOT NULL ALTER TABLE `$table_vacation_notification` CHANGE `notified` `notified` VARCHAR( 255 ) NOT NULL - ALTER TABLE `$table_vacation_notification` DEFAULT + ALTER TABLE `$table_vacation_notification` DEFAULT {LATIN1} ")); # Possible errors that can be ignored: # None. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-05 19:44:20
|
Revision: 507 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=507&view=rev Author: GingerDog Date: 2009-01-05 19:44:15 +0000 (Mon, 05 Jan 2009) Log Message: ----------- upgrade.php: vain attempt to stop stupid upgrade errors Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2009-01-04 19:11:29 UTC (rev 506) +++ trunk/upgrade.php 2009-01-05 19:44:15 UTC (rev 507) @@ -772,9 +772,9 @@ # in case someone has manually created the table with utf8 fields before: $all_sql = split("\n", trim(" - ALTER TABLE `$table_vacation_notification` CHANGE `on_vacation` `on_vacation` VARCHAR( 255 ) {LATIN1} NOT NULL - ALTER TABLE `$table_vacation_notification` CHANGE `notified` `notified` VARCHAR( 255 ) {LATIN1} NOT NULL - ALTER TABLE `$table_vacation_notification` DEFAULT {LATIN1} + ALTER TABLE `$table_vacation_notification` CHANGE `on_vacation` `on_vacation` VARCHAR( 255 ) NOT NULL + ALTER TABLE `$table_vacation_notification` CHANGE `notified` `notified` VARCHAR( 255 ) NOT NULL + ALTER TABLE `$table_vacation_notification` DEFAULT ")); # Possible errors that can be ignored: # None. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2009-01-04 19:11:34
|
Revision: 506 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=506&view=rev Author: GingerDog Date: 2009-01-04 19:11:29 +0000 (Sun, 04 Jan 2009) Log Message: ----------- 1) remove explicit collation settings; 2) remove vacation_notification_pkey drop thing - see https://sourceforge.net/forum/forum.php?thread_id=2789651&forum_id=676076 Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2008-12-23 00:19:51 UTC (rev 505) +++ trunk/upgrade.php 2009-01-04 19:11:29 UTC (rev 506) @@ -156,8 +156,8 @@ '{UNSIGNED}' => 'unsigned' , '{FULLTEXT}' => 'FULLTEXT', '{BOOLEAN}' => 'tinyint(1) NOT NULL', - '{UTF-8}' => '/*!40100 CHARACTER SET utf8 COLLATE utf8_unicode_ci */', - '{LATIN1}' => '/*!40100 CHARACTER SET latin1 COLLATE latin1_swedish_ci */', + '{UTF-8}' => '/*!40100 CHARACTER SET utf8 */', + '{LATIN1}' => '/*!40100 CHARACTER SET latin1 */', '{IF_NOT_EXISTS}' => 'IF NOT EXISTS', '{RENAME_COLUMN}' => 'CHANGE COLUMN', ); @@ -306,7 +306,7 @@ active tinyint(4) NOT NULL default '1', PRIMARY KEY (email), KEY email (email) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci TYPE=InnoDB COMMENT='Postfix Admin - Virtual Vacation' ;"; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 TYPE=InnoDB COMMENT='Postfix Admin - Virtual Vacation' ;"; foreach($sql as $query) { db_query_parsed($query); @@ -772,7 +772,6 @@ # in case someone has manually created the table with utf8 fields before: $all_sql = split("\n", trim(" - ALTER TABLE `$table_vacation_notification` DROP FOREIGN KEY `vacation_notification_pkey` ALTER TABLE `$table_vacation_notification` CHANGE `on_vacation` `on_vacation` VARCHAR( 255 ) {LATIN1} NOT NULL ALTER TABLE `$table_vacation_notification` CHANGE `notified` `notified` VARCHAR( 255 ) {LATIN1} NOT NULL ALTER TABLE `$table_vacation_notification` DEFAULT {LATIN1} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2008-12-23 00:19:55
|
Revision: 505 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=505&view=rev Author: christian_boltz Date: 2008-12-23 00:19:51 +0000 (Tue, 23 Dec 2008) Log Message: ----------- - upgrade_495_mysql: place local_part field between quota and domain - upgrade_504_mysql: ensure correct charset for local_part Modified Paths: -------------- trunk/upgrade.php Modified: trunk/upgrade.php =================================================================== --- trunk/upgrade.php 2008-12-23 00:03:08 UTC (rev 504) +++ trunk/upgrade.php 2008-12-23 00:19:51 UTC (rev 505) @@ -1021,8 +1021,13 @@ # See https://sourceforge.net/forum/message.php?msg_id=5394663 function upgrade_495_mysql() { $table_mailbox = table_by_key('mailbox'); - db_query_parsed("ALTER TABLE $table_mailbox add local_part varchar(255) "); // allow to be null + db_query_parsed("ALTER TABLE $table_mailbox add local_part varchar(255) AFTER quota"); // allow to be null db_query_parsed("UPDATE $table_mailbox SET local_part = substring_index(username, '@', 1)"); db_query_parsed("ALTER TABLE $table_mailbox change local_part local_part varchar(255) NOT NULL"); // remove null-ness... } +function upgrade_504_mysql() { + $table_mailbox = table_by_key('mailbox'); + db_query_parsed("ALTER TABLE `$table_mailbox` CHANGE `local_part` `local_part` VARCHAR( 255 ) {LATIN1} NOT NULL"); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |