diff options
author | Tuan Van <langthang@gentoo.org> | 2006-07-20 01:27:05 +0000 |
---|---|---|
committer | Tuan Van <langthang@gentoo.org> | 2006-07-20 01:27:05 +0000 |
commit | 145bc8b15713aff99c124971abf798b8e9158ba7 (patch) | |
tree | d3edfb74f3deec44594e9cd5dcc832e516913427 /mail-filter | |
parent | Version bump. (diff) | |
download | historical-145bc8b15713aff99c124971abf798b8e9158ba7.tar.gz historical-145bc8b15713aff99c124971abf798b8e9158ba7.tar.bz2 historical-145bc8b15713aff99c124971abf798b8e9158ba7.zip |
add some sanity checking
Package-Manager: portage-2.1.1_pre3-r1
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/dk-milter/ChangeLog | 5 | ||||
-rw-r--r-- | mail-filter/dk-milter/Manifest | 22 | ||||
-rwxr-xr-x | mail-filter/dk-milter/files/dk-filter.init | 79 |
3 files changed, 93 insertions, 13 deletions
diff --git a/mail-filter/dk-milter/ChangeLog b/mail-filter/dk-milter/ChangeLog index 728cd8091935..d7bc107e0d4f 100644 --- a/mail-filter/dk-milter/ChangeLog +++ b/mail-filter/dk-milter/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for mail-filter/dk-filter # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.6 2006/07/18 00:55:38 langthang Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.7 2006/07/20 01:27:05 langthang Exp $ + + 20 Jul 2006; Tuấn Văn <langthang@gentoo.org> files/dk-filter.init: + add some sanity checking. 18 Jul 2006; Tuấn Văn <langthang@gentoo.org> +files/dk-milter-0.4.1-queueID.patch, files/dk-filter.conf, diff --git a/mail-filter/dk-milter/Manifest b/mail-filter/dk-milter/Manifest index 2185c52dabb2..f35cbd75ebdd 100644 --- a/mail-filter/dk-milter/Manifest +++ b/mail-filter/dk-milter/Manifest @@ -5,10 +5,10 @@ AUX dk-filter.conf 348 RMD160 9baf59301425d75deb21f3b4942a537e3fefed58 SHA1 0e61 MD5 45034b9900e8c80c690ec3b8979c66c8 files/dk-filter.conf 348 RMD160 9baf59301425d75deb21f3b4942a537e3fefed58 files/dk-filter.conf 348 SHA256 4cb330d1e58034b372fab33727287f7352c66e211f53ad9911381f453637e70c files/dk-filter.conf 348 -AUX dk-filter.init 558 RMD160 682ead5f1d84cd98b1d558fa00ced822b05800d9 SHA1 35ced94347f2b02170936d257ec183d01748fa6f SHA256 476680b18b84ce8b0aa5713d117181de697914cde6753bfef2d06b1c0addd9ec -MD5 85db92d2ce24075f6cf1d0cc611c2c0e files/dk-filter.init 558 -RMD160 682ead5f1d84cd98b1d558fa00ced822b05800d9 files/dk-filter.init 558 -SHA256 476680b18b84ce8b0aa5713d117181de697914cde6753bfef2d06b1c0addd9ec files/dk-filter.init 558 +AUX dk-filter.init 1954 RMD160 b4967db9e283bb31cef96a5bb40e19e0680beca4 SHA1 17c254d9e5f98feb0721215b6af3c14e0f52c58a SHA256 fc2243d8b275c4ffe78f06556b972e0e09753e9676e8d13b5a7f57e292759df5 +MD5 5e5325136196e4922faecbc0eaabd1bc files/dk-filter.init 1954 +RMD160 b4967db9e283bb31cef96a5bb40e19e0680beca4 files/dk-filter.init 1954 +SHA256 fc2243d8b275c4ffe78f06556b972e0e09753e9676e8d13b5a7f57e292759df5 files/dk-filter.init 1954 AUX dk-milter-0.4.1-queueID.patch 547 RMD160 a189b7098a47b7fc8451a29c99ec49cfcf16fbed SHA1 ba7227a8529220093752952f16db5c8714bb90cd SHA256 b0ef0f941644dc8c02bcaf845ba51112b08e2f605a5f7b9dc07d1930c8d59fe2 MD5 bdc8199b16d38d4b48a3e9f7a62f15e7 files/dk-milter-0.4.1-queueID.patch 547 RMD160 a189b7098a47b7fc8451a29c99ec49cfcf16fbed files/dk-milter-0.4.1-queueID.patch 547 @@ -26,10 +26,10 @@ EBUILD dk-milter-0.4.1.ebuild 1773 RMD160 9139c45c7d8988e36765a67bc6e1765624dc73 MD5 5d57c07c0aa5971286e38a8f5a712252 dk-milter-0.4.1.ebuild 1773 RMD160 9139c45c7d8988e36765a67bc6e1765624dc7394 dk-milter-0.4.1.ebuild 1773 SHA256 099ede631aa5a8200363732e7c5f9f585c3b0a71748f93fb1472f4a198daa961 dk-milter-0.4.1.ebuild 1773 -MISC ChangeLog 1071 RMD160 fed1c564b3a01a8493c3702b3ca377bed70d06ab SHA1 2ad1d1492b19a2159b7657c7e2d91301a6f45932 SHA256 7af1a162a5c62cc838f204a294a1260eccf756e524ff78bd61384059c0ef7758 -MD5 15bf8385d2a9879f8cc39089c2f6c2a5 ChangeLog 1071 -RMD160 fed1c564b3a01a8493c3702b3ca377bed70d06ab ChangeLog 1071 -SHA256 7af1a162a5c62cc838f204a294a1260eccf756e524ff78bd61384059c0ef7758 ChangeLog 1071 +MISC ChangeLog 1172 RMD160 03f695859671661e443cadf8988d64e57591c9fe SHA1 dbd704e3e40e26ae7564efb53183a13e05104468 SHA256 4a1e9faa187bf88a71f868bfa7a4b75bdc646b6731ba5d4747b3edc80bdc2500 +MD5 8260fb63fcf5b60744d4ba68f1990f4b ChangeLog 1172 +RMD160 03f695859671661e443cadf8988d64e57591c9fe ChangeLog 1172 +SHA256 4a1e9faa187bf88a71f868bfa7a4b75bdc646b6731ba5d4747b3edc80bdc2500 ChangeLog 1172 MISC metadata.xml 221 RMD160 3f13d342b35e471ab3bc6d5b6a491918688ea452 SHA1 1e4ce4ec962e1bae402fdce6f17a1729e1efb4e2 SHA256 9d7907404731a8635f1fb42c8901da3d996aa936fd23e67159a38cf48bb90e0f MD5 f1c604a8eaa7929364a593541a1d0efe metadata.xml 221 RMD160 3f13d342b35e471ab3bc6d5b6a491918688ea452 metadata.xml 221 @@ -40,7 +40,7 @@ SHA256 c0900a35c0e5850dab80dc2fce630a792b9dea6116f7cd3232f4b842fa8107e0 files/di -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) -iD8DBQFEvDGf5FrxP71izLARApIPAKCciReF0vFhGOViaKtiiBetSVyjigCdGCsM -ycIX3sMABHIxQs9lbZX/vVQ= -=Ih/j +iD8DBQFEvtv85FrxP71izLARAhC+AKCX6Jbg3eXhVqP1pt8r9sH2NHeQXwCg16ei +5x70wV6J26KtKFQkiz6w4wI= +=jTzy -----END PGP SIGNATURE----- diff --git a/mail-filter/dk-milter/files/dk-filter.init b/mail-filter/dk-milter/files/dk-filter.init index 85b50b842f3f..e61117ce5189 100755 --- a/mail-filter/dk-milter/files/dk-filter.init +++ b/mail-filter/dk-milter/files/dk-filter.init @@ -1,14 +1,91 @@ #!/sbin/runscript # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/files/dk-filter.init,v 1.2 2006/07/18 00:55:38 langthang Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/files/dk-filter.init,v 1.3 2006/07/20 01:27:05 langthang Exp $ depend() { # need net use dns logger net } +warn_msg() { + echo + ewarn "$1 parameter is not set!" + ewarn "dk-filter starts with" + ewarn "$1=${!1}" + ewarn "please set it in /etc/conf.d/dk-filter" + echo +} + +die_msg() { + echo + eerror "please set paramter $1 in" + eerror "/etc/conf.d/dk-filter then start again" + echo +} + +check_cfg() { + + if [[ ! -f /etc/conf.d/dk-filter ]] ; then + eerror "/etc/conf.d/dk-filter is missing" + return 1 + fi + + source /etc/conf.d/dk-filter || { + eerror "Prolem sourcing /etc/conf.d/dk-filter" + eerror "Please correct them then start dk-filter again" + return 1 + } + + if [[ -z "${DK_FILTER_OPTS}" ]] ; then + die_msg DK_FILTER_OPTS + return 1 + fi + + if [[ -z "${SELECTOR}" ]] ; then + die_msg SELECTOR + return 1 + fi + + if [[ -z "${KEYPATH}" ]] ; then + die_msg KEYPATH + return 1 + fi + + if [[ ! -f "${KEYPATH}" ]] ; then + echo + eerror "run gentxt.sh to generate a private key first" + eerror "then set KEYPATH in /etc/conf.d/dk-filter to" + eerror "the location of your private key" + echo + return 1 + fi + + if [[ -z "${SOCKETSPEC}" ]] ; then + SOCKETSPEC="inet:8025@localhost" + warn_msg SOCKETSPEC + fi + + if [[ -z "${DOMAIN}" ]] ; then + DOMAIN=$(domainname) + warn_msg DOMAIN + fi + + if [[ -z "${CANON}" ]] ; then + CANON="simple" + warn_msg CANON + fi + + if [[ -z "${CANON}" ]] ; then + USER="milter" + warn_msg USER + fi + + source /etc/conf.d/dk-filter +} start() { + check_cfg || return 1 + einfo "DK_FILTER_OPTS: $DK_FILTER_OPTS" ebegin "Starting DomainKeys Filter" start-stop-daemon --start --quiet --background \ --exec /usr/bin/dk-filter -- ${DK_FILTER_OPTS} |