chiark / gitweb /
probes: started feature
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Oct 2017 14:59:50 +0000 (15:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Oct 2017 14:59:50 +0000 (15:59 +0100)
probes/modrelays-probe

index 27c5545..ef7c639 100755 (executable)
@@ -32,6 +32,13 @@ record-probing () {
        mkdir -p $td
 }
 
+record-probing-start () {
+       record-probing "$@"
+       if ! [ -e "$td/started" ]; then
+               date -R >"$td/started"
+       fi
+}
+
 record-outcome () {
        local probeid=$1
        local outcome=$2
@@ -50,7 +57,7 @@ probe-addr () {
        local addr=$2
 
        local td
-       record-probing "mx=$mx,addr=$addr"
+       record-probing-start "mx=$mx,addr=$addr"
 
        set +e
        swaks   --to "${GROUP//./-}@$domain" \
@@ -104,7 +111,7 @@ probe-addr () {
 probe-domain () {
        local domain=$1
        local td
-       record-probing dns
+       record-probing-start dns
        
        set +e
        adnshost -Fi -Tn +Do +Dt -t mx $domain >$td/dns
@@ -242,6 +249,18 @@ Content-Transfer-Encoding: 7bit
 
 The moderation relay probe
   $info
+END
+
+       if [ -e "$attempt/started" ]; then
+               local started
+               read started <"$attempt/started"
+               cat >>"$email" <<END
+started at
+  $started
+END
+       fi
+
+       cat >>"$email" <<END
 resulted in the outcome
   $outcome
 END
@@ -274,6 +293,7 @@ END
 --$delim
 Content-Type: text/plain; charset="utf-8"
 Content-Disposition: inline; filename="${log##*/}"
+Content-Description: "${log##*/}"
 Content-Transfer-Encoding: 8bit
 
 END