# HG changeset patch # User mmj # Date 1106917435 -39600 # Node ID 0c96f9bb31623ce90c26f40aa4dad3e984b574bd # Parent bc7ed828388dc0606fdffde2939dd34481f6585b mlmmj-make-ml.sh will now know where the listtexts where installed in the system, and use that as default. diff -r bc7ed828388d -r 0c96f9bb3162 ChangeLog --- a/ChangeLog Sat Jan 29 00:02:29 2005 +1100 +++ b/ChangeLog Sat Jan 29 00:03:55 2005 +1100 @@ -1,3 +1,5 @@ + o Make mlmmj-make-ml.sh default the listtext dir to where they were + installed in the system (Stephan Kulow) 1.2.1 o Introduce switches to turn off mails about posts being denied. 1.2.0 diff -r bc7ed828388d -r 0c96f9bb3162 configure.ac --- a/configure.ac Sat Jan 29 00:02:29 2005 +1100 +++ b/configure.ac Sat Jan 29 00:03:55 2005 +1100 @@ -24,6 +24,14 @@ AC_C_CONST AC_TYPE_SIZE_T +savex=$exec_prefix +test "x$exec_prefix" = xNONE && exec_prefix=$prefix +tmp=$datadir/$PACKAGE/text.skel +while textlibdir=`eval echo "$tmp"`; test "x$textlibdir" != "x$tmp"; do tmp=$textlibdir; done +exec_prefix=$savex + +AC_SUBST(textlibdir) + # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([ftruncate memset socket strerror strncasecmp snprintf fcntl]) @@ -31,5 +39,6 @@ AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([src/Makefile]) +AC_CONFIG_FILES([src/mlmmj-make-ml.sh]) AC_CONFIG_FILES([listtexts/Makefile]) AC_OUTPUT diff -r bc7ed828388d -r 0c96f9bb3162 listtexts/Makefile.am --- a/listtexts/Makefile.am Sat Jan 29 00:02:29 2005 +1100 +++ b/listtexts/Makefile.am Sat Jan 29 00:03:55 2005 +1100 @@ -1,6 +1,5 @@ ## Process this file with automake to produce Makefile.in -textlibdir = $(pkgdatadir)/text.skel dist_textlib_DATA = access bounce-probe listhelp moderation notifysub \ notifysub-digest notifysub-nomail notifyunsub notifyunsub-digest \ notifyunsub-nomail notintocc sub-confirm sub-confirm-digest \ diff -r bc7ed828388d -r 0c96f9bb3162 src/mlmmj-make-ml.sh --- a/src/mlmmj-make-ml.sh Sat Jan 29 00:02:29 2005 +1100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -#!/bin/sh -# -# mlmmj-make-ml.sh - henne@hennevogel.de -# - -VERSION="0.1" -DEFAULTDIR="/var/spool/mlmmj" - -USAGE="mlmmj-make-ml "$VERSION" -"$0" [OPTIONS] - --h display this help text --L the name of the mailinglist --s your spool directory if not "$DEFAULTDIR" --a create the needed entrys in your /etc/aliases file --z nuffn for now --c chown the spool dir" - -while getopts ":hL:s:azc:" Option -do -case "$Option" in - h ) - echo -e "$USAGE" - exit 0 - ;; - z ) - echo -n "nothing" - exit 0 - ;; - L ) - LISTNAME="$OPTARG" - ;; - s ) - SPOOLDIR="$OPTARG" - ;; - a ) - A_CREATE="YES" - ;; - c ) - DO_CHOWN=1 - CHOWN="$OPTARG" - ;; - * ) - echo -e "$0: invalid option\nTry $0 -h for more information." - exit 1 -esac -done -let SHIFTVAL=$OPTIND-1 -shift $SHIFTVAL - -if [ -z "$SPOOLDIR" ]; then - SPOOLDIR="$DEFAULTDIR" -fi - -echo "Creating Directorys below $SPOOLDIR. Use '-s spooldir' to change" - -if [ -z "$LISTNAME" ]; then - echo -n "What should the name of the Mailinglist be? [mlmmj-test] : " - read LISTNAME - if [ -z "$LISTNAME" ]; then - LISTNAME="mlmmj-test" - fi -fi - -LISTDIR="$SPOOLDIR/$LISTNAME" - -mkdir -p $LISTDIR - -for DIR in incoming queue queue/discarded archive text subconf unsubconf \ - bounce control moderation subscribers.d digesters.d requeue \ - nomailsubs.d -do - mkdir "$LISTDIR"/"$DIR" -done - -test -f "$LISTDIR"/index || touch "$LISTDIR"/index - -echo -n "The Domain for the List? [] : " -read FQDN -if [ -z "$FQDN" ]; then - FQDN=`domainname` -fi - -echo -n "The emailaddress of the list owner? [postmaster] : " -read OWNER -if [ -z "$OWNER" ]; then - OWNER="postmaster" -fi -echo "$OWNER" > "$LISTDIR"/"control/owner" - -echo -n "The path to texts for the list? (listtexts/ dir in the src) [] : " -read TEXTPATH -if [ -z "$TEXTPATH" -o ! -d "$TEXTPATH" ]; then - echo "**NOTE** Could not copy the texts for the list" - echo "Please manually copy the files from the listtexts/ directory" - echo "in the source distribution of mlmmj." -else - cp "$TEXTPATH"/* "$LISTDIR"/"text" -fi - -LISTADDRESS="$LISTNAME@$FQDN" -echo "$LISTADDRESS" > "$LISTDIR"/control/"listaddress" - -MLMMJRECIEVE=`which mlmmj-recieve 2>/dev/null` -if [ -z "$MLMMJRECIEVE" ]; then - MLMMJRECIEVE="/path/to/mlmmj-recieve" -fi - -MLMMJMAINTD=`which mlmmj-maintd 2>/dev/null` -if [ -z "$MLMMJMAINTD" ]; then - MLMMJMAINTD="/path/to/mlmmj-maintd" -fi - -ALIAS="$LISTNAME: \"|$MLMMJRECIEVE -L $SPOOLDIR/$LISTNAME/\"" -CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -F -L $SPOOLDIR/$LISTNAME/\"" - -if [ -n "$A_CREATE" ]; then - echo "I want to add the following to your /etc/aliases file:" - echo "$ALIAS" - - echo -n "is this ok? [y/N] : " - read OKIDOKI - case $OKIDOKI in - y|Y) - echo "$ALIAS" >> /etc/aliases - ;; - n|N) - exit 0 - ;; - *) - echo "Options was: y, Y, n or N" - esac -else - echo - echo "Don't forget to add this to /etc/aliases:" - echo "$ALIAS" -fi - -if [ "$DO_CHOWN" ] ; then - echo - echo -n "chown -R $CHOWN $SPOOLDIR/$LISTNAME? [y/n]: " - read OKIDOKI - case $OKIDOKI in - y|Y) - chown -R $CHOWN $SPOOLDIR/$LISTNAME - ;; - n|N) - exit 0 - ;; - *) - echo "option is: y, Y, n, N" - ;; - esac -fi - -echo -echo "If you're not starting mlmmj-maintd in daemon mode," -echo "don't forget to add this to your crontab:" -echo "$CRONENTRY" - -echo -echo " ** FINAL NOTES ** -1) The mailinglist directory have to be owned by the user running the -mailserver (i.e. starting the binaries to work the list) -2) Run newaliases" diff -r bc7ed828388d -r 0c96f9bb3162 src/mlmmj-make-ml.sh.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mlmmj-make-ml.sh.in Sat Jan 29 00:03:55 2005 +1100 @@ -0,0 +1,167 @@ +#!/bin/sh +# +# mlmmj-make-ml.sh - henne@hennevogel.de +# + +VERSION="0.1" +DEFAULTDIR="/var/spool/mlmmj" + +USAGE="mlmmj-make-ml "$VERSION" +"$0" [OPTIONS] + +-h display this help text +-L the name of the mailinglist +-s your spool directory if not "$DEFAULTDIR" +-a create the needed entrys in your /etc/aliases file +-z nuffn for now +-c chown the spool dir" + +while getopts ":hL:s:azc:" Option +do +case "$Option" in + h ) + echo -e "$USAGE" + exit 0 + ;; + z ) + echo -n "nothing" + exit 0 + ;; + L ) + LISTNAME="$OPTARG" + ;; + s ) + SPOOLDIR="$OPTARG" + ;; + a ) + A_CREATE="YES" + ;; + c ) + DO_CHOWN=1 + CHOWN="$OPTARG" + ;; + * ) + echo -e "$0: invalid option\nTry $0 -h for more information." + exit 1 +esac +done +let SHIFTVAL=$OPTIND-1 +shift $SHIFTVAL + +if [ -z "$SPOOLDIR" ]; then + SPOOLDIR="$DEFAULTDIR" +fi + +echo "Creating Directorys below $SPOOLDIR. Use '-s spooldir' to change" + +if [ -z "$LISTNAME" ]; then + echo -n "What should the name of the Mailinglist be? [mlmmj-test] : " + read LISTNAME + if [ -z "$LISTNAME" ]; then + LISTNAME="mlmmj-test" + fi +fi + +LISTDIR="$SPOOLDIR/$LISTNAME" + +mkdir -p $LISTDIR + +for DIR in incoming queue queue/discarded archive text subconf unsubconf \ + bounce control moderation subscribers.d digesters.d requeue \ + nomailsubs.d +do + mkdir "$LISTDIR"/"$DIR" +done + +test -f "$LISTDIR"/index || touch "$LISTDIR"/index + +echo -n "The Domain for the List? [] : " +read FQDN +if [ -z "$FQDN" ]; then + FQDN=`domainname` +fi + +echo -n "The emailaddress of the list owner? [postmaster] : " +read OWNER +if [ -z "$OWNER" ]; then + OWNER="postmaster" +fi +echo "$OWNER" > "$LISTDIR"/"control/owner" + +TEXTPATH=@textlibdir@ +echo -n "The path to texts for the list? [$TEXTPATH] : " +read TEXTPATHIN +test TEXTPATHIN && TEXTPATH=$TEXTPATHIN +if [ -z "$TEXTPATHIN" -o ! -d "$TEXTPATH" ]; then + echo "**NOTE** Could not copy the texts for the list" + echo "Please manually copy the files from the listtexts/ directory" + echo "in the source distribution of mlmmj." +else + cp "$TEXTPATH"/* "$LISTDIR"/"text" +fi + +LISTADDRESS="$LISTNAME@$FQDN" +echo "$LISTADDRESS" > "$LISTDIR"/control/"listaddress" + +MLMMJRECIEVE=`which mlmmj-recieve 2>/dev/null` +if [ -z "$MLMMJRECIEVE" ]; then + MLMMJRECIEVE="/path/to/mlmmj-recieve" +fi + +MLMMJMAINTD=`which mlmmj-maintd 2>/dev/null` +if [ -z "$MLMMJMAINTD" ]; then + MLMMJMAINTD="/path/to/mlmmj-maintd" +fi + +ALIAS="$LISTNAME: \"|$MLMMJRECIEVE -L $SPOOLDIR/$LISTNAME/\"" +CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -F -L $SPOOLDIR/$LISTNAME/\"" + +if [ -n "$A_CREATE" ]; then + echo "I want to add the following to your /etc/aliases file:" + echo "$ALIAS" + + echo -n "is this ok? [y/N] : " + read OKIDOKI + case $OKIDOKI in + y|Y) + echo "$ALIAS" >> /etc/aliases + ;; + n|N) + exit 0 + ;; + *) + echo "Options was: y, Y, n or N" + esac +else + echo + echo "Don't forget to add this to /etc/aliases:" + echo "$ALIAS" +fi + +if [ "$DO_CHOWN" ] ; then + echo + echo -n "chown -R $CHOWN $SPOOLDIR/$LISTNAME? [y/n]: " + read OKIDOKI + case $OKIDOKI in + y|Y) + chown -R $CHOWN $SPOOLDIR/$LISTNAME + ;; + n|N) + exit 0 + ;; + *) + echo "option is: y, Y, n, N" + ;; + esac +fi + +echo +echo "If you're not starting mlmmj-maintd in daemon mode," +echo "don't forget to add this to your crontab:" +echo "$CRONENTRY" + +echo +echo " ** FINAL NOTES ** +1) The mailinglist directory have to be owned by the user running the +mailserver (i.e. starting the binaries to work the list) +2) Run newaliases"