diff options
author | Sergei Fedosoff <eleksir@gmail.com> | 2018-05-25 22:14:25 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-05-25 22:14:41 +0700 |
commit | 0499dcf219f636ad9f81cf8ba79f2b2584f77693 (patch) | |
tree | ef1109ae5e59a940cbad46e10019a59fbd3ea7b9 | |
parent | c17f1628cc9894fdd554dfbd46888f05f3c76c5e (diff) | |
download | slackbuilds-0499dcf219f636ad9f81cf8ba79f2b2584f77693.tar.gz |
network/dbmail: Added (IMAP and POP3 Server).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/dbmail/README | 19 | ||||
-rw-r--r-- | network/dbmail/create_tables.mysql | 467 | ||||
-rw-r--r-- | network/dbmail/dbmail.SlackBuild | 120 | ||||
-rw-r--r-- | network/dbmail/dbmail.conf | 425 | ||||
-rw-r--r-- | network/dbmail/dbmail.cron | 7 | ||||
-rw-r--r-- | network/dbmail/dbmail.info | 10 | ||||
-rw-r--r-- | network/dbmail/dbmail.logrotate | 9 | ||||
-rw-r--r-- | network/dbmail/doinst.sh | 29 | ||||
-rw-r--r-- | network/dbmail/rc.dbmail-httpd.new | 54 | ||||
-rw-r--r-- | network/dbmail/rc.dbmail-imapd.new | 54 | ||||
-rw-r--r-- | network/dbmail/rc.dbmail-lmtpd.new | 54 | ||||
-rw-r--r-- | network/dbmail/rc.dbmail-pop3d.new | 54 | ||||
-rw-r--r-- | network/dbmail/slack-desc | 19 |
13 files changed, 1321 insertions, 0 deletions
diff --git a/network/dbmail/README b/network/dbmail/README new file mode 100644 index 0000000000..0f29a1fa1f --- /dev/null +++ b/network/dbmail/README @@ -0,0 +1,19 @@ +DBMail - Fast and scalable sql based email services. It's distributed under +terms of GNU GPLv2. + +This DBMail build assume to work with MySQL/MariaDB or SQLite, as storage +backends, because both of them are included in Slackware. Authentication +backend can be either SQL or LDAP. On frontend side IMAP4, POP3, SIEVE +protocols are supported. MTA communication can be performed via LMTP or +local client - dbmail-deliver. There is an http API daemon to perform +server administration. Admin tasks can also be performed via cli tools. + +For MySQL/MariaDB backend you should create database, user with password and +grant this user all privilegies on created database. Then you should create +tables via command +'mysql DATABASE -u user -p password < /usr/doc/dbmail-*/create_tables.mysql'. +This user, password and database must be mentioned in /etc/dbmail/dbmail.conf +in apropriate places. + +More information about setup DBMail in different configuration environments +you can get at http://www.dbmail.org/dokuwiki/doku.php. diff --git a/network/dbmail/create_tables.mysql b/network/dbmail/create_tables.mysql new file mode 100644 index 0000000000..de035154eb --- /dev/null +++ b/network/dbmail/create_tables.mysql @@ -0,0 +1,467 @@ +-- dbmail mysql schema +-- +-- Copyright (c) 2006 Aaron Stone, aaron@serendipity.cx +-- Copyright (c) 2004-2014, NFG Net Facilities Group BV, support@nfg.nl +-- +-- This program is free software; you can redistribute it and/or +-- modify it under the terms of the GNU General Public License +-- as published by the Free Software Foundation; either +-- version 2 of the License, or (at your option) any later +-- version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +-- + + +-- Make sure our database is set for utf8 +ALTER DATABASE CHARACTER SET utf8; + +SET FOREIGN_KEY_CHECKS=0; +-- +-- Table structure for table `dbmail_acl` +-- + +DROP TABLE IF EXISTS `dbmail_authlog`; +CREATE TABLE `dbmail_authlog` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `userid` varchar(100) default NULL, + `service` varchar(32) default NULL, + `login_time` datetime default NULL, + `logout_time` datetime default NULL, + `src_ip` varchar(16) default NULL, + `src_port` int(11) default NULL, + `dst_ip` varchar(16) default NULL, + `dst_port` int(11) default NULL, + `status` varchar(32) default 'active', + `bytes_rx` bigint(20) NOT NULL default '0', + `bytes_tx` bigint(20) NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +-- +-- Table structure for table `dbmail_acl` +-- + +DROP TABLE IF EXISTS `dbmail_acl`; +CREATE TABLE `dbmail_acl` ( + `user_id` bigint(20) UNSIGNED NOT NULL default '0', + `mailbox_id` bigint(20) UNSIGNED NOT NULL default '0', + `lookup_flag` tinyint(1) NOT NULL default '0', + `read_flag` tinyint(1) NOT NULL default '0', + `seen_flag` tinyint(1) NOT NULL default '0', + `write_flag` tinyint(1) NOT NULL default '0', + `insert_flag` tinyint(1) NOT NULL default '0', + `post_flag` tinyint(1) NOT NULL default '0', + `create_flag` tinyint(1) NOT NULL default '0', + `delete_flag` tinyint(1) NOT NULL default '0', + `deleted_flag` tinyint(1) NOT NULL default '0', + `expunge_flag` tinyint(1) NOT NULL default '0', + `administer_flag` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`user_id`,`mailbox_id`), + KEY `user_id_index` (`user_id`), + KEY `mailbox_id_index` (`mailbox_id`), + CONSTRAINT `dbmail_acl_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `dbmail_users` (`user_idnr`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dbmail_acl_ibfk_2` FOREIGN KEY (`mailbox_id`) REFERENCES `dbmail_mailboxes` (`mailbox_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_aliases` +-- + +DROP TABLE IF EXISTS `dbmail_aliases`; +CREATE TABLE `dbmail_aliases` ( + `alias_idnr` bigint(20) UNSIGNED NOT NULL auto_increment, + `alias` varchar(255) NOT NULL default '', + `deliver_to` varchar(255) NOT NULL default '', + `client_idnr` bigint(20) UNSIGNED NOT NULL default '0', + PRIMARY KEY (`alias_idnr`), + KEY `alias_index` (`alias`), + KEY `client_idnr_index` (`client_idnr`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_envelope` +-- + +DROP TABLE IF EXISTS `dbmail_envelope`; +CREATE TABLE `dbmail_envelope` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `physmessage_id` bigint(20) UNSIGNED NOT NULL default '0', + `envelope` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `physmessage_id_1` (`physmessage_id`), + UNIQUE KEY `physmessage_id_2` (`physmessage_id`,`id`), + CONSTRAINT `dbmail_envelope_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_filters` +-- + +DROP TABLE IF EXISTS `dbmail_filters`; +CREATE TABLE `dbmail_filters` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `user_id` bigint(20) UNSIGNED NOT NULL, + `headername` varchar(255) NOT NULL, + `headervalue` varchar(255) NOT NULL, + `mailbox` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`), + CONSTRAINT `dbmail_filters_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `dbmail_users` (`user_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_header` +-- + +DROP TABLE IF EXISTS `dbmail_header`; +CREATE TABLE `dbmail_header` ( + `physmessage_id` bigint(20) UNSIGNED NOT NULL, + `headername_id` bigint(20) UNSIGNED NOT NULL, + `headervalue_id` bigint(20) UNSIGNED NOT NULL, + PRIMARY KEY (`physmessage_id`,`headername_id`,`headervalue_id`), + KEY `physmessage_id` (`physmessage_id`), + KEY `headername_id` (`headername_id`), + KEY `headervalue_id` (`headervalue_id`), + KEY `physmessage_id_headername_id` (`physmessage_id`,`headername_id`), + KEY `physmessage_id_headervalue_id` (`physmessage_id`,`headervalue_id`), + KEY `headername_id_headervalue_id` (`headername_id`,`headervalue_id`), + CONSTRAINT `dbmail_header_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dbmail_header_ibfk_2` FOREIGN KEY (`headername_id`) REFERENCES `dbmail_headername` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dbmail_header_ibfk_3` FOREIGN KEY (`headervalue_id`) REFERENCES `dbmail_headervalue` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_headername` +-- + +DROP TABLE IF EXISTS `dbmail_headername`; +CREATE TABLE `dbmail_headername` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `headername` varchar(255) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `headername` (`headername`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_headervalue` +-- + +DROP TABLE IF EXISTS `dbmail_headervalue`; +CREATE TABLE `dbmail_headervalue` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `hash` varchar(255) NOT NULL, + `headervalue` text NOT NULL, + `sortfield` varchar(255) default NULL, + `datefield` datetime default NULL, + PRIMARY KEY (`id`), + KEY `hash` (`hash`), + KEY `headervalue` (`headervalue`(255)), + KEY `sortfield` (`sortfield`), + KEY `datefield` (`datefield`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +-- +-- Table structure for table `dbmail_keywords` +-- + +DROP TABLE IF EXISTS `dbmail_keywords`; +CREATE TABLE `dbmail_keywords` ( + `message_idnr` bigint(20) UNSIGNED NOT NULL default '0', + `keyword` varchar(255) NOT NULL, + PRIMARY KEY (`message_idnr`,`keyword`), + CONSTRAINT `dbmail_keywords_ibfk_1` FOREIGN KEY (`message_idnr`) REFERENCES `dbmail_messages` (`message_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_mailboxes` +-- + +DROP TABLE IF EXISTS `dbmail_mailboxes`; +CREATE TABLE `dbmail_mailboxes` ( + `mailbox_idnr` bigint(20) UNSIGNED NOT NULL auto_increment, + `owner_idnr` bigint(20) UNSIGNED NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `seen_flag` tinyint(1) NOT NULL default '0', + `answered_flag` tinyint(1) NOT NULL default '0', + `deleted_flag` tinyint(1) NOT NULL default '0', + `flagged_flag` tinyint(1) NOT NULL default '0', + `recent_flag` tinyint(1) NOT NULL default '0', + `draft_flag` tinyint(1) NOT NULL default '0', + `no_inferiors` tinyint(1) NOT NULL default '0', + `no_select` tinyint(1) NOT NULL default '0', + `permission` tinyint(1) default '2', + `seq` bigint(20) NOT NULL default '0', + PRIMARY KEY (`mailbox_idnr`), + UNIQUE KEY `owner_idnr_name_index` (`owner_idnr`,`name`), + KEY `name_index` (`name`), + KEY `owner_idnr_index` (`owner_idnr`), + KEY `seq_index` (`seq`), + CONSTRAINT `dbmail_mailboxes_ibfk_1` FOREIGN KEY (`owner_idnr`) REFERENCES `dbmail_users` (`user_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_messages` +-- + +DROP TABLE IF EXISTS `dbmail_messages`; +CREATE TABLE `dbmail_messages` ( + `message_idnr` bigint(20) UNSIGNED NOT NULL auto_increment, + `mailbox_idnr` bigint(20) UNSIGNED NOT NULL default '0', + `physmessage_id` bigint(20) UNSIGNED NOT NULL default '0', + `seen_flag` tinyint(1) NOT NULL default '0', + `answered_flag` tinyint(1) NOT NULL default '0', + `deleted_flag` tinyint(1) NOT NULL default '0', + `flagged_flag` tinyint(1) NOT NULL default '0', + `recent_flag` tinyint(1) NOT NULL default '0', + `draft_flag` tinyint(1) NOT NULL default '0', + `unique_id` varchar(70) NOT NULL default '', + `status` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`message_idnr`), + KEY `physmessage_id_index` (`physmessage_id`), + KEY `mailbox_idnr_index` (`mailbox_idnr`), + KEY `seen_flag_index` (`seen_flag`), + KEY `unique_id_index` (`unique_id`), + KEY `status_index` (`status`), + KEY `mailbox_status` (`mailbox_idnr`,`status`), + CONSTRAINT `dbmail_messages_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dbmail_messages_ibfk_2` FOREIGN KEY (`mailbox_idnr`) REFERENCES `dbmail_mailboxes` (`mailbox_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_mimeparts` +-- + +DROP TABLE IF EXISTS `dbmail_mimeparts`; +CREATE TABLE `dbmail_mimeparts` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `hash` char(128) NOT NULL, + `data` longblob NOT NULL, + `size` bigint(20) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `hash` (`hash`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_partlists` +-- + +DROP TABLE IF EXISTS `dbmail_partlists`; +CREATE TABLE `dbmail_partlists` ( + `physmessage_id` bigint(20) UNSIGNED NOT NULL default '0', + `is_header` tinyint(1) NOT NULL default '0', + `part_key` smallint(6) NOT NULL default '0', + `part_depth` smallint(6) NOT NULL default '0', + `part_order` smallint(6) NOT NULL default '0', + `part_id` bigint(20) UNSIGNED NOT NULL default '0', + KEY `physmessage_id` (`physmessage_id`), + KEY `part_id` (`part_id`), + UNIQUE KEY `message_parts` (`physmessage_id`,`part_key`,`part_depth`,`part_order`), + CONSTRAINT `dbmail_partlists_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dbmail_partlists_ibfk_2` FOREIGN KEY (`part_id`) REFERENCES `dbmail_mimeparts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_pbsp` +-- + +DROP TABLE IF EXISTS `dbmail_pbsp`; +CREATE TABLE `dbmail_pbsp` ( + `idnr` bigint(20) UNSIGNED NOT NULL auto_increment, + `since` datetime NOT NULL default '0000-00-00 00:00:00', + `ipnumber` varchar(40) NOT NULL, + PRIMARY KEY (`idnr`), + UNIQUE KEY `ipnumber_index` (`ipnumber`), + KEY `since_index` (`since`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_physmessage` +-- + +DROP TABLE IF EXISTS `dbmail_physmessage`; +CREATE TABLE `dbmail_physmessage` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `messagesize` bigint(20) UNSIGNED NOT NULL default '0', + `rfcsize` bigint(20) UNSIGNED NOT NULL default '0', + `internal_date` datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_referencesfield` +-- + +DROP TABLE IF EXISTS `dbmail_referencesfield`; +CREATE TABLE `dbmail_referencesfield` ( + `id` bigint(20) UNSIGNED NOT NULL auto_increment, + `physmessage_id` bigint(20) UNSIGNED NOT NULL default '0', + `referencesfield` varchar(255) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `physmessage_id` (`physmessage_id`,`referencesfield`), + CONSTRAINT `dbmail_referencesfield_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES `dbmail_physmessage` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_replycache` +-- + +DROP TABLE IF EXISTS `dbmail_replycache`; +CREATE TABLE `dbmail_replycache` ( + `to_addr` varchar(255) NOT NULL default '', + `from_addr` varchar(255) NOT NULL default '', + `handle` varchar(255) NOT NULL default '', + `lastseen` datetime NOT NULL default '0000-00-00 00:00:00', + UNIQUE KEY `replycache_1` (`to_addr`,`from_addr`,`handle`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_sievescripts` +-- + +DROP TABLE IF EXISTS `dbmail_sievescripts`; +CREATE TABLE `dbmail_sievescripts` ( + `owner_idnr` bigint(20) UNSIGNED NOT NULL default '0', + `name` varchar(255) NOT NULL, + `script` text, + `active` tinyint(1) NOT NULL default '0', + UNIQUE KEY `owner_idnr_2` (`owner_idnr`,`name`), + KEY `name` (`name`), + KEY `owner_idnr` (`owner_idnr`), + CONSTRAINT `dbmail_sievescripts_ibfk_1` FOREIGN KEY (`owner_idnr`) REFERENCES `dbmail_users` (`user_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_subscription` +-- + +DROP TABLE IF EXISTS `dbmail_subscription`; +CREATE TABLE `dbmail_subscription` ( + `user_id` bigint(20) UNSIGNED NOT NULL default '0', + `mailbox_id` bigint(20) UNSIGNED NOT NULL default '0', + PRIMARY KEY (`user_id`,`mailbox_id`), + KEY `user_id_index` (`user_id`), + KEY `mailbox_id_index` (`mailbox_id`), + CONSTRAINT `dbmail_subscription_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `dbmail_users` (`user_idnr`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `dbmail_subscription_ibfk_2` FOREIGN KEY (`mailbox_id`) REFERENCES `dbmail_mailboxes` (`mailbox_idnr`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_usermap` +-- + +DROP TABLE IF EXISTS `dbmail_usermap`; +CREATE TABLE `dbmail_usermap` ( + `login` varchar(255) NOT NULL, + `sock_allow` varchar(255) NOT NULL, + `sock_deny` varchar(255) NOT NULL, + `userid` varchar(255) NOT NULL, + UNIQUE KEY `usermap_idx_1` (`login`,`sock_allow`,`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `dbmail_users` +-- + +DROP TABLE IF EXISTS `dbmail_users`; +CREATE TABLE `dbmail_users` ( + `user_idnr` bigint(20) UNSIGNED NOT NULL auto_increment, + `userid` varchar(255) NOT NULL default '', + `passwd` varchar(255) NOT NULL default '', + `client_idnr` bigint(20) UNSIGNED NOT NULL default '0', + `maxmail_size` bigint(20) NOT NULL default '0', + `curmail_size` bigint(20) NOT NULL default '0', + `maxsieve_size` bigint(20) NOT NULL default '0', + `cursieve_size` bigint(20) NOT NULL default '0', + `encryption_type` varchar(255) NOT NULL default '', + `last_login` datetime NOT NULL default '1979-11-03 22:05:58', + PRIMARY KEY (`user_idnr`), + UNIQUE KEY `userid_index` (`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS dbmail_auto_notifications; +CREATE TABLE dbmail_auto_notifications ( + user_idnr bigint(20) UNSIGNED NOT NULL, + notify_address varchar(100) NOT NULL default '', + INDEX user_idnr_index (user_idnr), + FOREIGN KEY user_idnr_fk (user_idnr) + REFERENCES dbmail_users (user_idnr) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB DEFAULT CHARSET=utf8; + +DROP TABLE IF EXISTS dbmail_auto_replies; +CREATE TABLE dbmail_auto_replies ( + user_idnr bigint(20) UNSIGNED DEFAULT '0' NOT NULL, + start_date DATETIME NOT NULL, + stop_date DATETIME NOT NULL, + reply_body MEDIUMTEXT, + INDEX user_idnr_index (user_idnr), + FOREIGN KEY user_idnr_fk2 (user_idnr) + REFERENCES dbmail_users (user_idnr) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE InnoDB DEFAULT CHARSET=utf8; + +-- +-- views for IMAP sort +-- + +DROP VIEW IF EXISTS dbmail_fromfield; +CREATE VIEW dbmail_fromfield AS + SELECT physmessage_id,sortfield AS fromfield + FROM dbmail_messages m + JOIN dbmail_header h USING (physmessage_id) + JOIN dbmail_headername n ON h.headername_id = n.id + JOIN dbmail_headervalue v ON h.headervalue_id = v.id +WHERE n.headername='from'; + +DROP VIEW IF EXISTS dbmail_ccfield; +CREATE VIEW dbmail_ccfield AS + SELECT physmessage_id,sortfield AS ccfield + FROM dbmail_messages m + JOIN dbmail_header h USING (physmessage_id) + JOIN dbmail_headername n ON h.headername_id = n.id + JOIN dbmail_headervalue v ON h.headervalue_id = v.id +WHERE n.headername='cc'; + +DROP VIEW IF EXISTS dbmail_tofield; +CREATE VIEW dbmail_tofield AS + SELECT physmessage_id,sortfield AS tofield + FROM dbmail_messages m + JOIN dbmail_header h USING (physmessage_id) + JOIN dbmail_headername n ON h.headername_id = n.id + JOIN dbmail_headervalue v ON h.headervalue_id = v.id +WHERE n.headername='to'; + +DROP VIEW IF EXISTS dbmail_subjectfield; +CREATE VIEW dbmail_subjectfield AS + SELECT physmessage_id,headervalue AS subjectfield + FROM dbmail_messages m + JOIN dbmail_header h USING (physmessage_id) + JOIN dbmail_headername n ON h.headername_id = n.id + JOIN dbmail_headervalue v ON h.headervalue_id = v.id +WHERE n.headername='subject'; + +DROP VIEW IF EXISTS dbmail_datefield; +CREATE VIEW dbmail_datefield AS + SELECT physmessage_id,datefield,sortfield + FROM dbmail_messages m + JOIN dbmail_header h USING (physmessage_id) + JOIN dbmail_headername n ON h.headername_id = n.id + JOIN dbmail_headervalue v ON h.headervalue_id = v.id +WHERE n.headername='date'; + + + +-- Create the required built-in users for the delivery chain, anyone acls, and #public mailboxes +INSERT INTO dbmail_users (userid, passwd, encryption_type) VALUES + ('__@!internal_delivery_user!@__', '', 'md5'), + ('anyone', '', 'md5'), + ('__public__', '', 'md5'); + diff --git a/network/dbmail/dbmail.SlackBuild b/network/dbmail/dbmail.SlackBuild new file mode 100644 index 0000000000..69070809cb --- /dev/null +++ b/network/dbmail/dbmail.SlackBuild @@ -0,0 +1,120 @@ +#!/bin/sh + +# Slackware build script for dbmail + +# Copyright 2018 Sergei Fedosoff eleksir@gmail.com +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=dbmail +VERSION=${VERSION:-3.2.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc/dbmail \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --enable-shared \ + --enable-manpages \ + --with-logdir \ + --build=$ARCH-slackware-linux + +make + +make install DESTDIR=$PKG + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/etc/dbmail +cat $CWD/dbmail.conf > $PKG/etc/dbmail/dbmail.conf.new + +mkdir -p $PKG/etc/cron.daily +install --mode=0755 $CWD/dbmail.cron $PKG/etc/cron.daily/dbmail.new + +mkdir -p $PKG/etc/logrotate.d +cat $CWD/dbmail.logrotate > $PKG/etc/logrotate.d/dbmail.new + +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.dbmail-httpd.new > $PKG/etc/rc.d/rc.dbmail-httpd.new +cat $CWD/rc.dbmail-imapd.new > $PKG/etc/rc.d/rc.dbmail-imapd.new +cat $CWD/rc.dbmail-lmtpd.new > $PKG/etc/rc.d/rc.dbmail-lmtpd.new +cat $CWD/rc.dbmail-pop3d.new > $PKG/etc/rc.d/rc.dbmail-pop3d.new + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS BUGS COPYING INSTALL README.md THANKS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/create_tables.mysql > $PKG/usr/doc/$PRGNAM-$VERSION/create_tables.mysql + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/dbmail/dbmail.conf b/network/dbmail/dbmail.conf new file mode 100644 index 0000000000..5e46f46b66 --- /dev/null +++ b/network/dbmail/dbmail.conf @@ -0,0 +1,425 @@ +# (c) 2000-2006 IC&S, The Netherlands +# +# Configuration file for DBMAIL + +[DBMAIL] +# +# Database settings +# +# database connection URI +#dburi = sqldriver://username:password@hostname:port/db_name +#dburi = sqlite:///var/tmp/dbmail.db +#dburi = mysql://dbmail:dbmail@localhost:3306/dbmail +dburi = mysql://dbmail:dbmail@localhost/dbmail?unix-socket=/var/run/mysql/mysql.sock&charset=utf8 + +# +# following fields are now DEPRECATED! +#driver = mysql +#host = localhost +#sqlport = 3306 +#sqlsocket = /var/run/mysql/mysql.sock +#user = dbmail +#pass = dbmail +#db = dbmail +#encoding = utf8 + +# +# Number of database connections per threaded daemon +# This also determines the size of the worker threadpool +# +# Do NOT increase this without proper consideration. A +# very large database/worker pool will not only increase +# the connection pressure on the database, but will more +# significantly cause unnecessary context-switching in +# your CPUs. +# +max_db_connections = 4 + +# +# Table prefix. Defaults to "dbmail_" if not specified. +# +table_prefix = dbmail_ + +# +# Supported drivers are sql, ldap. +# +authdriver = sql + +# +# messages with unknown encoding will be assumed to have +# default_msg_encoding +# i.e. iso8859-1, utf8 +default_msg_encoding = utf8 + +# +# Postmaster's email address for use in bounce messages. +# +postmaster = MAILER-DAEMON + +# +# Sendmail executable for forwards, replies, notifies, vacations. +# You may use pipes (|) in this command, for example: +# dos2unix|/usr/sbin/sendmail works well with Qmail. +# You may use quotes (") for executables with unusual names. +# +sendmail = /usr/sbin/sendmail + +# +# +# The following items can be overridden in the service-specific sections. +# +# + +# +# Logging via stderr/log file and syslog +# +# Logging is broken up into 8 logging levels and each level can be indivually turned on or off. +# The Stderr/log file logs all entries to stderr or the log file. +# Syslog logging uses the facility mail and the logging level of the event for logging. +# Syslog can then be configured to log data according to the levels. +# +# Set the log level to the sum of the values next to the levels you want to record. +# 1 = Emergency +# 2 = Alert +# 4 = Critical +# 8 = Error +# 16 = Warning +# 32 = Notice +# 64 = Info +# 128 = Debug +# 256 = Database -> Logs at debug level +# +# Examples: 0 = Nothing +# 31 = Emergency + Alert + Critical + Error + Warning +# 511 = Everything +# +file_logging_levels = 1 +# +syslog_logging_levels = 30 + +# +# Generate a log entry for database queries for the log level at number of seconds of query execution time. +# +query_time_info = 10 +query_time_notice = 20 +query_time_warning = 30 + +# +# Throw an exception is the query takes longer than query_timeout seconds +query_timeout = 300 + +# +# Root privs are used to open a port, then privs +# are dropped down to the user/group specified here. +# +effective_user = mail +effective_group = mail + +# +# The IPv4 and/or IPv6 addresses the services will bind to. +# Use * for all local interfaces. +# Use 127.0.0.1 for localhost only. +# Separate multiple entries with spaces ( ) or commas (,). +# +bindip = 0.0.0.0 # IPv4 only - all IP's +#bindip = :: # IPv4 and IPv6 - all IP's (linux) +#bindip = :: # IPv6 only - all IP's (BSD) +#bindip = 0.0.0.0,:: # IPv4 and IPv6 - all IP's (BSD) + + +# +# The maximum length of the queue of pending connections. See +# listen(2) for more information +# +backlog = 128 + +# +# Idle time allowed before a connection is shut off. +# +timeout = 300 + +# +# Idle time allowed before a connection is shut off if you have not logged in yet. +# +login_timeout = 60 + +# +# If yes, resolves IP addresses to DNS names when logging. +# +resolve_ip = no + +# +# If yes, keep statistics in the authlog table for connecting users +# +authlog = no + +# +# logfile for stdout messages +# +logfile = /var/log/dbmail.log + +# +# logfile for stderr messages +# +errorlog = /var/log/dbmail.err + +# +# directory for storing PID files +# +pid_directory = /var/run/dbmail + +# +# directory for locating libraries (normally has a sane default compiled-in) +# +#library_directory = /usr/lib/dbmail + +# +# SSL/TLS certificates +# +# A file containing a list of CAs in PEM format +tls_cafile = + +# A file containing a PEM format certificate +tls_cert = + +# A file containing a PEM format RSA or DSA key +tls_key = + +# A cipher list string in the format given in ciphers(1) +tls_ciphers = + + +# hashing algorithm. You can select your favorite hash type +# for generating unique ids for message parts. +# +# for valid values check mhash(3) but minus the MHASH_ prefix. +# +# if you ever change this value run 'dbmail-util --rehash' to +# update the hash for all mimeparts. +# +# examples: MD5, SHA1, SHA256, SHA512, TIGER, WHIRLPOOL +# +hash_algorithm = SHA256 + + +# header_cache tuning +# +# set header_cache_readonly to 'yes' to prevent new +# unknown header-names from being cached. +# +# header_cache_readonly = yes + + + +[LMTP] +port = 24 +#tls_port = +banner = LMTP server ready. + +[POP] +port = 110 +#tls_port = 995 + +# You can set an alternate banner to display when connecting to the service +banner = POP3 server ready. + +# +# If yes, allows SMTP access from the host IP connecting by POP3. +# This requires addition configuration of your MTA +# +pop_before_smtp = no + +[HTTP] +port = 41380 +# +# the httpd daemon provides full access to all users, mailboxes +# and messages. Be very careful with this one! +bindip = 127.0.0.1 +admin = admin:secret + +[IMAP] +# You can set an alternate banner to display when connecting to the service +# banner = imap 4r1 server (dbmail 2.3.x) + +# +# Port to bind to. +# +port = 143 +#tls_port = 993 + +banner = IMAP server ready. + +# +# IMAP prefers a longer timeout than other services. +# +timeout = 4000 + +# +# If yes, allows SMTP access from the host IP connecting by IMAP. +# This requires addition configuration of your MTA +# +imap_before_smtp = no + +# +# during IDLE, how many seconds between checking the mailbox +# status (default: 30) +# +# idle_timeout = 30 + +# during IDLE, how often should the server send an '* OK' still +# here message (default: 10) +# +# the time between such a message is idle_timeout * idle_interval +# seconds +# +# idle_interval = 10 + +# +# If TLS is enabled, login before starttls is normally +# not allowed. Use login_disabled=no to change this +# +# login_disabled = yes + +# +# Provide a CAPABILITY to override the default +# +# capability = IMAP4 IMAP4rev1 AUTH=LOGIN ACL RIGHTS=texk NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE + +# max message size. You can specify the maximum message size +# accepted by the IMAP daemon during APPEND commands. +# +# Supported formats: +# decimal: 1000000 +# octal: 03777777 +# hex: 0xfffff +# +# max_message_size = + + +[SIEVE] +# +# Port to bind to. +# +port = 2000 +tls_port = +banner = SIEVE server ready. + + +[LDAP] +#port = 389 +#version = 3 +#hostname = ldap +#base_dn = ou=People,dc=mydomain,dc=com + +# +# If your LDAP library supports ldap_initialize(), then you can use the +# alternative LDAP server DSN like following. +# +# URI = ldap://127.0.0.1:389 +# URI = ldapi://%2fvar%2frun%2fopenldap%2fldapi/ + +# +# Leave blank for anonymous bind. +# example: cn=admin,dc=mydomain,dc=com +# +#bind_dn = + +# +# Leave blank for anonymous bind. +# +#bind_pw = +#scope = SubTree + +# AD users may want to set this to 'no' to disable +# ldap referrals if you are seeing 'Operations errors' +# in your logs +# +#referrals = yes + +#user_objectclass = top,account,dbmailUser +#forw_objectclass = top,account,dbmailForwardingAddress +#cn_string = uid +#field_passwd = userPassword +#field_uid = uid +#field_nid = uidNumber +#min_nid = 10000 +#max_nid = 15000 +#field_cid = gidNumber +#min_cid = 10000 +#max_cid = 15000 + +# a comma-separated list of attributes to match when searching +# for users or forwards that match a delivery address. A match +# on any of them is a hit. +field_mail = mail + +# field that holds the mail-quota size for a user. +field_quota = mailQuota + +# field that holds the forwarding address. +field_fwdtarget = mailForwardingAddress + +# override the query string used to search for users +# or forwards with a delivery address. +# query_string = (mail=%s) + +[DELIVERY] +# +# Run Sieve scripts as messages are delivered. +# +SIEVE = yes + +# +# Use 'user+mailbox@domain' format to deliver to a mailbox. +# +SUBADDRESS = yes + +# +# Turn on/off the Sieve Vacation extension. +# +SIEVE_VACATION = yes + +# +# Turn on/off the Sieve Notify extension +# +SIEVE_NOTIFY = yes + +# +# Turn on/off additional Sieve debugging. +# +SIEVE_DEBUG = no + + +# Use the auto_notify table to send email notifications. +# +AUTO_NOTIFY = no + +# +# Use the auto_reply table to send away messages. +# +AUTO_REPLY = no + +# +# Defaults to "NEW MAIL NOTIFICATION" +# +#AUTO_NOTIFY_SUBJECT = + +# +# Defaults to POSTMASTER from the DBMAIL section. +# +#AUTO_NOTIFY_SENDER = + + +# If you set this to 'yes' dbmail will check for duplicate +# messages in the relevant mailbox during delivery using +# the Message-ID header +# +suppress_duplicates = no + +# +# Soft or hard bounce on over-quota delivery +# +quota_failure = hard + + +# end of configuration file diff --git a/network/dbmail/dbmail.cron b/network/dbmail/dbmail.cron new file mode 100644 index 0000000000..3cf4e0cd95 --- /dev/null +++ b/network/dbmail/dbmail.cron @@ -0,0 +1,7 @@ +#!/bin/sh + +# cleanup deleted messages +if [ -x /usr/sbin/dbmail-util ]; then + /usr/sbin/dbmail-util -ay 2>&1 > /dev/null +fi + diff --git a/network/dbmail/dbmail.info b/network/dbmail/dbmail.info new file mode 100644 index 0000000000..a4c76dc6fe --- /dev/null +++ b/network/dbmail/dbmail.info @@ -0,0 +1,10 @@ +PRGNAM="dbmail" +VERSION="3.2.3" +HOMEPAGE="http://www.dbmail.org/" +DOWNLOAD="http://www.dbmail.org/download/3.2/dbmail-3.2.3.tar.gz" +MD5SUM="4f140751642559395dfe3a6bb2cc9300" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="libzdb re2c" +MAINTAINER="Sergei Fedosoff" +EMAIL="eleksir@gmail.com" diff --git a/network/dbmail/dbmail.logrotate b/network/dbmail/dbmail.logrotate new file mode 100644 index 0000000000..40538d5b65 --- /dev/null +++ b/network/dbmail/dbmail.logrotate @@ -0,0 +1,9 @@ +/var/log/dbmail.log /var/log/dbmail.err { + daily + missingok + notifempty + rotate 10 + compress + delaycompress + copytruncate +} diff --git a/network/dbmail/doinst.sh b/network/dbmail/doinst.sh new file mode 100644 index 0000000000..a7859d0c35 --- /dev/null +++ b/network/dbmail/doinst.sh @@ -0,0 +1,29 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.dbmail-httpd.new +preserve_perms etc/rc.d/rc.dbmail-imapd.new +preserve_perms etc/rc.d/rc.dbmail-lmtpd.new +preserve_perms etc/rc.d/rc.dbmail-pop3d.new +preserve_perms etc/cron.daily/dbmail.new +config etc/dbmail/dbmail.conf.new +config etc/logrotate.d/dbmail.new + diff --git a/network/dbmail/rc.dbmail-httpd.new b/network/dbmail/rc.dbmail-httpd.new new file mode 100644 index 0000000000..a669475539 --- /dev/null +++ b/network/dbmail/rc.dbmail-httpd.new @@ -0,0 +1,54 @@ +#!/bin/sh +# +# DBMail-httpd startup script for Slackware Linux + +SERVICE='/usr/sbin/dbmail-httpd' +OPTS='' +PIDDIR='/var/run/dbmail' +PID="${PIDDIR}/dbmail-httpd.pid" +USER='mail' +GROUP='mail' + +service_start() { + if [ ! -d "$PIDDIR" ]; then + mkdir "$PIDDIR" + chown ${USER}:${GROUP} "$PIDDIR" + fi + + if [ -f "$PID" ]; then + echo "PID-file exist, refusing to run ${SERVICE}." + exit 1 + fi + + $SERVICE "$OPTS" +} + +service_stop() { + if [ -f "$PID" ]; then + kill $(< $PID) + else + echo "No PID-file at $PID found, quitting." + exit 1 + fi +} + +service_restart() { + service_stop + sleep 1 + service_start +} + +case "$1" in + start) + service_start + ;; + stop) + service_stop + ;; + restart) + service_restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac diff --git a/network/dbmail/rc.dbmail-imapd.new b/network/dbmail/rc.dbmail-imapd.new new file mode 100644 index 0000000000..1324c74da6 --- /dev/null +++ b/network/dbmail/rc.dbmail-imapd.new @@ -0,0 +1,54 @@ +#!/bin/sh +# +# DBMail-imapd startup script for Slackware Linux + +SERVICE='/usr/sbin/dbmail-imapd' +OPTS='' +PIDDIR='/var/run/dbmail' +PID="${PIDDIR}/dbmail-imapd.pid" +USER='mail' +GROUP='mail' + +service_start() { + if [ ! -d "$PIDDIR" ]; then + mkdir "$PIDDIR" + chown ${USER}:${GROUP} "$PIDDIR" + fi + + if [ -f "$PID" ]; then + echo "PID-file exist, refusing to run ${SERVICE}." + exit 1 + fi + + $SERVICE "$OPTS" +} + +service_stop() { + if [ -f "$PID" ]; then + kill $(< $PID) + else + echo "No PID-file at $PID found, quitting." + exit 1 + fi +} + +service_restart() { + service_stop + sleep 1 + service_start +} + +case "$1" in + start) + service_start + ;; + stop) + service_stop + ;; + restart) + service_restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac diff --git a/network/dbmail/rc.dbmail-lmtpd.new b/network/dbmail/rc.dbmail-lmtpd.new new file mode 100644 index 0000000000..34a633d865 --- /dev/null +++ b/network/dbmail/rc.dbmail-lmtpd.new @@ -0,0 +1,54 @@ +#!/bin/sh +# +# DBMail-lmtpd startup script for Slackware Linux + +SERVICE='/usr/sbin/dbmail-lmtpd' +OPTS='' +PIDDIR='/var/run/dbmail' +PID="${PIDDIR}/dbmail-lmtpd.pid" +USER='mail' +GROUP='mail' + +service_start() { + if [ ! -d "$PIDDIR" ]; then + mkdir "$PIDDIR" + chown ${USER}:${GROUP} "$PIDDIR" + fi + + if [ -f "$PID" ]; then + echo "PID-file exist, refusing to run ${SERVICE}." + exit 1 + fi + + $SERVICE "$OPTS" +} + +service_stop() { + if [ -f "$PID" ]; then + kill $(< $PID) + else + echo "No PID-file at $PID found, quitting." + exit 1 + fi +} + +service_restart() { + service_stop + sleep 1 + service_start +} + +case "$1" in + start) + service_start + ;; + stop) + service_stop + ;; + restart) + service_restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac diff --git a/network/dbmail/rc.dbmail-pop3d.new b/network/dbmail/rc.dbmail-pop3d.new new file mode 100644 index 0000000000..6398c40c8f --- /dev/null +++ b/network/dbmail/rc.dbmail-pop3d.new @@ -0,0 +1,54 @@ +#!/bin/sh +# +# DBMail-pop3d startup script for Slackware Linux + +SERVICE='/usr/sbin/dbmail-pop3d' +OPTS='' +PIDDIR='/var/run/dbmail' +PID="${PIDDIR}/dbmail-pop3d.pid" +USER='mail' +GROUP='mail' + +service_start() { + if [ ! -d "$PIDDIR" ]; then + mkdir "$PIDDIR" + chown ${USER}:${GROUP} "$PIDDIR" + fi + + if [ -f "$PID" ]; then + echo "PID-file exist, refusing to run ${SERVICE}." + exit 1 + fi + + $SERVICE "$OPTS" +} + +service_stop() { + if [ -f "$PID" ]; then + kill $(< $PID) + else + echo "No PID-file at $PID found, quitting." + exit 1 + fi +} + +service_restart() { + service_stop + sleep 1 + service_start +} + +case "$1" in + start) + service_start + ;; + stop) + service_stop + ;; + restart) + service_restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac diff --git a/network/dbmail/slack-desc b/network/dbmail/slack-desc new file mode 100644 index 0000000000..366bf4b4b8 --- /dev/null +++ b/network/dbmail/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +dbmail: dbmail (IMAP and POP3 Server) +dbmail: +dbmail: Fast and scalable sql based email services. +dbmail: +dbmail: +dbmail: +dbmail: +dbmail: +dbmail: +dbmail: +dbmail: Homepage: http://dbmail.org/ |