rspamd: add feature for adjusting options with a file parsed by DMS (#3059)

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
Georg Lauterbach 2023-02-19 12:36:43 +01:00 committed by GitHub
parent 40e10d755d
commit bee9e3627d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 448 additions and 95 deletions

View file

@ -54,15 +54,15 @@ function _send_mail_and_get_id() {
_send_email "${TEMPLATE_FILE}"
_wait_for_empty_mail_queue_in_container
# The unique ID Postfix (and other services) use may be different in length
# on different systems (e.g. amd64 (11) vs aarch64 (10)). Hence, we use a
# range to safely capture it.
MAIL_ID=$(_exec_in_container tac /var/log/mail.log \
| grep -E -m 1 'postfix/smtpd.*: [A-Z0-9]+: client=localhost' \
| grep -E -o '[A-Z0-9]{11}')
| grep -E -o '[A-Z0-9]{9,12}' || true)
if [[ -z ${MAIL_ID} ]]
then
echo 'Could not obtain mail ID - aborting!' >&2
exit 1
fi
run bash -c "-z ${MAIL_ID}"
assert_success 'Could not obtain mail ID - aborting!'
echo "${MAIL_ID}"
}