Commit Diff


commit - 15cae2e64a6330a9f08efbbc6876c687dd26bdcc
commit + ff9078330db238169d76b0805e77e3e348377867
blob - c42e60093ad87a269b4d5b9bb25488d03be41435
blob + 21c279fc52c090fd5b0bedbdfe31d05ac6a2787c
--- README.md
+++ README.md
@@ -2,3 +2,75 @@
 
 Fork of Postfix Admin 2.1.0 (released in 2007)
 
+Database needed to use SQL with OpenSMTPD
+
+	CREATE DATABASE IF NOT EXISTS `opensmtpd` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+	USE `opensmtpd`;
+
+	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
+	) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='OpenSMTPD Admin - Virtual Admins';
+
+	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
+	) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='OpenSMTPD Admin - Virtual Aliases';
+
+	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
+	) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='OpenSMTPD Admin - Virtual Domains';
+
+	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
+	) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='OpenSMTPD Admin - Domain Admins';
+
+	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 ''
+	) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='OpenSMTPD Admin - Log';
+
+
+
+Config for OpenSMTPTD, MySQL/MariaDB example:
+
+	# /etc/mail/smtpd.conf
+	table credentials mysql:/etc/mail/sql.conf
+	table domains mysql:/etc/mail/sql.conf
+	table userinfo mysql:/etc/mail/sql.conf
+	table virtuals mysql:/etc/mail/sql.conf
+
+Connecting the database to smtpd:
+
+	# /etc/mail/sql.conf
+	host            localhost
+	username        opensmtpd
+	password        RandomString 
+	database        opensmtpd
+
+	query_alias             SELECT goto FROM alias WHERE address=?;
+	query_credentials       SELECT username, password FROM mailbox WHERE username=? AND active='1';
+	query_domain            SELECT domain FROM domain WHERE domain=? AND active='1';
+	query_userinfo          SELECT 501, 501, maildir FROM mailbox WHERE username=? AND active='1';
blob - e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
blob + 77707d8bf17f085f7dc2d5d7b9c9ca35ec2dc63d
--- VIRTUAL_VACATION/README.md
+++ VIRTUAL_VACATION/README.md
@@ -0,0 +1,20 @@
+## Virtual Vacation
+
+Virtual Vacation is a Perl script to be used in combination with OpenSMTPD Admin.
+It provides OOO, Auto Response, Vacation capabilities to virtual users.
+
+To invoke vacation.pl add the following to your /etc/mail/smtpd.conf
+
+	filter filter-from proc-exec "vacation.pl"
+
+When vacation.pl is located in: /usr/local/libexec/smtpd
+
+It requires the following libraries to be installed for MariaDB:
+
+pkg_add p5-DBI p5-DBD-MariaDB 
+
+You can run vacation.pl with the following flags:
+
+- -l = logging of virtual vacation parsed report/filter streams and decisions
+- -v = verbose (extra flag) logging of report stream
+- -d = debug (extra flag) logging of filter stream
blob - b60c4942d1fec3a7769246c8b40a977373764efa
blob + 103eed2a90dd3759700125e7fb483d67f97d1312
--- index.php
+++ index.php
@@ -17,27 +17,11 @@
 //
 // -none-
 //
-if (!file_exists(realpath("./setup.php"))) {
+if (file_exists(realpath("./config.inc.php"))) {
 	header ("Location: login.php");
 	exit;
 } else {
-	print <<< EOF
-<html>
-<head>
-<title>Welcome to OpenSMTPD Admin</title>
-</head>
-<body>
-<img id="login_header_logo" src="images/postbox.png" />
-<img id="login_header_logo" src="images/opensmtpdadmin.png" />
-<h1>Welcome to OpenSMTPD Admin</h1>
-It seems that you are running this version of OpenSMTPD Admin for the first time.<br />
-<p />
-You can now run <a href="setup.php">setup</a> to make sure that all the functions are available for OpenSMTPD Admin to run.<br />
-<p />
-If you still encounter any problems please check the documentation and website for more information.
-<p />
-</body>
-</html>
-EOF;
+	header ("Location: setup.php");
+	exit;
 }
 ?>
blob - 81eae7fd60e51870e917af89de4587d81e73cdf0
blob + 98b3a8c92728621f6b483c225a2cab62bc0beb40
--- setup.php
+++ setup.php
@@ -25,7 +25,14 @@
 <body>
 <img id="login_header_logo" src="images/postbox.png" />
 <img id="login_header_logo" height="30px" src="images/opensmtpdadmin.png" />
+<h1>Welcome to OpenSMTPD Admin</h1>
 <h2>OpenSMTPD Admin Setup Checker 1.0</h2>
+It seems that you are running this version of OpenSMTPD Admin for the first time.<br />
+<p />  
+This will tell you if all functions are available for OpenSMTPD Admin to run.<br />
+<p />
+If you still encounter any problems please check the documentation and website for more information.<br />
+<p />
 Running software:<br />
 <p />
 <?php