Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 23:20:05 +0200 (EET)
From:      Igor Olemskoi <igor@nix.org.ua>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/34505: New port: DBMAIL IMAP4rev1/POP3 mail servers
Message-ID:  <20020131212005.4E6FE3BD9ED@avenue.com.ua>

next in thread | raw e-mail | index | archive | help

>Number:         34505
>Category:       ports
>Synopsis:       New port: DBMAIL IMAP4rev1/POP3 mail servers
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 31 13:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Igor Olemskoi
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Host4u.org
>Environment:
System: FreeBSD avenue.com.ua 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Jan 30 01:07:46 EET 2002 root@avenue.com.ua:/usr/src/sys/compile/avenue i386


	
>Description:
	New port: DBMAIL IMAP4rev1/POP3 mail servers
	
>How-To-Repeat:
	
>Fix:

	

--- dbmail-port begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	dbmail
#	dbmail/files
#	dbmail/files/patch-src::dbmysql.h
#	dbmail/distinfo
#	dbmail/pkg-comment
#	dbmail/pkg-descr
#	dbmail/pkg-plist
#	dbmail/pkg-install
#	dbmail/Makefile
#	dbmail/pkg-message
#	dbmail/scripts
#	dbmail/scripts/configure.dbmail
#	dbmail/pkg-deinstall
#
echo c - dbmail
mkdir -p dbmail > /dev/null 2>&1
echo c - dbmail/files
mkdir -p dbmail/files > /dev/null 2>&1
echo x - dbmail/files/patch-src::dbmysql.h
sed 's/^X//' >dbmail/files/patch-src::dbmysql.h << 'END-of-dbmail/files/patch-src::dbmysql.h'
X--- dbmail.h-orig	Fri Jan 25 18:18:15 2002
X+++ dbmysql.h		Thu Jan 17 22:29:10 2002
X@@ -7,7 +7,7 @@
X #ifndef  _DBMYSQL_H
X #define  _DBMYSQL_H
X 
X-#include "/usr/include/mysql/mysql.h"
X+#include "/usr/local/include/mysql/mysql.h"
X #include "debug.h"
X #include "imap4.h"
X #include "mime.h"
END-of-dbmail/files/patch-src::dbmysql.h
echo x - dbmail/distinfo
sed 's/^X//' >dbmail/distinfo << 'END-of-dbmail/distinfo'
XMD5 (dbmail/dbmail-20020201.tar.gz) = f96c2434cf88127d57c0f0928fce44ce
END-of-dbmail/distinfo
echo x - dbmail/pkg-comment
sed 's/^X//' >dbmail/pkg-comment << 'END-of-dbmail/pkg-comment'
XDBMAIL IMAP4rev1/POP3 mail servers
END-of-dbmail/pkg-comment
echo x - dbmail/pkg-descr
sed 's/^X//' >dbmail/pkg-descr << 'END-of-dbmail/pkg-descr'
XAdvantages of dbmail:
X
X- Scalability. DBMAIL is as scalable as the database that is used for the mail
X  storage. In theory millions of accounts can be managed using DBMAIL.
X- One could, for example, run 4 different servers with the pop3 daemon each
X  connecting to the same database (cluster) server.
X- Manageability. DBMAIL is based upon a database. DBMAIL can be managed by
X  changing settings in the database (using f.e. PHP / perl / SQL).
X- Speed, DBMAIL uses very efficient, database specific queries for retrieveing
X  mailinformation. This is much faster then parsing a filesystem.
X- Security. DBMAIL has got nothing to do with the filesystem or interaction with
X  other programs in the unix environment which need special permissions. 
X- DBMAIL is as secure as the database it's based on. 
X- Flexibilty. Changes on a DBMAIL system (adding of users, changeing passwords
X  etc.) are effecitve immediatly.
X
XWWW: http://www.dbmail.org/
END-of-dbmail/pkg-descr
echo x - dbmail/pkg-plist
sed 's/^X//' >dbmail/pkg-plist << 'END-of-dbmail/pkg-plist'
Xetc/dbmail.conf-dist
Xsbin/dbmail-smtp
Xsbin/dbmail-pop3d
Xsbin/dbmail-imapd
Xsbin/dbmail-maintenance
Xsbin/dbmail-adduser
Xsbin/dbmail-config
X%%PORTDOCS%%share/doc/dbmail/INSTALL
X%%PORTDOCS%%share/doc/dbmail/README
X%%PORTDOCS%%share/doc/dbmail/TODO
X%%PORTDOCS%%@dirrm share/doc/dbmail
END-of-dbmail/pkg-plist
echo x - dbmail/pkg-install
sed 's/^X//' >dbmail/pkg-install << 'END-of-dbmail/pkg-install'
X#!/bin/sh
X
Xif [ "$2" != "PRE-INSTALL" ]; then
X    exit 0
Xfi
X
XUSER=dbmail
XGROUP=${USER}
XUID=2002
XGID=${UID}
X
Xif ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
X	if pw groupadd ${GROUP} -g ${GID}; then
X		echo "Added group \"${GROUP}\"."
X	else
X		echo "Adding group \"${GROUP}\" failed..."
X		exit 1
X	fi
Xfi
X
Xif ! pw usershow "${USER}" 2>/dev/null 1>&2; then
X	if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
X		-s "/sbin/nologin" -d "/nonexistent" \
X		-c "dbmail MTA"; \
X	then
X		echo "Added user \"${USER}\"."
X	else
X		echo "Adding user \"${USER}\" failed..."
X		exit 1
X	fi
Xfi
Xexit 0
END-of-dbmail/pkg-install
echo x - dbmail/Makefile
sed 's/^X//' >dbmail/Makefile << 'END-of-dbmail/Makefile'
X# New ports collection makefile for:	dbmail
X# Date created: 	1 Feb 2002
X# Whom:			igor@nix.org.ua
X#
X# $FreeBSD$
X#
X
XPORTNAME=	dbmail
XPORTVERSION=	20020201
XPORTREVISION=	1
XCATEGORIES=	mail
XMASTER_SITES=	http://dbmail.host4u.org/
XDISTNAME=	${PORTNAME}-${PORTVERSION}
XDIST_SUBDIR=	${PORTNAME}
X
XMAINTAINER=	igor@nix.org.ua
X
XRUN_DEPENDS+=	mysql:${PORTSDIR}/databases/mysql323-client
XRUN_DEPENDS+=	postfix:${PORTSDIR}/mail/postfix
X
XMAN1=	dbmail-smtp.1 dbmail-pop3d.1 dbmail-imapd.1 dbmail-maintenance.1 \
X	dbmail-adduser.1 dbmail-config.1
X
XCONF1=	dbmail.conf
X
XBIN1=	dbmail-smtp dbmail-pop3d dbmail-imapd dbmail-maintenance \
X	dbmail-adduser dbmail-config
X
XDOC1=	INSTALL README TODO
X
XDOC2=	create_tables.sql pop_before_smtp.sql \
X	update_mailbox_subscribed_folders \
X	update_ownerid_aliases.sql
X
X
X.if defined(NOPORTDOCS)
XPLIST_SUB+=	SUB_DOCS="@comment "
X.else
XPLIST_SUB+=	SUB_DOCS=""
X.endif
X
XSCRIPTS_ENV=	WRKSRC="${WRKSRC}"
X
Xpre-fetch:
X
Xpost-extract:
X	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.dbmail
X
Xpost-patch:
X
Xpre-install:
X	@PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
X
Xdo-install:
X.for file in ${CONF1}
X	@${INSTALL_DATA} \
X		${WRKSRC}/${file} \
X		${PREFIX}/etc/${file}-dist
X.endfor
X
X.for file in ${BIN1}
X	@${INSTALL_PROGRAM} \
X		${WRKSRC}/${file} \
X		${PREFIX}/sbin
X.endfor
X
X.for file in ${MAN1}
X	@${INSTALL_MAN} \
X		${WRKSRC}/man/${file} \
X		${PREFIX}/man/man1
X.endfor
X
X.if !defined(NOPORTDOCS)
X	@${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} -m 555 ${DOCSDIR}
X	@cd ${WRKSRC} && for i in ${DOC1} ; do \
X		${INSTALL_DATA} $$i ${DOCSDIR} ; done && \
X		${ECHO_MSG} "Installed readme in ${DOCSDIR}"
X	@cd ${WRKSRC}/sql && for i in ${DOC2} ; do \
X		${INSTALL_DATA} $$i ${DOCSDIR} ; done && \
X		${ECHO_MSG} "Installed SQL examples in ${DOCSDIR}"
X.endif
X
Xpost-install:
X	@PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
X	@${CAT} ${PKGMESSAGE}
X
Xpost-clean:
X
X.include <bsd.port.pre.mk>
X
X.include <bsd.port.post.mk>
END-of-dbmail/Makefile
echo x - dbmail/pkg-message
sed 's/^X//' >dbmail/pkg-message << 'END-of-dbmail/pkg-message'
X
X--------------------------------------------------
XInstructions on how to setup postfix to use dbmail
X         are described in INSTALL file
X--------------------------------------------------
X
X
END-of-dbmail/pkg-message
echo c - dbmail/scripts
mkdir -p dbmail/scripts > /dev/null 2>&1
echo x - dbmail/scripts/configure.dbmail
sed 's/^X//' >dbmail/scripts/configure.dbmail << 'END-of-dbmail/scripts/configure.dbmail'
X#!/bin/sh
X
Xecho
Xecho "Please enter MySQL information for dbmail database (it will be created automatically)."
Xecho
X
Xecho -n "hostname      : "
Xread mysql_hostname
X
Xecho -n "dbmail user   : "
Xread mysql_user
X
Xecho -n "password      : "
Xread mysql_password
X
Xecho
Xecho "Please enter MySQL root password to create 'dbmail' database."
Xecho
Xecho -n "root password : "
Xread mysql_root_password
X
Xecho
Xecho " - Creating dbmail database and tables..."
Xmysql -u $mysql_user -p$mysql_password -h $mysql_hostname <$WRKSRC/sql/create_tables.sql
X
Xecho " - Giving access for user '$mysql_user' to the database..."
X
Xcat << EOF | mysql -u root -p$mysql_root_password -h $mysql_hostname
X
Xgrant usage on dbmail.* to $mysql_user@$mysql_hostname;
Xgrant select,insert,update,delete,create,index,alter,drop on dbmail.* to $mysql_user@$mysql_hostname identified by '$mysql_password';
Xflush privileges;
X
XEOF
X
Xecho " - Writing config.h..."
Xecho
X
Xcat << EOF > $WRKSRC/config.h
X/* $Id: config.h,v 1.12 2001/09/24 14:59:38 eelco Exp $ \
X * (c) 2000-2001 IC&S, The Netherlands */ \
X
X
X#ifndef  _CONFIG_H
X#define  _CONFIG_H
X
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <strings.h>
X#include <unistd.h>
X#include <syslog.h>
X
X/* DATABASE SPECIFIC */
X#define HOST "$mysql_hostname"
X#define USER "$mysql_user"
X#define PASS "$mysql_password"
X
X/* #define USE_DEVELOPMENT  */
X#ifdef USE_DEVELOPMENT
X#define MAILDATABASE "dbmail_dev"
X#else
X#define MAILDATABASE "dbmail"
X#endif
X
X#define UID_SIZE 70
X
X#endif
X
XEOF
END-of-dbmail/scripts/configure.dbmail
echo x - dbmail/pkg-deinstall
sed 's/^X//' >dbmail/pkg-deinstall << 'END-of-dbmail/pkg-deinstall'
X#!/bin/sh
X
Xif [ "$2" != "POST-DEINSTALL" ]; then
X    exit 0
Xfi
X
XUSER=dbmail
X
Xif pw usershow "${USER}" 2>/dev/null 1>&2; then
X	echo "To delete dbmail user permanently, use 'pw userdel ${USER}'"
Xfi
X
Xexit 0
END-of-dbmail/pkg-deinstall
exit
--- dbmail-port ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020131212005.4E6FE3BD9ED>