Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15931 - new xmail 1.12 ebuild
Summary: new xmail 1.12 ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Nick Hadaway
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2003-02-18 11:53 UTC by Kevin Williams
Modified: 2003-10-17 21:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xmail 1.12 ebuild script and patch (xmail-ebuild.tar.gz,1.78 KB, application/gzip)
2003-02-18 11:53 UTC, Kevin Williams
Details
Updated ebuild script for secure config files (xmail-1.12.ebuild,943 bytes, text/plain)
2003-02-19 10:38 UTC, Kevin Williams
Details
new diff to patch xmail start/stop script without killing it (xmail.diff,2.97 KB, patch)
2003-03-11 13:34 UTC, sergey ivanov
Details | Diff
corrected patch (xmail.diff,3.00 KB, patch)
2003-03-11 16:21 UTC, sergey ivanov
Details | Diff
Change to command line options (xmail_cmdline.diff,2.86 KB, patch)
2003-03-11 17:24 UTC, Kevin Williams
Details | Diff
new ebuild which incorporates Debian's xmail folder stucture (xmail-1.12.ebuild,4.00 KB, text/plain)
2003-03-13 15:49 UTC, sergey ivanov
Details
start/stop xmail script (xmail.diff,3.12 KB, patch)
2003-03-13 15:53 UTC, sergey ivanov
Details | Diff
latest ebuild script with path structure from sergey (xmail-1.12.ebuild,2.39 KB, text/plain)
2003-03-21 11:56 UTC, Kevin Williams
Details
ENV.D file for MAIL_ROOT variable (15xmail,21 bytes, text/plain)
2003-03-21 11:57 UTC, Kevin Williams
Details
CONF.D file for XMail configuration (xmail.confd,234 bytes, text/plain)
2003-03-21 11:58 UTC, Kevin Williams
Details
INIT.D script greatly simplified, uses CONF.D file variables (xmail.initd,1.19 KB, text/plain)
2003-03-21 11:59 UTC, Kevin Williams
Details
automated configuration script - separated from ebuild (xmailwizard,2.06 KB, text/plain)
2003-03-21 11:59 UTC, Kevin Williams
Details
ChangeLog (ChangeLog,451 bytes, text/plain)
2003-03-22 11:28 UTC, Kevin Williams
Details
patch for xmail-1.14 (xmail.patch,824 bytes, patch)
2003-04-08 10:43 UTC, sergey ivanov
Details | Diff
latest version (1.15) (xmail-1.15.ebuild,2.89 KB, text/plain)
2003-05-07 14:19 UTC, Kevin Williams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Williams 2003-02-18 11:53:04 UTC
Hi!

Please find attached xmail-ebuild.tar.gz containing xmail-1.12.ebuild and a
patch to reconfigure the init.d script for Gentoo.

XMail is a small, fast, and highly configurable SMTP/POP3/Finger server for
Win32 and Linux. Tests have shown it to be about 50% faster than qmail.

I suggest net-mail/xmail.

Kevin

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Kevin Williams 2003-02-18 11:53:59 UTC
Created attachment 8431 [details]
xmail 1.12 ebuild script and patch
Comment 2 Kevin Williams 2003-02-19 10:38:30 UTC
Created attachment 8484 [details]
Updated ebuild script for secure config files

I forgot to secure the config files in the original script.
Comment 3 Kevin Williams 2003-02-19 10:40:22 UTC
I also strongly suggest adding "/var/MailRoot -/var/MailRoot/bin -/var/MailRoot/docs" to 
the CONFIG_PROTECT variable in /etc/make.globals. 
Comment 4 sergey ivanov 2003-03-11 13:34:51 UTC
Created attachment 9261 [details, diff]
new diff to patch xmail start/stop script without killing it

XMail server has a way to stop it by placing .shutdown file in its $MAIL_ROOT
folder. Killing it by signal may cause problems and misbehavior.
Comment 5 sergey ivanov 2003-03-11 16:21:19 UTC
Created attachment 9265 [details, diff]
corrected patch

results of testing and debugging runscript and XMail interaction
Comment 6 Kevin Williams 2003-03-11 17:18:48 UTC
I don't know for sure what signal "start-stop-daemon --stop --quiet --exec $DAEMON --name $NAME --pidfile=/var/run/$NAME.pid" sends out, I just plugged in the executable, name, and pid file. According to http://www.xmailserver.org/Readme.html#server%20shutdown it is perfectly acceptable to use "kill -INT `cat /var/run/XMail.pid`" to shutdown XMail on Linux. Either will probably work. I was just trying to do things "the Gentoo way" as best I can. I'm glad someone has looked at this - I posted it weeks ago!
Comment 7 Kevin Williams 2003-03-11 17:24:14 UTC
Created attachment 9267 [details, diff]
Change to command line options

Please don't create an "issue" concerning what options to run under. The
author, Davide Libenzi, distributes with no options and leaves that to the end
user. This should obsolete attachment (id=9265) but I guess I don't have
permissions to do that.
Comment 8 sergey ivanov 2003-03-13 15:49:44 UTC
Created attachment 9366 [details]
new ebuild which incorporates Debian's xmail folder stucture

This ebuild moves configuration files to /etc, and creates symlink to
/var/spool, /var/cache and /var/log xmail subdirectories. Also it contains
configure script to run manually after emerge, which fill ctrlaccount.tab from
user input and also create first mail domain and it's mail users. Relaying
closed by default, clients should use smtpauth.
Comment 9 sergey ivanov 2003-03-13 15:53:34 UTC
Created attachment 9367 [details, diff]
start/stop xmail script

Kevin, thank you, you are right. Sending XMail server signal INT is the correct
way to stop it. If you do not provide --signal parameter to start-stop-daemon,
it may cause misbehavior. 
This new patch also incorporates changes to directory structure I've take from
Debian's XMail build.
     Sergey
Comment 10 sergey ivanov 2003-03-15 08:40:39 UTC
Comment on attachment 9367 [details, diff]
start/stop xmail script

>--- xmail-1.12/xmail	2003-01-17 20:01:36.000000000 -0500
>+++ xmail	2003-03-12 16:34:54.000000000 -0500
>@@ -1,93 +1,47 @@
>-#!/bin/sh
>-#
>-# skeleton	example file to build /etc/init.d/ scripts.
>-#		This file should be used to construct scripts for /etc/init.d.
>-#
>-#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
>-#		Modified by Davide Libenzi <davidel@xmailserver.org>
>-#
>-# Version:	@(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
>-#
>-
>-XMAIL_ROOT=/var/MailRoot
>-XMAIL_CMD_LINE=""
>-PATH=$XMAIL_ROOT/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
>-DAEMON=$XMAIL_ROOT/bin/XMail
>+#!/sbin/runscript
>+# Copyright 1999-2002 Gentoo Technologies, Inc.
>+# Distributed under the terms of the GNU General Public License, v2 or later
>+# $Header $
>+
>+XMAIL_ROOT=/etc/xmail
>+XMAIL_CMD_LINE=" -Ms $XMAIL_ROOT -Sl -Pl -Ql -Fl -Cl"
>+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
>+DAEMON=/usr/bin/XMail
> NAME=XMail
> DESC="XMail server"
> 
>-test -f $DAEMON || exit 0
>-
>-set -e
>-ulimit -c 20000
>-
>-start_xmail()
>-{
>-    MAIL_ROOT=$XMAIL_ROOT
>-	export MAIL_ROOT
>-    MAIL_CMD_LINE=$XMAIL_CMD_LINE
>-	export MAIL_CMD_LINE
>-    $DAEMON
>-    while [ ! -f /var/run/$NAME.pid ]
>-    do
>-        sleep 1
>-    done
>+depend() {
>+	need net
>+	use dns
> }
> 
>-stop_xmail()
>-{
>-	if [ -f /var/run/$NAME.pid ]
>-	then
>-    	echo `date` > $XMAIL_ROOT/.shutdown
>-    	while [ -f $XMAIL_ROOT/.shutdown ]
>-    	do
>-        	sleep 1
>-   		done
>+checkconfig() {
>+	if [ ! -f $DAEMON ] ; then
>+		eerror "XMail binary not found!"
> 	fi
>-}
> 
>+	set -e
>+	ulimit -c 20000
>+	
>+}
> 
>-case "$1" in
>-  start)
>-      echo -n "Starting $DESC: "
>-      start_xmail
>-      echo "$NAME.[" `cat /var/run/$NAME.pid` "]"
>-	;;
>-  stop)
>-      echo -n "Stopping $DESC: "
>-      stop_xmail
>-      echo "$NAME."
>-	;;
>-  #reload)
>-	#
>-	#	If the daemon can reload its config files on the fly
>-	#	for example by sending it SIGHUP, do it here.
>-	#
>-	#	If the daemon responds to changes in its config file
>-	#	directly anyway, make this a do-nothing entry.
>-	#
>-	# echo "Reloading $DESC configuration files."
>-	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
>-	#	/var/run/$NAME.pid --exec $DAEMON
>-  #;;
>-  restart|force-reload)
>-	#
>-	#	If the "reload" option is implemented, move the "force-reload"
>-	#	option to the "reload" entry above. If not, "force-reload" is
>-	#	just the same as "restart".
>-	#
>-	echo -n "Restarting $DESC: "
>-	stop_xmail
>-	sleep 1
>-	start_xmail
>-        echo "$NAME.[" `cat /var/run/$NAME.pid` "]"	
>-	;;
>-  *)
>-	N=/etc/init.d/$NAME
>-	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
>-	echo "Usage: $N {start|stop|restart|force-reload}" >&2
>-	exit 1
>-	;;
>-esac
>+start() {
>+	checkconfig || return 1
>+	ebegin "Starting $NAME"
>+	start-stop-daemon --start --startas $DAEMON \
>+		--quiet --pidfile=/var/run/$NAME.pid -- $XMAIL_CMD_LINE
>+	while [ ! -f /var/run/$NAME.pid ]
>+	do
>+		sleep 1
>+	done
>+	eend $? "Failed to start XMail"
>+}
> 
>-exit 0
>+stop() {
>+	ebegin "Stopping xmail"
>+	if [ -f /var/run/$NAME.pid ] ; then
>+		start-stop-daemon --stop --quiet --pidfile=/var/run/$NAME.pid --name=$NAME --retry 120 \
>+			--oknodo --signal 2 --quiet
>+	fi
>+	eend $? "Failed to stop XMail"
>+}
Comment 11 sergey ivanov 2003-03-18 17:54:33 UTC
Hi, I've arranged page http://www.spectr.org/sergey/ for xmail-1.12.ebuild and accomplishing it files with short description how to use it. So all my submitted attachments here should be considered as out of use. 
    Sergey Ivanov <seriv@parkheights.dyndns.org>
Comment 12 Kevin Williams 2003-03-21 11:56:46 UTC
Created attachment 9660 [details]
latest ebuild script with path structure from sergey
Comment 13 Kevin Williams 2003-03-21 11:57:39 UTC
Created attachment 9661 [details]
ENV.D file for MAIL_ROOT variable
Comment 14 Kevin Williams 2003-03-21 11:58:16 UTC
Created attachment 9662 [details]
CONF.D file for XMail configuration
Comment 15 Kevin Williams 2003-03-21 11:59:03 UTC
Created attachment 9663 [details]
INIT.D script greatly simplified, uses CONF.D file variables
Comment 16 Kevin Williams 2003-03-21 11:59:53 UTC
Created attachment 9664 [details]
automated configuration script - separated from ebuild
Comment 17 Kevin Williams 2003-03-22 11:28:49 UTC
Created attachment 9697 [details]
ChangeLog
Comment 18 sergey ivanov 2003-04-08 10:43:48 UTC
Created attachment 10375 [details, diff]
patch for xmail-1.14

This patch make xmail ebuild and xmail.diff independent of XMail version
number. The only thing to do with new version of XMail (tested on 1.14) is to
rename ebuild s/12/14/ and make new digest.
     Sergey
Comment 19 Kevin Williams 2003-05-07 14:19:53 UTC
Created attachment 11652 [details]
latest version (1.15)

fixes permissions problems, sendmail problems
Comment 20 sergey ivanov 2003-05-26 14:34:00 UTC
I've modified Kevin's ebuild and it's files to run XMail in chrooted environment from unprivileged user. Should I place ebuild and start/stop and conf. files here or it is sufficient to place it at http://www.spectr.org/sergey/XMail_for_Gentoo.html ?

   Sergey
Comment 21 Nick Hadaway 2003-06-09 13:31:24 UTC
I have added the ebuild to portage with some minor changes.
Please check it out and let me know if you find any problems with my submission.
I removed the interactive portion and changed the useradd/groupadd functions.
Comment 22 Kevin Williams 2003-06-09 18:24:55 UTC
Nick,

That should be fine. The wizard just speeds up the initial setup process for those who have at least read the readme file.

I read http://freshmeat.net/projects/xmail/?topic_id=32%2C33%2C34%2C30%2C88 a long time ago concerning XMail performance, and that's what convinced me to try it. I haven't tested the claims, but they aren't from XMail's author, so I don't suspect too much exaggeration.

Kevin
Comment 23 sergey ivanov 2003-06-09 19:20:16 UTC
   My test results: ebuild succeeds at second attempt. The first attempt fails, xmail user and group unavailable at install stage of ebuild. But they created and are available for second emerge.
   The original ebuild with groupadd and useradd in install also does not work, I think the portage has changed and I failed to manage to chown installed files to new user by ebuild.
   Sergey.
Comment 24 Nick Hadaway 2003-06-10 00:01:19 UTC
I have moved the useradd/groupadd routines to pkg_setup... which should fix the aforementioned problem
Comment 25 sergey ivanov 2003-06-10 18:24:49 UTC
I have four corrections. 
First: remove CR/LF line ending in files/xmail* 
Second: move line : 
--- 
        cp -R -u /etc/xmail/* ${CHROOT}${MAIL_ROOT} 
--- 
before line: 
--- 
        chown -R xmail.xmail ${CHROOT} 
--- 
in files/xmail.initd, else xmail will not start the first time, it's control tab files remains 
root's owned. 
And third, :%s/6017/29617/g in files/xmailwizard. XMail starts after two first 
corrections, but xmailwizard wait for him in a wrong port. 
And the last - XMail server needs also /tmp in it's chrooted jail. This may be added as 
dodir /chroot/xmail/tmp in ebuild or into files/xmail.initd into line: 
--- 
       for subdir in dev lib var/run var/MailRoot tmp 
--- 
 
Sincerely, 
   Sergey 
 
Comment 26 Kevin Williams 2003-06-10 21:03:14 UTC
I hope someone (not me) is going to patch the documentation to reflect all the deviation from the readme file. Sergey's build is advanced from my point of view - I don't know any Linux users who actually run anything in a chroot environment. The novice won't be able to follow the readme file with the way things are now. My build reflects the readme file and everything runs without modification, including sendmail. I've even got Courier-IMAP running against the user's mailboxes without hassle.

I may be a novice in the Linux world, but I feel the ebuild should not take such a simple build and make it so complicated. I'm happy that XMail in finally in portage, but I'll stick with my ebuild because it works for me.
Comment 27 sergey ivanov 2003-06-30 07:14:49 UTC
I think it's worth while accept Kewin's suggestion and roll back to his ebuild version or accept my last corrections. Both produce ebuild creating working XMail. While existing gentoo's XMail can not produce working XMail.
      Sergey
Comment 28 Nick Hadaway 2003-10-17 21:48:40 UTC
xmail-1.16 has been marked stable for x86