+ s/^(Connecting to .* \.\.\. sending) \d+ (nonTFO early-data)$/$1 dd $2/;
+
+ if (/^([0-9: ]* # possible timestamp
+ Connecting\ to\ [^ ]+\ [^ ]+(\ from\ [^ ]+)?)\ \.\.\.
+ \ .*TFO\ mode\
+ (sendto,\ no\ data:\ EINPROGRESS # Linux
+ |connection\ attempt\ to\ [^,]+,\ 0\ data) # MacOS & no-support
+ $/x)
+ {
+ $_ = $1 . " ... " . <IN>;
+ s/^(.* \.\.\.) [0-9: ]*connected$/$1 connected/;
+
+ if (/^Connecting to .* \.\.\. connected$/)
+ {
+ $_ .= <IN>;
+ if (/^(Connecting to .* \.\.\. )connected\n\s+SMTP(\(close\)>>|\(Connection refused\)<<)$/)
+ {
+ $_ = $1 . "failed: Connection refused\n" . <IN>;
+ s/^(Connecting .*)\n\s+SMTP\(close\)>>$/$1/;
+ }
+ elsif (/^(Connecting to .* \.\.\. connected\n)read response data: size=/)
+ { $_ = $1; }
+
+ # Date/time in SMTP banner
+ s/[A-Z][a-z]{2},\s\d\d?\s[A-Z][a-z]{2}\s\d{4}\s\d\d\:\d\d:\d\d\s[-+]\d{4}
+ /Tue, 2 Mar 1999 09:44:33 +0000/gx;
+ }
+ }