fetch_header_or_die subj "Subject" < "$mbox"
fetch_header_or_die from "From" < "$mbox"
fetch_header_or_die id "Message-Id" < "$mbox"
+to="$(fetch_header "To" < "$mbox")"
+cc="$(fetch_header "Cc" < "$mbox")"
+
+# Either "To:" or "Cc:" must exist
+if [ -z "$to" ] && [ -z "$cc" ]; then
+ die "Neither \"To:\" nor \"Cc:\" header found"
+fi
printf "\n"
verbose "Testing mbox: \"$from: $subj (Message-Id: $id)\""
mv $verbose -- "$mbox" "$tmpdir/mbox" >&2
mbox="$tmpdir/mbox"
-to="$(fetch_header "To" < "$mbox")"
-cc="$(fetch_header "Cc" < "$mbox")"
-
-# Either "To:" or "Cc:" must exist
-if [ -z "$to" ] && [ -z "$cc" ]; then
- die "Neither \"To:\" nor \"Cc:\" header found"
-fi
-
# Find out the project name
prj="$(fetch_project_name "$to" "$cfg_ownmail")"