]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
email-lda: start parsing the configuration file
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 29 Nov 2013 16:49:19 +0000 (18:49 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 29 Nov 2013 16:49:19 +0000 (18:49 +0200)
This is a preparation for the further changes where we teach the email-lda
script sending notifications when it rejects a patch. We'll need to know some
basic information like own e-mail address, and this is stored in the config
file. So parse it.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
email/aiaiai-email-lda

index dd789abc087217e62c2db0ee06b069cab6771ff5..472b0cb3831aa52798ec538cdcfd3663b9d966d9 100755 (executable)
@@ -30,7 +30,14 @@ yet complete patch series.
 Additionally, this program stores all the incoming mail in the
 "<workdir>/mail" mail archive.
 
+The "<config.ini>" file is the same file which "aiaiai-email-test-patchest"
+uses. When this program receives an invalid e-mail (not a patch, invalid
+subject, etc), it sends an e-mail notifications back. The "<config.ini>" file
+is required for extracting basic information for sending the notifications (own
+e-mail address, etc).
+
 <workdir>              - the working directory.
+<cfgfile.ini>          - the configuration file.
 
 Options:
       --reap-archive=MIN     remove all files created earlier than MIN
@@ -296,9 +303,12 @@ while true; do
        shift
 done
 
-[ "$#" -eq 1 ] || fatal "Insufficient or too many arguments"
+[ "$#" -eq 2 ] || fatal "Insufficient or too many arguments"
+
+workdir=$(readlink -fv -- "$1"); shift
+cfgfile=$(readlink -fv -- "$1"); shift
 
-workdir=$(readlink -fv -- "$1");
+parse_config "$cfgfile"
 
 lda_tmp="$workdir/lda_tmp"
 mkdir -p $verbose -- "$lda_tmp" >&2