to make this a bare remote or a local tree. Generally, aiaiai works best if
the tree is locally stored on the same machine as the aiaiai process.
+2.4 Aiaiai Hooks
+~~~~~~~~~~~~~~~~
+
+The [hooks] section can be used to specify scripts which are called by various
+aiaiai tools, and can be used to customize the behavior of aiaiai. This is
+generally done by modifying the mbox to include custom headers, which are
+detailed below.
+
+The two following headers are generally inserted by aiaiai-email-lda and most
+likely don't need to be inserted by a hook, but are included here for
+completeness.
+
+* X-Aiaiai-Cover-Letter-Subject
+ This is the subject of the 0/n email if one is given when sending a patch
+ series.
+* X-Aiaiai-Cover-Letter-Message-Id
+ This is the message Id of the 0/n email if one was given when sending a
+ patch series.
+
+The above two settings are used by aiaiai-email-test-patchset so that it can
+formulate a reply to the 0/n email instead of replying to the 1/n email of a
+patch series. This helps indicate that the entire patch series was validated,
+instead of appearing as though only the first patch was tested.
+
+2.4.1 Dispatcher Hook
+~~~~~~~~~~~~~~~~~~~~~
+
+The dispatcher hook is called by aiaiai-email-dispatcher-helper, and receives
+the mbox file as its first argument, and the cfgfile as its second argument. It
+should modify the mbox file inplace, to include any custom headers specified
+above.
# aiaiai will insert it for you.
built_preamble = I have tested your changes
+[hooks]
+ # A hook called by aiaiai-email-dispatcher-helper, which should insert
+ # custom headers into the mbox file. Specific documentation on this is
+ # provided in the doc/email section, including expected argument
+ # format, as well as what headers are recognized by other tools.
+ dispatcher =
+
# These options are probably not useful, but may help debug issues with aiaiai
[debug]
# Set to (1) to disable sending reply emails when a patch is tested.
queuedir="$(readlink -fv -- "$1")"; shift
cfgfile="$1"; shift
+# Parse the configuration file
+parse_config "$cfgfile"
+
tmpdir="$(mktemp -dt "$PROG.XXXX")"
+# Run the dispatcher hook
+if [ -n "$cfg_dispatch_hook" ]; then
+ hook="$(readlink -fv -- "$cfg_dispatch_hook")"
+ verbose "Running \"$hook\" on \"$mbox\""
+ $hook "$mbox" "$cfgfile"
+fi
+
verbose "Validating \"$mbox\", queue directory is: $queuedir"
verbose "Configuration file: $cfgfile"
ini_config_get_or_die cfg_signature "$cfgfile" "global" "signature"
ini_config_get_or_die cfg_built_preamble "$cfgfile" "global" "built_preamble"
+ # Hooks which can be used to enable custom behavior
+ cfg_dispatch_hook="$(ini_config_get "$cfgfile" "hooks" "dispatcher")"
+
# Debug options
cfg_disable_notifications="$(ini_config_get "$cfgfile" "debug" "disable_notifications")"
cfg_preserve_files="$(ini_config_get "$cfgfile" "debug" "preserve_files")"