Last release created by Mischa

This commit is contained in:
mischa 2022-07-30 18:50:24 +02:00
commit 0fd75c45d5
144 changed files with 17575 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
config.inc.php
/admin/.htpasswd

39
ADDITIONS/README.TXT Normal file
View File

@ -0,0 +1,39 @@
#
# Postfix Admin ADDITIONS
#
BEFORE YOU START
----------------
**** ALL THESE SCRIPTS ARE CREATED BY THIRD PARTIES ****
**** THEY ARE AS IS, USE AT YOUR OWN RISK! ****
ADDITIONS
---------
In this directory you will find additional scripts that are build by others.
- cleanupdirs.pl
by jared bell <jared at beol dot net>
Displays a list of mailboxes that need to be deleted
- mailbox_remover.pl
by Petr Znojemsky
Deletes all unused mailboxes
- mkeveryone.pl
by Joshua Preston
Generate an 'everybody' alias for a domain.
- pfa_maildir_cleanup.pl
by Stephen Fulton <sfulton at esoteric dot ca>
Deletes all unused mailboxes
- postfixadmin-0.3-1.4.tar.gz
by Florian Kimmerl <info at spacekoeln dot de>
The Postfixadmin SquirrelMail plugin let users change their virtual alias,
vacation status/message and password.
- virtualmaildel.php
by George Vieira <george at citadelcomputer dot com dot au>
Deletes all unused mailboxes

103
ADDITIONS/cleanupdirs.pl Normal file
View File

@ -0,0 +1,103 @@
#!/usr/bin/perl -w
################################################################################
#
# cleanupdirs 1.2 by jared bell <jared@beol.net>
#
# display/remove maildir & domains directory tree's not listed in the postfix
# mysql database. currently setup for use with postfixadmin, but can be
# adapted. edit settings where it says 'change settings as needed.' by default
# this program will display a list of directories which need deleted, nothing
# is actually deleted. to change this behavior, look into the command line
# arguments.
#
# command line arguments:
# --delete
# force automatic deletion of directories. instead of displaying a list
# of deleted directories, they will be logged in the specified logfile.
# --print
# display deleted directories as well as log them. only valid when
# '--delete' has been specified.
#
# settings:
# $root_path = "/home/vmail";
# if maildir is '/home/vmail/domain.tld/user' then '/home/vmail' is the
# $root_path. if your maildirs are '/home/vmail/user@domain.tld' then
# this program will need to be modified in order to work right.
# $logfile = "/var/log/removed_maildirs.log";
# the logfile to use when $delete_old_dirs is set to 1
# $db_* = "*";
# sets the host, port, database, user and pass to your mysql server
#
# version history:
# 1.2 - removed uneeded settings. added '--print' command line argument
# 1.1 - added '--delete' command line argument
# 1.0 - initial release
#
################################################################################
use strict;
use DBI;
use File::Path;
use Getopt::Long;
### change settings as needed, see notes above #################################
my $root_path = "/home/vmail";
my $logfile = "/var/log/removed_maildirs.log";
my $db_hostname = "localhost";
my $db_port = "3306";
my $db_database = "postfix";
my $db_username = "someuser";
my $db_password = "somepass";
################################################################################
### begin program ##############################################################
my(@dirs_to_delete, $logfile_open);
my $delete_old_dirs = 0; # do not delete by default, use cmdline to change this
my $print_also = 0; # also print items when deleting, use cmdline to change this
GetOptions ('delete' => \$delete_old_dirs, 'print' => \$print_also);
my $conn_info = "DBI:mysql:database=$db_database;hostname=$db_hostname;port=$db_port";
my $dbh = DBI->connect($conn_info, $db_username, $db_password)
or die $DBI::errstr;
opendir DOMAINDIR, $root_path
or die "Unable to access directory '$root_path' ($!)";
foreach my $domain_dir (sort readdir DOMAINDIR) {
next if $domain_dir =~ /^\./; # skip dotted dirs
my $full_domain_dir = "$root_path/$domain_dir";
opendir USERDIR, $full_domain_dir
or die "Unable to access directory '$full_domain_dir' ($!)";
foreach my $user_dir (sort readdir USERDIR) {
next if $user_dir =~ /^\./; # skip dotted dirs
push @dirs_to_delete, "$full_domain_dir/$user_dir"
if &check_dir("SELECT maildir FROM mailbox WHERE maildir = ?",
"$domain_dir/$user_dir/"); # end slash needed for checkdir
}
push @dirs_to_delete, $full_domain_dir
if &check_dir("SELECT domain FROM domain WHERE domain = ?", $domain_dir);
}
closedir USERDIR;
closedir DOMAINDIR;
$dbh->disconnect;
if (@dirs_to_delete) {
foreach my $to_delete (@dirs_to_delete) {
if ($delete_old_dirs == 1) {
$logfile_open = open LOGFILE, ">> $logfile"
or die "Unable to append logfile '$logfile' ($!)"
unless $logfile_open;
rmtree $to_delete;
print LOGFILE localtime() . " Deleting directory '$to_delete'\n";
print localtime() . " Deleting directory '$to_delete'\n"
if $print_also;
} else {
print localtime() . " Need to delete directory '$to_delete'\n";
}
}
}
close LOGFILE if $logfile_open;
sub check_dir {
my($query, $dir) = @_;
my $sth = $dbh->prepare($query);
my $num_rows = $sth->execute($dir);
$sth->finish;
($num_rows eq "0E0") ? 1 : 0;
}

View File

@ -0,0 +1,66 @@
#!/usr/bin/perl
#
# by Petr Znojemsky (c) 2004
# Mailbox remover 0.1a 23/10/2004 - the very first version for MySQL
# removes maildirs from disk when they are not found in a database
# Run program and read the $logfile before uncommenting the "rmtree" line!
# All your maildirs or other directories could be accidentally removed.
# Use it at own risk. No warranties!
use DBI;
use File::Path;
##########
# Set these variables according to your configuration
$maildir_path="/var/mail/virtual/";
$logfile="/var/log/mail/removed_maildirs";
# database information
$host="localhost";
$port="3306";
$userid="postfix";
$passwd="postfix";
$db="postfix";
############
$connectionInfo="DBI:mysql:database=$db;$host:$port";
# make connection to database
$dbh = DBI->connect($connectionInfo,$userid,$passwd);
# prepare and execute query
$query = "SELECT username FROM mailbox";
$sth = $dbh->prepare($query);
$sth->execute();
# assign fields to variables
$sth->bind_columns(\$username);
# output computer list to the browser
while($sth->fetch()) {
push(@usernames, $username);
}
$sth->finish();
# disconnect from database
$dbh->disconnect;
# store maildir list to @directories
opendir(DIRHANDLE, $maildir_path) || die "Cannot open dir $maildir_path: $!";
foreach $name (sort readdir(DIRHANDLE))
{
push (@directories, $name);
}
closedir(DIRHANDLE);
# eliminate "." and ".." from the maildir list
($dot, $doubledot, @directories) = @directories;
# compare two arrays and erase maildirs not found in database
foreach $maildir (@directories)
{
if ((grep { $_ eq $maildir} @usernames)==0)
{
# username not found, delete maildir.
# Please read $logfile before uncommenting following line!
# rmtree($maildir_path.$maildir);
open(INFO, ">>$logfile") || die "Cannot write to the logfile: $logfile.";
print INFO localtime()." Maildir ".$maildir_path.$maildir." has been deleted.\n";
close(INFO);
}
}

167
ADDITIONS/mkeveryone.pl Normal file
View File

@ -0,0 +1,167 @@
#!/usr/bin/perl
#
# Generate an 'everybody' alias for a domain.
#
# Create the file /etc/mkeveryone.conf
# chmod 640 /etc/mkeveryone.conf
# Example of mkeveryone.conf
#
# userid=postfix
# passwd=postfix
# db=postfix
# host=localhost
# port=3306
# domain=domain.tld
# target=everybody@domain.tld
# ignore=vacation@domain.tld
# ignore=spam@domain.tld
# ignore=newsletter@domain.tld
# ignore=root@domain.tld
#
# Save this file in, for example, /usr/local/sbin/mkeveryone.pl
# chmod 750 /usr/local/sbin/mkeveryone.pl
#
# Run the script!
#
use DBI;
use Time::Local;
use POSIX qw(EAGAIN);
use Fcntl;
use IO;
use IO::File;
my $timeNow=time();
my $DATFILE = "/etc/mkeveryone.conf";
my $FILEHANDLE = "";
# database information
my $db="postfix";
my $host="localhost";
my $port="3306";
my $userid="postfix";
my $passwd="postfix";
my $domain="domain.tld";
my $target="everyone@$domain";
my @ignore;
my @dest;
open (FILEHANDLE, $DATFILE);
while ( $LINE = <FILEHANDLE> ) {
if ( length $LINE > 0 ) {
chomp $LINE;
$RETURNCODE = 0;
SWITCH: {
$LINE =~ /^ignore/i and do {
$LINE =~ s/^ignore// && $LINE =~ s/=// && $LINE =~ s/^ //g;
@ignore = (@ignore,$LINE);
};
$LINE =~ /^userid/i and do {
# Userid found.";
$LINE =~ s/^userid// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$userid = $LINE;
};
$LINE =~ /^passwd/i and do {
# Passwd found.";
$LINE =~ s/^passwd// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$passwd = $LINE;
};
$LINE =~ /^db/i and do {
# Database found.";
$LINE =~ s/^db// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$db = $LINE;
};
$LINE =~ /^host/i and do {
# Database host found.";
$LINE =~ s/^host// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$host = $LINE;
};
$LINE =~ /^port/i and do {
# Database host found.";
$LINE =~ s/^port// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$port = $LINE;
};
$LINE =~ /^target/i and do {
# Database host found.";
$LINE =~ s/^target// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$target = $LINE;
};
$LINE =~ /^domain/i and do {
# Database host found.";
$LINE =~ s/^domain// && $LINE =~ s/=// && $LINE =~ s/^ //g;
$domain = $LINE;
};
}
}
}
print "Connecting to database $db on $host:$port...\n\r";
print "Target email address is $target...\n\r";
my $connectionInfo="DBI:mysql:database=$db;$host:$port";
# make connection to database
$dbh = DBI->connect($connectionInfo,$userid,$passwd);
# Delete the old message...prepare and execute query
$query = "SELECT username FROM mailbox WHERE domain='$domain';";
$sth = $dbh->prepare($query);
$sth->execute();
# assign fields to variables
$sth->bind_columns(\$username);
my $ign="false";
while($sth->fetch()) {
$ign = "false";
foreach $ignored ( @ignore ) {
if ( $username eq $ignored ){
$ign = "true";
}
}
if ( $ign eq "false" ) {
@dest = (@dest,$username);
}
}
# Delete the old aliases...prepare and execute query
$query = "DELETE FROM alias WHERE address='$target';";
$sth = $dbh->prepare($query);
$sth->execute();
print "Record deleted from the database.\r\n";
$sth->finish();
$goto = join(",",@dest);
print "$goto\n\r\n\r";
# Insert the new message...prepare and execute query
$query = "INSERT INTO alias (address,goto,domain,created,modified) VALUES ('$target','$goto','$domain',now(),now());";
$sth = $dbh->prepare($query);
$sth->execute();
print "Record added to the database.\r\n";
$sth->finish();
# disconnect from databse
$dbh->disconnect;

View File

@ -0,0 +1,111 @@
#!/usr/bin/perl
#
##
## pfa_maildir_cleanup.pl
##
## (c) 2004 by Stephen Fulton (sfulton@esoteric.ca)
##
## based on a script by Petr Znojemsky (thanks!)
##
## Simple script to remove maildirs/domains not listed in a MySQL database.
## Set up for use with those using PostfixAdmin, but can be adapted.
##
## Edit the variables between the ##EDIT## to match your setup.
##
## USE AT YOUR OWN RISK. I ASSUME NO RESPONSIBILITY.
##
use DBI;
use File::Path;
##EDIT##
$root_path = "/home/mail";
$logfile = "/var/log/removed_maildirs.log";
$db_host = "localhost";
$db_database = "database";
$db_user = "username";
$db_password = 'password';
##END EDIT##
$connectionInfo = "DBI:mysql:database=$db_database;$db_host:3306";
## Read a list of domain directories in the root path /remote/mail1
opendir(DIRHANDLE, $root_path) || die "Cannot access directory $maildir_path: $!";
my @directories = ();
foreach $directory (sort readdir(DIRHANDLE)) {
push (@directories, $directory);
}
closedir(DIRHANDLE);
## Strip the "." and ".." from the directories array
($dot, $doubledot, @directories) = @directories;
## For each of the domain directories..
foreach $domain_dir (@directories) {
$complete_domain_path = "$root_path/$domain_dir";
## Get a list of user directories within each domain directory...
opendir(DOMAINHANDLE, $complete_domain_path) || die "Cannot access directory $complete_domain_path: $!";
my @user_directories = ();
foreach $dir (sort readdir(DOMAINHANDLE)) {
push(@user_directories, $dir);
}
close(DOMAINHANDLE);
## Now remove any "." or ".." directory entries and construct a domain/maildir variable
## valid for one iteration of loop.
foreach $user_directory (@user_directories) {
if( not($user_directory eq '..') && not($user_directory eq '.') ) {
$short_user_dir = "$domain_dir/$user_directory/";
## Here is where the $short_user_dir is compared against the DB entry.
$dbh = DBI->connect($connectionInfo,$db_user,$db_password);
$user_query = "SELECT maildir FROM mailbox WHERE maildir = '$short_user_dir'";
$sth = $dbh->prepare($user_query);
$rows = $sth->execute();
## If there are no rows that match, then directory is orphaned and can
## be deleted.
if($rows == 0) {
$maildir_path = "$root_path/$short_user_dir";
open(INFO, ">>$logfile") || die "Cannot write to the logfile: $logfile.";
rmtree($maildir_path);
print INFO localtime()." Maildir ".$maildir_path." has been deleted.\n";
(INFO);
}
$sth->finish;
$dbh->disconnect;
}
}
$dbh2 = DBI->connect($connectionInfo,$db_user,$db_password);
$domain_query = "SELECT domain FROM domain WHERE domain = '$domain_dir'";
$sth2 = $dbh2->prepare($domain_query);
$domain_rows = $sth2->execute();
if($domain_rows == 0) {
open(INFO, ">>$logfile") || die "Cannot write to the logfile: $logfile.";
rmtree($complete_domain_path);
print INFO localtime()." Domain directory ".$complete_domain_path." has been deleted.\n";
close(INFO);
}
$sth2->finish;
$dbh2->disconnect;
}

Binary file not shown.

View File

@ -0,0 +1,185 @@
<?php
//
// Virtual Mail Delete
// by George Vieira <george at citadelcomputer dot com dot au>
//
// You can run this from your crontab with something like
//
// 0 4 * * * * vmail php -q virtualmaildel.php >/dev/null
//
// Setup location of postfixadmin config files. Needed to login to mysql
//
$conf = '/home/httpd/mail/admin/config.inc.php';
//
// Where's the homedir accounts stored. (GET THIS RIGHT OTHERWISE IT THINK NONE EXIST AND DELETES ALL)
//
$homedir = '/home/virtual';
//
// Make sure everything is everything before continuing
//
if ( ! file_exists( $conf ) )
die( "Cannot find config file $conf\n" );
if ( ! is_dir( $homedir ) )
die( "Cannot find home directory for virtual mailboxes in $homedir\n" );
//
// Load mysql authentication from postfixadmin
//
include( $conf );
//
// Recursive Delete Function
//
function deldir($dir)
{
$current_dir = opendir($dir);
while($entryname = readdir($current_dir))
{
if(is_dir("$dir/$entryname") and ($entryname != "." and $entryname!=".."))
{
deldir("${dir}/${entryname}");
}
elseif($entryname != "." and $entryname!="..")
{
unlink("${dir}/${entryname}");
}
}
closedir($current_dir);
@rmdir(${dir});
}
// --- Main Start ---
//
// Get list of directories
//
$fr = opendir( $homedir );
while ( ($domain = readdir($fr)) !== false)
{
//
// Check if it's a dir
//
if ( $domain != "." and $domain != ".." and filetype($homedir .'/'. $domain) == "dir" )
{
//
// Open the (assumed) DOMAIN directory
//
$ff = opendir( $homedir .'/'. $domain );
while ( ($user = readdir($ff)) !== false)
{
//
// Check for directories assuming it's a user account
//
if ( $user!="." and $user!=".." and filetype($homedir .'/'. $domain .'/'. $user) == "dir" )
{
//
// if the dir 'new' exists inside then it's an account
//
if ( file_exists($homedir .'/'. $domain .'/'. $user .'/'. "new") )
{
$dir[$domain][$user] = "";
}
else
{
//
// Alert that the dir doesn't have a 'new' dir, possibly not an account. Leave it.
//
echo "UNKNOWN : " . $homedir ."/". $domain ."/". $user ."/new NOT FOUND. Possibly not an account. Leaving untouched\n";
}
}
}
}
}
//
// OK, got an array of accounts from the dir, Now connect to the DB and check them
//
$conx = mysql_connect( $CONF['database_host'],$CONF['database_user'],$CONF['database_password'] );
//
// Is there a problem connecting?
//
if ( $conx != false )
{
//
// Select the database
//
mysql_select_db( $CONF['database_name'] , $conx) or die ("Can't access database postfix : " . mysql_error());
//
// Select all mailboxes to verify against dirs listed in array
//
$query = "SELECT * FROM mailbox";
$result = mysql_query( $query );
//
// Query the mailbox table
//
if ( $result != false )
{
//
// Fetch the list of results
//
while ( $row = mysql_fetch_assoc( $result ) )
{
//
// Pull apart the maildir field, needed to figure out the directory structure to compare
//
$strip = explode("/",$row['maildir']);
//
// Unset the array if it exists. This stops it being erased later.
//
unset( $dir[ $strip[0] ][ $strip[1] ] );
}
//
// If there are results. unset the domain too.
//
if ( count($dir[$strip[0]])==0 and mysql_num_rows($result)>0 )
unset( $dir[$strip[0]] );
}
else
die( "Failed SELECT in mailboxes\n" );
}
else
die( 'Cannot connect to the database!\n' );
//
// OK, time to clean up. All known users/domains have been removed from the list.
//
//
// If the array still exists (incase nothing there)
//
if ( is_array($dir) )
{
//
// Go through each dir
//
foreach ( $dir as $key => $value )
{
//
// Is this a user array?
//
if ( is_array( $value) )
{
//
// Go through and nuke the folders
//
foreach ( $value as $user => $value2 )
{
//
// Nuke.. need any more explanations?
//
echo "REMOVING : " . $homedir."/".$key."/".$user."\n" ;
deldir( $homedir."/".$key."/".$user ) ;
}
}
}
}
//
// And we are outta here....
//
echo "Cleanup process completed\n";
?>

49
BACKUP_MX.TXT Normal file
View File

@ -0,0 +1,49 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
REQUIRED!!
----------
- You are using Postfix 2.0 or higher.
- You are using Apache 1.3.27 or higher.
- You are using PHP 4.1 or higher.
- You are using MySQL 3.23 or higher.
READ THIS FIRST!
----------------
When this is an upgrade from Postfix Admin 1.5.4 please read UPGRADE.TXT!!
When you are upgrading from 2.0.x please read TABLE_BACKUP_MX.TXT
More information is available on http://high5.net/howto/
1. Modify main.cf
-----------------
In order for Postfix to use MySQL for relay_domains add the following
to your main.cf
relay_domains = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf
2. mysql_relay_domains_maps.cf
------------------------------
You will need to put this into a text file for postfix to pickup.
user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = domain
where_field = domain
additional_conditions = and backupmx = '1'
3. Restart Postfix
-------------------
When you are done make sure to restart Postfix so the changes take effect.

240
CHANGELOG.TXT Normal file
View File

@ -0,0 +1,240 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
Version 2.1.0 -- 2005/01/07
---------------------------
- Added: Traditional Chinese language. (Thanx Bruce)
- Added: Traditional Bulgarian language. (Thanx Plamen)
- Added: Macedonian language. (Thanx Damjan)
- Added: Estonian language. (Thanx Peeter)
- Added: Slovenian language. (Thanx Nejc)
- Added: Check for update link in footer.
- Added: Additional language strings. Check LANGUAGE.TXT
- Added: Transport support. (read postfix transport for more information)
- Added: Additional language string for transport support.
- Added: MySQL 4.1 support.
- Added: PostgreSQL support. (Big Thanx WhiteFox!)
- Added: Setup Checker script. (Thanx Fenrir)
- Added: Database prefix. (Thanx Decramy)
- Added: Template tags. (Thanx Nelson)
- Added: admin/domain/alias/mailbox in delete dialog box.
- Added: $CONF['postfix_admin_url'] variable.
- Added: $CONF['postfix_admin_path'] variable.
- Added: $CONF['vacation_domain'] variable.
- Added: $CONF['welcome_text'] variable.
- Added: $CONF['special_alias_control'] variable. (Thanx Mihau)
- Added: Virtual Vacation 3.1 (Thanx David)
- Added: ADDITIONS directory with third party scripts and plugins.
- Added: Search function for aliases and mailboxes.
- Changed: Postfix Admin has now it's own license.
- Changed: New menu and color scheme. (Thanx Nelson)
- Changed: Disable number and unlimited number for aliases/mailboxes/quota.
- Changed: Virtual Vacation to have it's own transport. (Big Thanx Npaufler!)
- Changed: Removed the welcome text for a new mailbox from the language files.
- Changed: backup.php to be a more secure. (Thanx John)
- Fixed: Cleaned up stylesheet.
- Fixed: Default quota multiplier.
- Fixed: All POST/GET strings are escaped.
- Fixed: Corrected smtp_mail() to wait for result. (Thanx Patrice)
- Fixed: Pagination with alias_control switched on.
- Fixed: Swedish language. (Thanx Bjorne)
- Fixed: Polish language. (Thanx Piotr)
- Fixed: Minor Virtual Vacation bugs. (Thanx David)
- Fixed: check_quota().
- Fixed: Minor encode_header() issue. (Thanx Matthew)
- Fixed: edit-alias.php when running with magic_quotes_gpc = off
Version 2.0.5 -- 2004/08/21
---------------------------
- Added: Chinese language. (Thanx Matthew)
- Added: Catalan language. (Thanx Jaume)
- Added: Czech language. (Thanx Jakub)
- Added: Dynamic language detection.
- Added: Header in header.tpl to set charset header from language file.
- Added: More subroutines and alias checking for Vacation. (Thanx David)
- Added: Domain pass-through with certain pages.
- Added: Backup MX option for domain.
- Added: Log contains IP address of admin.
- Added: Pagination for alias/mailbox listing.
- Added: 2 additional language strings to support Backup MX.
- Added: Support for motd.txt (Domain Admins only).
- Added: Support for motd-admin.txt (Site Admins only).
- Added: Support for motd-users.txt (Users only).
- Added: Optional hostname for vacation.
- Added: generate_password() to generating random passwords for mailboxes.
- Changed: dk -> da, se -> sv, no-nn -> nn
- Changed: All email addresses are now converted to lowercase, strtolower().
- Changed: Moved onMouseOver to the CSS stylesheet.
- Changed: Moved font color to the CSS styleheet.
- Changed: PHP mail() is replaced by an internal function, smtp_mail().
- Changed: mysql_fetch_array() replaced with internal function db_array().
- Changed: mysql_fetch_assoc() replaced with internal function db_assoc().
- Changed: mysql_fetch_row() replaced with internal function db_row().
- Changed: Quota multiplier is now a configuration option.
- Fixed: Login didn't check for active flag.
- Fixed: Minor html table errors.
- Fixed: Row count by using COUNT(*).
- Fixed: Locked down subdirectories.
- Fixed: Create admin properly populates the domain_admins table.
- Fixed: Cleaned up stylesheet.css.
- Fixed: Delete mailbox properly removes vacation entries.
Version 2.0.4 -- 2004/02/26
----------------------------
- Added: Euskara language. (Thanx Julen)
- Added: Hungarian language. (Thanx Christian)
- Added: Icelandic language. (Thanx Gestur)
- Added: Italian language. (Thanx Stucchi)
- Added: Norwegian - Nynorsk language. (Thanx Paul)
- Added: Polish language. (Thanx Jarek)
- Added: Portuguese - Brazil language. (Thanx Roberto)
- Added: Rusian language. (Thanx Paul)
- Added: Turkish language (Thanx Onuryalazi)
- Added: Encode a string according to RFC 1522 for use in headers if it
contains 8-bit characters. (Thanx Evgeniy)
- Added: One click active change of mailbox/domain/admin. (Thanx Marcin)
- Changed: Header in header.tpl to read charset header from language file.
- Fixed: Some form values are now parsed through htmlspecialchars().
(Thanx Marcin)
- Fixed: admin/delete.php ignored $CONF['vacation'].
- Fixed: More minor fixes to Virtual Vacation.
Version 2.0.3 -- 2004/01/14
----------------------------
- Added: Site Admin email address.
- Added: Danish language. (Thanx Lars)
- Added: Dutch language. (Thanx Mourik)
- Added: Faroese language. (Thanx Danial)
- Added: Finnish language. (Thanx Palo)
- Added: French language. (Thanx Kuthz)
- Added: Swedish language. (Thanx Slite)
- Added: Ignoring of MAILER-DAEMON type emails for Vacation.
- Fixed: Minor issues regarding mail().
- Fixed: Minor issues regarding crypt().
- Fixed: Strip issue of email address for Vacation.
Version 2.0.2 -- 2004/01/06
----------------------------
- Added: German language. (Thanx Tobias)
- Added: Spanish language. (Thanx Alvaro)
- Fixed: The body was not included using sendmail.php.
- Fixed: Undefined variables.
- Fixed: Minor HTML cleanup.
Version 2.0.1 -- 2004/01/04
----------------------------
- Fixed: The language variable caused a problem on some systems.
Version 2.0.0 -- 2004/01/03
----------------------------
- Added: The ability for one domain admin to maintain multiple domains.
- Added: Domain to domain forwarding.
- Added: Mailboxes can now be activated or deactivated.
- Added: Configurable welcome message for new mailboxes.
- Added: Optional sending of welcome message.
- Added: Create alias "To" defaults to current domain.
- Added: Logging of admin / user actions.
- Added: Limit for aliases and/or mailboxes per domain.
- Added: Disable aliases and/or mailboxes per domain.
- Added: Max quota per mailbox per domain.
- Added: Multi-Language support.
- Added: Statistics overview for all domains.
- Added: User .forwarding for mailbox users.
- Added: Logo for Postfix Admin (Thanx Andrew).
- Added: Extra MySQL debugging capabilities.
- Added: Clear text password support.
- Added: PHP crypt() support.
- Changed: Separated logic and SQL from content.
- Changed: config.inc.php doesn't point to example.com anymore.
- Changed: Virtual Vacation no longer requires procmail.
- Changed: Complete re-write.
Version 1.5.4 -- 2003/06/16
----------------------------
- Added: Option for "Back to".
- Added: Option for Vacation module.
- Added: Table declaration for the use of Quota in the INSTALL.TXT.
This requires an additional local delivery agent.
Quotas are not supported by Postfix!
- Changed: The word "View" to "List".
Version 1.5.3 -- 2003/06/06
----------------------------
- Fixed: Even more minor bugs in regards to declaration of variables.
(Thanx Aquilante and Kyle_m)
Version 1.5.2 -- 2003/06/05
----------------------------
- Fixed: Minor bugs in regards to declaration of variables.
Version 1.5.1 -- 2003/06/04
----------------------------
- Added: Optional mailbox per domain directory structure. (Thanx Jim)
- Added: Option to completely control the stored aliases. (Thanx Alex)
- Changed: config.inc.php is renamed to config.inc.php.sample. (Thanx Alex)
- Fixed: $PHP_SELF in config.inc.php and my_lib.php. (Thanx Jim)
Version 1.5.0 -- 2003/05/28
----------------------------
- Added: Support for "Back to Main Site"
- Added: config.inc.php as the main configuration file.
- Added: Drop down box for domain selection when adding a new admin.
- Added: Resend of test email to newly created mailbox.
- Added: Mailbox and Aliases count for domainview.
- Added: Change description of domain without deleting the complete
domain.
- Added: Change name of mailbox user without deleting the mailbox.
- Added: Expire headers for unnecessary reloads. (Thanx Alex)
- Fixed: Code clean up.
- Fixed: Minor bugs and cosmetic fixes.
- Fixed: Modified check_string() to check numbers and returns false if not
matched. (Thanx btaber)
- Fixed: Correct session handling in login.php (Thanx Yen-Wei Liu)
- Fixed: Correct deletion of RFC822 email addresses. (Thanx Yen-Wei Liu)
- Removed: Completely removed the site_lib.php.
- Removed: my_lib.php from the admin directory.
- Removed: Symlink to index.php.
Version 1.4.0 -- 2003/04/07
----------------------------
- Added: When deleting a domain, all aliases and mailboxes for that domain
are also deleted from the database.
- Added: Add standard aliases for every domain that is created.
These aliases can point to the main "local" administrator.
The aliases are configured in the config.php in the admin directory.
- Changed: The layout of my_lib.php and site_lib.php have been changed.
- Changed: Modifying an alias is now done with TEXTAREA for more
flexibility.
- Fixed: Minor bugs and cosmetic fixes.
Version 1.3.8a -- 2003/03/31
----------------------------
- Fixed: After deletion of a domain it would not return to the correct page.
Version 1.3.8 -- 2003/03/25
----------------------------
- Added: Admin password change. No longer needed to delete and re-enter
the admin user for a specific domain.
Version 1.3.7 -- 2002/12/24
----------------------------
- Initial public release of Postfix Admin.

139
DATABASE_MYSQL.TXT Normal file
View File

@ -0,0 +1,139 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
# This is the complete MySQL database structure for Postfix Admin.
# If you are installing from scratch you can use this file otherwise you
# need to use the TABLE_CHANGES.TXT or TABLE_BACKUP_MX.TXT that comes with Postfix Admin.
#
# There are 2 entries for a database user in the file.
# One you can use for Postfix and one for Postfix Admin.
#
# If you run this file twice (2x) you will get an error on the user creation in MySQL.
# To go around this you can either comment the lines below "USE MySQL" until "USE postfix".
# Or you can remove the users from the database and run it again.
#
# You can create the database from the shell with:
#
# mysql -u root [-p] < DATABASE_MYSQL.TXT
#
# Postfix / MySQL
#
USE mysql;
# Postfix user & password
INSERT INTO user (Host, User, Password) VALUES ('localhost','postfix',password('postfix'));
INSERT INTO db (Host, Db, User, Select_priv) VALUES ('localhost','postfix','postfix','Y');
# Postfix Admin user & password
INSERT INTO user (Host, User, Password) VALUES ('localhost','postfixadmin',password('postfixadmin'));
INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv) VALUES ('localhost', 'postfix', 'postfixadmin', 'Y', 'Y', 'Y', 'Y');
FLUSH PRIVILEGES;
GRANT USAGE ON postfix.* TO postfix@localhost;
GRANT SELECT, INSERT, DELETE, UPDATE ON postfix.* TO postfix@localhost;
GRANT USAGE ON postfix.* TO postfixadmin@localhost;
GRANT SELECT, INSERT, DELETE, UPDATE ON postfix.* TO postfixadmin@localhost;
CREATE DATABASE postfix;
USE postfix;
#
# Table structure for table admin
#
CREATE TABLE admin (
username varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
modified datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (username),
KEY username (username)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Admins';
#
# Table structure for table alias
#
CREATE TABLE alias (
address varchar(255) NOT NULL default '',
goto text NOT NULL,
domain varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
modified datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (address),
KEY address (address)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Aliases';
#
# Table structure for table domain
#
CREATE TABLE domain (
domain varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
aliases int(10) NOT NULL default '0',
mailboxes int(10) NOT NULL default '0',
maxquota int(10) NOT NULL default '0',
transport varchar(255) default NULL,
backupmx tinyint(1) NOT NULL default '0',
created datetime NOT NULL default '0000-00-00 00:00:00',
modified datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (domain),
KEY domain (domain)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Domains';
#
# Table structure for table domain_admins
#
CREATE TABLE domain_admins (
username varchar(255) NOT NULL default '',
domain varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
KEY username (username)
) TYPE=MyISAM COMMENT='Postfix Admin - Domain Admins';
#
# Table structure for table log
#
CREATE TABLE log (
timestamp datetime NOT NULL default '0000-00-00 00:00:00',
username varchar(255) NOT NULL default '',
domain varchar(255) NOT NULL default '',
action varchar(255) NOT NULL default '',
data varchar(255) NOT NULL default '',
KEY timestamp (timestamp)
) TYPE=MyISAM COMMENT='Postfix Admin - Log';
#
# Table structure for table mailbox
#
CREATE TABLE mailbox (
username varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
maildir varchar(255) NOT NULL default '',
quota int(10) NOT NULL default '0',
domain varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
modified datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (username),
KEY username (username)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Mailboxes';
#
# Table structure for table vacation
#
CREATE TABLE vacation (
email varchar(255) NOT NULL default '',
subject varchar(255) NOT NULL default '',
body text NOT NULL,
cache text NOT NULL,
domain varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (email),
KEY email (email)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Vacation';

142
DATABASE_PGSQL.TXT Normal file
View File

@ -0,0 +1,142 @@
-- Postfix Admin Release 2.x --
----------------------------------------------------------
--
-- Copyright (c) 2002 - 2005 High5!
-- Created by: Mischa Peters <mischa at high5 dot net>
--
-- This is the complete database structure for Postfix Admin.
-- If you are installing from scratch you can use this file otherwise you
-- need to use the TABLE_CHANGES.TXT or TABLE_BACKUP_MX.TXT that comes with Postfix Admin.
--
-- There are 2 entries for a database user in the file.
-- One you can use for Postfix and one for Postfix Admin.
--
-- If you run this file twice (2x) you will get an error on the user creation in MySQL.
-- To go around this you can either comment the lines below "USE MySQL" until "USE postfix".
-- Or you can remove the users from the database and run it again.
--
-- You can create the database from the shell with:
-- creatuser -P postfix
-- creatuser -P postfixadmin
-- createdb postfix
-- psql postfix
-- postfix=# \i postfix.sql
-- postfix=# \q
-- exit
--
-- Postfix / PgSQL
--
-- DROP TABLE admin,alias,domain,domain_admins,log,mailbox,vacation;
--
--
-- Table structure for table admin
--
CREATE TABLE "admin" (
"username" character varying(255) NOT NULL default '',
"password" character varying(255) NOT NULL default '',
"created" timestamp with time zone default now(),
"modified" timestamp with time zone default now(),
"active" boolean NOT NULL default true,
Constraint "admin_key" Primary Key ("username")
);
COMMENT ON TABLE admin IS 'Postfix Admin - Virtual Admins';
--
-- Table structure for table alias
--
CREATE TABLE alias (
address character varying(255) NOT NULL default '',
goto text NOT NULL,
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
modified timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("address"),
-- KEY address ("address"),
Constraint "alias_key" Primary Key ("address")
);
COMMENT ON TABLE alias IS 'Postfix Admin - Virtual Aliases';
--
-- Table structure for table domain
--
CREATE TABLE domain (
domain character varying(255) NOT NULL default '',
description character varying(255) NOT NULL default '',
aliases integer NOT NULL default 0,
mailboxes integer NOT NULL default 0,
maxquota integer NOT NULL default 0,
transport character varying(255) default NULL,
backupmx boolean NOT NULL default false,
created timestamp with time zone default now(),
modified timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("domain"),
-- KEY domain ("domain"),
Constraint "domain_key" Primary Key ("domain")
);
COMMENT ON TABLE domain IS 'Postfix Admin - Virtual Domains';
--
-- Table structure for table domain_admins
--
CREATE TABLE domain_admins (
username character varying(255) NOT NULL default '',
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
active boolean NOT NULL default true
-- KEY username ("username")
);
COMMENT ON TABLE domain_admins IS 'Postfix Admin - Domain Admins';
--
-- Table structure for table log
--
CREATE TABLE log (
timestamp timestamp with time zone default now(),
username character varying(255) NOT NULL default '',
domain character varying(255) NOT NULL default '',
action character varying(255) NOT NULL default '',
data character varying(255) NOT NULL default ''
-- KEY timestamp ("timestamp")
);
COMMENT ON TABLE log IS 'Postfix Admin - Log';
--
-- Table structure for table mailbox
--
CREATE TABLE mailbox (
username character varying(255) NOT NULL default '',
password character varying(255) NOT NULL default '',
name character varying(255) NOT NULL default '',
maildir character varying(255) NOT NULL default '',
quota integer NOT NULL default 0,
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
modified timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("username"),
-- KEY username ("username"),
Constraint "mailbox_key" Primary Key ("username")
);
COMMENT ON TABLE mailbox IS 'Postfix Admin - Virtual Mailboxes';
--
-- Table structure for table vacation
--
CREATE TABLE vacation (
email character varying(255) NOT NULL default '',
subject character varying(255) NOT NULL default '',
body text NOT NULL,
cache text NOT NULL,
domain character varying(255) NOT NULL default '',
created timestamp with time zone default now(),
active boolean NOT NULL default true,
-- PRIMARY KEY ("email"),
-- KEY email ("email")
Constraint "vacation_key" Primary Key ("email")
);
COMMENT ON TABLE vacation IS 'Postfix Admin - Virtual Vacation';
GRANT SELECT,INSERT,UPDATE,DELETE ON admin,alias,domain,domain_admins,log,mailbox,vacation TO postfixadmin_user;

87
INSTALL.TXT Normal file
View File

@ -0,0 +1,87 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
REQUIRED!!
----------
- You are using Postfix 2.0 or higher.
- You are using Apache 1.3.27 or higher.
- You are using PHP 4.1 or higher.
- You are using MySQL 3.23 or higher.
READ THIS FIRST!
----------------
When this is an upgrade from Postfix Admin 1.5.4 please read UPGRADE.TXT!!
If you need to setup Postfix to be able to handle Virtual Domains and Virtual
Users check out http://high5.net/howto/
1. Unarchive new Postfix Admin
------------------------------
Make sure that you are in your WWW directory and then unarchive the
Postfix Admin archive (whatever the filename is):
$ tar -zxvf postfixadmin-2.0.0.tgz
2. Change permissions
----------------------
Since the database password is stored in the config.inc.php it's a good idea
to have change the permissions for Postfix Admin.
$ cd /usr/local/www/postfixadmin
$ chmod 640 *.php *.css
$ cd /usr/local/www/postfixadmin/admin/
$ chmod 640 *.php .ht*
$ cd /usr/local/www/postfixadmin/images/
$ chmod 640 *.gif *.png
$ cd /usr/local/www/postfixadmin/languages/
$ chmod 640 *.lang
$ cd /usr/local/www/postfixadmin/templates/
$ chmod 640 *.tpl
$ cd /usr/local/www/postfixadmin/users/
$ chmod 640 *.php
3. Create the Database Tables
--------------------------
In DATABASE_MYSQL.TXT you can find the table structure for MySQL that you need
in order to configure Postfix Admin and Postfix in general to work with
Virtual Domains and Users.
In DATABASE_PGSQL.TXT you can find the table structure for PostgreSQL.
4. Configure
------------
Check the config.inc.php file. There you can specify settings that are
relevant to your setup.
Postfix Admin contains 3 views of administration.
There is the Site Admin view, located at http://domain.tld/postfixadmin/admin/.
There is the Domain Admin view, located at http://domain.tld/postfixadmin/.
And there is the User Admin View, located at http://domain.tld/postfixadmin/users/.
In order to do the initial configuration you have to go to the Site Admin view.
The default password for the Site Admin view of Postfix Admin is admin/admin.
This is specified in the .htpasswd file in the /admin directory. Make sure
that the location of the .htpasswd file matches your path.
5. Done
-------
This is all that is needed. Fire up your browser and go to the site that you
specified to host Postfix Admin.
6. More information
-------------------
For more information you can go to the Postfix Admin forums.
http://forums.high5.net/index.php?showforum=22

46
LANGUAGE.TXT Normal file
View File

@ -0,0 +1,46 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
READ THIS FIRST!
----------------
*** Unlimited and disable value have been changed ***
If you are using any other language then english, please make sure that:
-1 means disable
0 means unlimited
Additional Language Strings for Postfix Admin 2.1.0
---------------------------------------------------
$PALANG['check_update'] = 'Check for update';
$PALANG['pOverview_disabled'] = 'Disabled';
$PALANG['pOverview_unlimited'] = 'Unlimited';
$PALANG['pOverview_title'] = ':: Defined Domains';
$PALANG['pOverview_up_arrow'] = 'Go Top';
$PALANG['pOverview_right_arrow'] = 'Next Page';
$PALANG['pOverview_left_arrow'] = 'Previus Page';
$PALANG['pOverview_alias_title'] = ':: Alias';
$PALANG['pOverview_mailbox_title'] = ':: Mailboxes';
$PALANG['pAdminList_domain_transport'] = 'Transport';
$PALANG['pAdminCreate_domain_transport'] = 'Transport';
$PALANG['pAdminCreate_domain_transport_text'] = 'Define transport';
$PALANG['pAdminEdit_domain_transport'] = 'Transport';
$PALANG['pAdminEdit_domain_transport_text'] = 'Define transport';
$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox';
$PALANG['pCreate_dbLog_createalias'] = 'create alias';
$PALANG['pDelete_dbLog_deletealias'] = 'delete alias';
$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox';
$PALANG['pEdit_dbLog_editactive'] = 'change active state';
$PALANG['pEdit_dbLog_editalias'] = 'edit alias';
$PALANG['pEdit_dbLog_editmailbox'] = 'edit mailbox';
$PALANG['pSearch_welcome'] = 'Searching for: ';

118
LICENSE.TXT Normal file
View File

@ -0,0 +1,118 @@
Postfix Admin User License Agreement
Version 1.0
Copyright (c) 2004 High5!
High5!
Postfix Admin Software
End User License Agreement
It is highly recommended that you read all sections of this license agreement. It
contains information on what you can and cannot do with the Software along with
how our support services operate. Many questions are answered in the body of this
document, please read it carefully.
1. PRICING
Postfix admin (the software) can be used for free unless it is used in violation with
the rules mentioned in 3.1 in the End User License Agreement. If you want to use
the software outside the limitations set by 3.1 a commercial license is required. This
license can be obtained by contacting the publisher mentioned in point 9 of this
contract.
2. LICENSE
High5! (the company) grants you a non-exclusive license to use the Software on an
unlimited installations subject to the provisions in all sections of this Agreement.
The Company, at its discretion, offers a free download of Postfix Admin available on
its web site. Use of this free download is also provided under the terms of this
Agreement with the additional notice that no technical support or service for the free
download will be provided by the Company. Use for sale or re-sale of the Software
requires purchasing the license.
3. SCOPE OF GRANT
3.1 You are allowed to:
a) customize the Software's design and operation to suit the internal needs of
your web site and/or product
b) produce and distribute the Software with additional modification. The
modifications you personally create are not owned by High5! as long as they
contain no proprietary coding from High5!
c) create applications which interface with the operation of the Software
provided said application is an original work.
3.2 You are not allowed to:
a) permit other individuals to use the Software except under the terms listed
above
b) reverse engineer, disassemble, or create derivative works based on the
Software for distribution or usage outside your web site and/or product
excluding those applications described above
c) modify and/or remove any copyright notices or labels on the Software on
each page (unless full license is purchased) and in the header of each script
source file
d) distribute the Software for sale or re-sale (unless full license purchased)
except under the terms listed above
e) distribute individual copies of files (unless full license purchased), libraries, or
other programming material in the Software package except under the terms
listed above.
4. DISCLAIMER OF WARRANTY
The Software is provided on an "AS IS" basis, without warranty of any kind, including
without limitation the warranties of merchantability, fitness for a particular purpose
and non-infringement. The entire risk as to the quality and performance of the
Software is borne by you. Should the Software prove defective, you and not High5!
assume the entire cost of any service and repair. In addition, the security
mechanisms implemented by High5! Software have inherent limitations, and you
must determine that the Software sufficiently meets your requirements. This
disclaimer of warranty constitutes an essential part of the agreement.
5. TITLE
Title, ownership rights, and intellectual property rights in the Software shall remain
with High5!. The Software is protected by copyright laws and treaties. Title and
related rights in the content generated through the Software is the property of the
applicable content owner and may be protected by applicable law. This License gives
High5! no rights to such content.
6. TERMINATION
This Agreement will terminate automatically upon failure to comply with the
limitations described herein or on written notice from an authorized representative of
High5!. On termination, you must destroy all copies of the Software within 48 hours.
Termination of the license due to noncompliance will not result in any refunds of
license fees.
7. MISCELLANEOUS
High5! reserves the right to publish a selected list of users of the Software. High5!
reserves the right to change the terms of this Agreement at any time however those
changes are not retroactive to past releases. Changes to the Agreement will be
announced via email using the High5! email notification list. Failure to receive
notification of a change does not make those changes invalid. A current copy of this
Agreement will be available upon request.
Technical support will not be provided for third-party modifications to the Software
including modifications to code, CSS, and Languages to any license holder. If the
Software is modified using a third-party modification or otherwise, technical support
may be refused to any license holder.
8. GOVERNING LAW
This Agreement shall be governed by the Laws of the Netherlands. Any action in
regard to this Agreement or arising out of its terms and conditions shall be instituted
and litigated in the court of Amsterdam. Each of the parties consents to jurisdiction
in such Court and agrees that service of process as provided by the states and rules
of civil procedures of the Netherlands shall be sufficient.
9. MANUFACTURER
High5!, Rooseveltlaan 80-2, 1078 NM, Amsterdam. For questions, write to the above
address, email info@postfixadmin.com, or call +31 6 2181 8161.
Postfix Admin End User Agreement, version 1.0 revised September 2004

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# PostfixAdmin
Postfix Admin 2.1.0, release in 2007

19
TABLE_BACKUP_MX.TXT Normal file
View File

@ -0,0 +1,19 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
# mysql -u root [-p] < TABLE_BACKUP_MX.TXT
#
# Table structure for table domain_admins
#
USE postfix;
#
# Modify table structure for table domain
#
ALTER TABLE domain ADD transport VARCHAR(255) AFTER maxquota;
ALTER TABLE domain ADD backupmx TINYINT(1) DEFAULT '0' NOT NULL AFTER transport;

104
TABLE_CHANGES.TXT Normal file
View File

@ -0,0 +1,104 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
# mysql -u root [-p] < TABLE_CHANGES.TXT
#
# Table structure for table domain_admins
#
USE postfix;
CREATE TABLE IF NOT EXISTS domain_admins (
username varchar(255) NOT NULL default '',
domain varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
KEY username (username)
) TYPE=MyISAM COMMENT='Postfix Admin - Domain Admins';
#
# Table structure for table log
#
CREATE TABLE IF NOT EXISTS log (
timestamp datetime NOT NULL default '0000-00-00 00:00:00',
username varchar(255) NOT NULL default '',
domain varchar(255) NOT NULL default '',
action varchar(255) NOT NULL default '',
data varchar(255) NOT NULL default '',
KEY timestamp (timestamp)
) TYPE=MyISAM COMMENT='Postfix Admin - Log';
#
# Table structure for table vacation
#
CREATE TABLE IF NOT EXISTS vacation (
email varchar(255) NOT NULL default '',
subject varchar(255) NOT NULL default '',
body text NOT NULL,
cache text NOT NULL,
domain varchar(255) NOT NULL default '',
created datetime NOT NULL default '0000-00-00 00:00:00',
active tinyint(1) NOT NULL default '1',
PRIMARY KEY (email),
KEY email (email)
) TYPE=MyISAM COMMENT='Postfix Admin - Virtual Vacation';
#
# Modify table structure for table admin
#
ALTER TABLE admin CHANGE create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE admin CHANGE change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE admin ADD INDEX (username);
#
# Modify table structure for table alias
#
ALTER TABLE alias CHANGE create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE alias CHANGE change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE alias ADD INDEX (address);
#
# Modify table structure for table domain
#
ALTER TABLE domain CHANGE create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE domain CHANGE change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE domain ADD aliases INT(10) DEFAULT '-1' NOT NULL AFTER description;
ALTER TABLE domain ADD mailboxes INT(10) DEFAULT '-1' NOT NULL AFTER aliases;
ALTER TABLE domain ADD maxquota INT(10) DEFAULT '-1' NOT NULL AFTER mailboxes;
ALTER TABLE domain ADD transport VARCHAR(255) AFTER maxquota;
ALTER TABLE domain ADD backupmx TINYINT(1) DEFAULT '0' NOT NULL AFTER transport;
ALTER TABLE domain ADD INDEX (domain);
#
# Modify table structure for table mailbox
#
ALTER TABLE mailbox CHANGE create_date created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE mailbox CHANGE change_date modified DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL;
ALTER TABLE mailbox ADD quota INT(10) DEFAULT '-1' NOT NULL AFTER maildir;
ALTER TABLE mailbox ADD INDEX (username);
#
# Modify table structure for table vacation
#
ALTER TABLE vacation ADD domain VARCHAR(255) DEFAULT '' NOT NULL AFTER cache;
ALTER TABLE vacation ADD created DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL AFTER domain;
ALTER TABLE vacation ADD active TINYINT(1) DEFAULT '1' NOT NULL AFTER created;
ALTER TABLE vacation DROP PRIMARY KEY, ADD PRIMARY KEY(email);
#
# Dumping data for table domain_admins
#
INSERT INTO domain_admins (username,domain,created) SELECT admin.username,admin.domain,domain.created FROM admin LEFT JOIN domain ON domain.domain=admin.domain;
#
# Modify data for table vacation
#
UPDATE vacation SET domain=SUBSTRING_INDEX(email, '@', -1) WHERE email=email;
#
# Modify table structure for table domain
#
ALTER TABLE admin DROP domain;

79
UPGRADE.TXT Normal file
View File

@ -0,0 +1,79 @@
#
# Postfix Admin
# by Mischa Peters <mischa at high5 dot net>
# Copyright (c) 2002 - 2005 High5!
# License Info: http://www.postfixadmin.com/?file=LICENSE.TXT
#
REQUIRED!!
----------
- You are using Postfix 2.0 or higher.
- You are using Apache 1.3.27 or higher.
- You are using PHP 4.1 or higher.
- You are using MySQL 3.23 or higher.
READ THIS FIRST!
----------------
It's recommened that you install Postfix Admin in a new folder and not
on-top of the old install!!
When you are upgrading from Postfix Admin 1.5x (or older), make sure you
backup your database before you run the TABLE_CHANGES.TXT on your database.
When you are upgrading from Postfix Admin 2.0.x, please read the BACKUP_MX.TXT.
1. Backup the Database
----------------------
When you install from a previous version make sure you backup your database