aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto>2006-10-12 19:22:33 +0000
committerrhatto <rhatto>2006-10-12 19:22:33 +0000
commit4585b123f563e2934545e3b5a5cd3fb1a0edaa66 (patch)
treec87e590bf86ba09f30befdcd1dabaddf8d0f7269
parenta87a96485569c92dd1f160200b0c9ae8308fc4c1 (diff)
downloadfirma-4585b123f563e2934545e3b5a5cd3fb1a0edaa66.tar.gz
firma-4585b123f563e2934545e3b5a5cd3fb1a0edaa66.tar.bz2
now all admin commands can be accessed via firma --help command
-rwxr-xr-xREADME64
-rwxr-xr-xfirma62
2 files changed, 81 insertions, 45 deletions
diff --git a/README b/README
index d203601..e6d6a7d 100755
--- a/README
+++ b/README
@@ -134,14 +134,14 @@ Setup
Firma installation is quite simple:
- 1 - create a folder to store lists; by default firma use /usr/local/etc/lists
+ 1 - Create a folder to store lists; by default firma use /usr/local/etc/lists
but you can use anything, just edit firma and change FIRMA_LIST_PATH
variable.
- 2 - copy firma script to whatever you like, e.g. /usr/local/bin and check that
+ 2 - Copy firma script to whatever you like, e.g. /usr/local/bin and check that
it has no write permission
- 3 - create a list-wide config file (default is /usr/local/etc/firma.conf) with
+ 3 - Create a list-wide config file (default is /usr/local/etc/firma.conf) with
the common definitions for all lists,
GPG_BINARY= path to the GnuPG binary
@@ -149,17 +149,17 @@ Setup
MAIL_AGENT_ARGS= command-line arguments to be passed to the command above
LISTS_DIR= path to the mailing lists directory
- all those variables can be overwritten at each list's own config file;
- firma.conf should be chmoded as 600, chowned nobody.nobdy or whatever
- user your MTA runs. If you run postfix, the user is specified by the
- main.cf parameter "default_privs".
+ All those variables can be overwritten at each list's own config file;
+ firma.conf should be chmoded as 600, chowned nobody.nobdy or whatever
+ user your MTA runs. If you run postfix, the user is specified by the
+ main.cf parameter "default_privs".
- we suggest you to use
+ We suggest you to use
MAIL_AGENT=/usr/sbin/sendmail
MAIL_AGENT_ARGS=-t
- as optional parameters, you can also set
+ As optional parameters, you can also set
USER= user that runs firma (usually the same as your MTA user);
defaults to "nobody"; you can also specify this parameter
@@ -191,23 +191,27 @@ Setup
KEYSERVER= default keyserver to import/export keys
(defaults to keyserver.noreply.org)
- 4 - then create your lists with the command
+ For a list of all config parameters, type
+
+ firma --help config
+
+ 4 - Then create your lists with the command
firma -c your-list
- this will ask some questions and create a gpg keyring and a config file
- with the following variables:
+ Then firma will ask some questions and create a gpg keyring and a config
+ file with the following variables:
LIST_ADDRESS= list's email address
LIST_ADMIN= list's administrators email addresses (space separated)
LIST_HOMEDIR= list's GnuPG homedir, where the list's keyrings are located
PASSPHRASE= passphrase for the list's private keyring
- then a gpg keypair and a config file are automatically generated;
+ Then a gpg keypair and a config file are automatically generated;
the owner of the config file and keyring should be nobody.nobody
(or the user your MTA run as) and its permissions must be 600.
- after it you can add some optional parameters on this list config file:
+ After that you can add some optional parameters on this list config file:
SUBJECT_PREFIX= prefix to be included in the subject of list messages
@@ -231,7 +235,11 @@ Setup
this doesnt affect the way email administration works,
when signature is mandatory
- 5 - create an alias to the list at your MTA; on sendmail or postfix,
+ For a list of all config parameters, type
+
+ firma --help config
+
+ 5 - Create an alias to the list at your MTA; on sendmail or postfix,
add this to your aliases file:
your-list: "| /usr/local/bin/firma -p your-list"
@@ -244,7 +252,7 @@ Setup
alternatively, you can use a virtual mailbox table if you want
to easily host a lot of encrypted mailing lists.
- 6 - admin tasks are performed through aliases like your-list-request@yourmachine
+ 6 - Admin tasks are performed through aliases like your-list-request@yourmachine
or via command-line:
firma -a your-list
@@ -267,14 +275,14 @@ Setup
uses the given address for message delivery instead
of the primary address of a subscribed key
- 7 - to subscribe and unsubscribe manually the users and the list admins on, use
+ 7 - To subscribe and unsubscribe manually the users and the list admins on, use
a command line like
gpg --homedir [path-to-your-list-keyring] --import < file
and be sure that after this command the list keyring is owned by nobody.nobody.
- 8 - send encrypted AND signed messages to your-list@yourmachine and look
+ 8 - Send encrypted AND signed messages to your-list@yourmachine and look
what happens :)
Tips
@@ -290,32 +298,32 @@ Design and features
Firma is simple but its simplicity doesn't reflect in lack of design.
- - uses a gpg keyring to store both the keys and the subscribers options
+ - Uses a gpg keyring to store both the keys and the subscribers options
- - command line is simple to avoid admin tasks resting in some .bash_history
+ - Command line is simple to avoid admin tasks resting in some .bash_history
- - non-pgp blocks in a message are discarded since we don't want to deal with
+ - Non-pgp blocks in a message are discarded since we don't want to deal with
unencrypted content
- - all unwanted email headers are striped as a privacy measure for who sends
+ - All unwanted email headers are striped as a privacy measure for who sends
the message
- - firma doesn't use any disk write when processing a message; no temp files
+ - Firma doesn't use any disk write when processing a message; no temp files
that may rest in the system; everything goes in memory (but take care,
sometimes it will use the swap and then is best to make it encrypted)
- - by default it doesn't archive messages in the server
+ - By default it doesn't archive messages in the server
- - by default it removes the Subject header and put it inside the encrypted
+ - By default it removes the Subject header and put it inside the encrypted
message, as Subject are outside the PGP/MIME context
- - messages appear to be sent To: Undisclosed Recipients
+ - Messages appear to be sent To: Undisclosed Recipients
Major features are:
- - keyring support
+ - Keyring support
- - administration through email or command-line
+ - Administration through email or command-line
8 - Caveats
diff --git a/firma b/firma
index 20ca56e..f1d2fd2 100755
--- a/firma
+++ b/firma
@@ -1095,6 +1095,7 @@ function ListAdministration {
quit quit this prompt
help show this help
list show list subscribers
+ config list configuration
info EMAIL-ADDRESS show info of a given subscriber
sendkey SUBSCRIBER send list pubkey to subscriber
subscribe [..] subscribe users ('subscribe help' for options)
@@ -1121,17 +1122,21 @@ function ListAdministration {
done
;;
subscribe)
- AdminLog "$1: missing arguments (try \"subscribe help\")"
+ AdminLog "$1: missing arguments (try \"$1 help\")"
return_code=1
;;
sendkey)
- AdminLog "$1: missing arguments (try \"sendkey help\")."
+ AdminLog "$1: missing arguments (try \"$1 help\")."
return_code=1
;;
info)
- AdminLog "$1: missing arguments (try \"info help\")."
+ AdminLog "$1: missing arguments (try \"help\")."
return_code=1
;;
+ config)
+ AdminLog "$1: missing arguments (try \"$1 help\")."
+ return_code=1
+ ;;
*)
AdminLog "Command not found -- $1 (try \"help\")"
return_code=1
@@ -1165,6 +1170,15 @@ function ListAdministration {
GetSubscribersInfo $2
return_code=$?
;;
+ config)
+ if [ "$2" == "help" ]; then
+ ConfigHelp
+ return_code=$?
+ else
+ AdminLog "$1: too many arguments -- $@ (try \"$1 help\")"
+ return_code=1
+ fi
+ ;;
help|quit)
AdminLog "$1: too many arguments -- $@ (try \"help\")"
return_code=1
@@ -1998,6 +2012,26 @@ function SourceListConfig {
REQUIRE_SIGNATURE="`EvalConfigParameter $LIST_CONFIG_FILE REQUIRE_SIGNATURE`"
}
+
+function ConfigHelp {
+ #-------------------------------------------------------------
+ # display help on configuration file parameters
+ #
+ # parameter(s): none
+ # depends on function(s): SourceFirmaConfig, SourceListConfig
+ # returns: 0
+ #-------------------------------------------------------------
+
+ echo "All firma parameters are passed through two different configuration files:"
+ echo "firma.conf, containing general parameters needed to run the script, and a list"
+ echo "specific file, containing its address, administrator(s), etc. In both files"
+ echo "you should enter PARAMETER='value' (with value between single quotes, without"
+ echo "spaces before or after the equal sign and nothing after the second quote)."
+
+ SourceFirmaConfig help
+ SourceListConfig help
+}
+
#-------------------------------------------------------------
# main()
#-------------------------------------------------------------
@@ -2079,7 +2113,8 @@ FUNCTIONS="
CreateMessageBodyPart
EvalConfigParameter
SourceFirmaConfig
- SourceListConfig"
+ SourceListConfig
+ ConfigHelp"
for VAR in $GLOBAL_VARS; do
declare $VAR
@@ -2209,19 +2244,12 @@ case $# in
# valid option called with too many arguments
-h|--help|-v|--version)
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
- if [ "$2" == "config" ]; then
- echo "All firma parameters are passed through two different configuration files:"
- echo "firma.conf, containing general parameters needed to run the script, and a list"
- echo "specific file, containing its address, administrator(s), etc. In both files"
- echo "you should enter PARAMETER='value' (without spaces before or after the equal sign)."
- SourceFirmaConfig help
- SourceListConfig help
- EXIT_CODE=0
- else
- echo >&2 "$(basename $0): too many arguments -- $@"
- Usage
- EXIT_CODE=1
- fi
+ ListAdministration $2 help
+ EXIT_CODE=$?
+ else
+ echo >&2 "$(basename $0): too many arguments -- $@"
+ Usage
+ EXIT_CODE=1
fi
;;
*)