Skip to contentSkip to conversation

bug report: don't force your /etc/aliases on me! :)

PATCH Kurt Lieber 2 participants 2 messages Nov 4, 2004

lore
Share & tools
lore
#0 lore raw

I was just perusing mlmmj-make-ml.sh and realized it expects the alias file to be at /etc/aliases. By default, Gentoo places this file in /etc/mail/aliases and I imagine other distros may place it elsewhere. I've attached a patch that *should* handle this more gracefully -- I've tested it on our system, but additional testing (and feedback) is welcome.

If I can find some time in the next week or so, I'll take a crack at re-writing mlmmj-make-ml.sh to add in the /etc/skel features I asked about previously.

--kurt

mlmmj-make-ml.gentoo.sh 2004-11-04 17:36:21.000000000 +0000 renamed from mlmmj-make-ml.sh 2004-11-04 17:37:14.000000000 +0000 +12 -3
@@ -114,15 +114,24 @@
 ALIAS="$LISTNAME:  \"|$MLMMJRECIEVE -L $SPOOLDIR/$LISTNAME/\""
 CRONENTRY="0 */2 * * * \"$MLMMJMAINTD -F -L $SPOOLDIR/$LISTNAME/\""
 
+ALIASFILE="/etc/aliases"
+function ask_aliasfile {
+       echo "I can't find your mail alias file.  Please tell me where it is:"
+       read ALIASFILE
+}
+until [ -f $ALIASFILE ]; do
+    ask_aliasfile
+done
+
 if [ -n "$A_CREATE" ]; then
-       echo "I want to add the following to your /etc/aliases file:"
+       echo "I want to add the following to your $ALIASFILE file:"
        echo "$ALIAS"
 
        echo -n "is this ok? [y/N] : "
        read OKIDOKI
        case $OKIDOKI in
                y|Y)
-               echo "$ALIAS" >> /etc/aliases
+               echo "$ALIAS" >> $ALIASFILE
                ;;
                n|N)
                exit 0
@@ -132,7 +141,7 @@
        esac
 else
        echo
-       echo "Don't forget to add this to /etc/aliases:"
+       echo "Don't forget to add this to $ALIASFILE:"
        echo "$ALIAS"
 fi
#1 lore raw
Quoted 5 lines · Kurt Lieber

I was just perusing mlmmj-make-ml.sh and realized it expects the alias file to be at /etc/aliases. By default, Gentoo places this file in /etc/mail/aliases and I imagine other distros may place it elsewhere. I've attached a patch that *should* handle this more gracefully -- I've tested it on our system, but additional testing (and feedback) is welcome.

Thnks, applied.

Quoted 3 lines

If I can find some time in the next week or so, I'll take a crack at re-writing mlmmj-make-ml.sh to add in the /etc/skel features I asked about previously.

Would be nice indeed!

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                -- A. P. J.