Skip to content

Instantly share code, notes, and snippets.

@rikroe
Created March 4, 2019 20:36
Show Gist options
  • Save rikroe/a8de9e2c0581d5b4c8640f8196854995 to your computer and use it in GitHub Desktop.
Save rikroe/a8de9e2c0581d5b4c8640f8196854995 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ $# = 2 ]
then
i=$2
p=61902 # Change this - first free port
if [ $1 = "add" ]
then
echo Making links to $i in home directory...
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-admin
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-bounces
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-confirm
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-join
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-leave
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-owner
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-request
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-subscribe
echo "|/home/`whoami`/bin/qmail-lmtp $p 1" > ~/.qmail-$i-unsubscribe
elif [ $1 = "del" ]
then
echo "Removing qmail files for $i"
rm ~/.qmail-$i
rm ~/.qmail-$i-*
else
echo "Unkown parameters. Usage: mailman3-list [add, del] listname"
fi
else
echo "Unkown parameters. Usage: mailman3-list [add, del] listname"
fi
@rikroe
Copy link
Author

rikroe commented Mar 4, 2019

This shell script creates or deletes all necessary .qmail files for use with mailman3. Make sure to change p to your mailman's LMTP port and make the script executable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment