diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-02-05 14:45:46 +0200 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-02-05 17:12:12 +0200 |
commit | dafda3033bd7b663e150393a8f75e4a0a8e12e27 (patch) | |
tree | 142ee3350c654270fb9232b9e8f109f93549c0e9 | |
parent | 5c8390ff842cf7741493f3282e935bc36ff9ad7e (diff) | |
download | aiaiai-dafda3033bd7b663e150393a8f75e4a0a8e12e27.tar.gz |
email-test-patchset: minor re-structuring
This is another minor clean-up. Let's fetch all the headers we need in one
place. Just for better readability.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rwxr-xr-x | email/aiaiai-email-test-patchset | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/email/aiaiai-email-test-patchset b/email/aiaiai-email-test-patchset index 040e5d7..dc93150 100755 --- a/email/aiaiai-email-test-patchset +++ b/email/aiaiai-email-test-patchset @@ -278,6 +278,13 @@ fi 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)\"" @@ -291,14 +298,6 @@ tmpdir="$(mktemp --tmpdir="$cfg_workdir" -dt "$PROG.XXXX")" 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")" |