--- /dev/null
+#!/bin/sh
+
+set -e
+
+PROG="$0"
+
+ciscowipe() {
+ # Remove secure-web.cisco.com prefix
+ sed -E "s!https?://secure-web.cisco.com/[^/ ]*/!!g" |
+ # URL decode
+ # Decodes all URL escape sequences
+ #sed -e 's!+! !g;s!%\([0-9A-Fa-f]\{2\}\)!\\x\1!g' | xargs -0 printf "%b"
+ # Decodes only some escape sequences, but leaves others, like spacs,
+ # as is.
+ sed 's!%3A!:!g;s!%2F!/!g;s!%3F!?!g;s!%3D!=!g;s!%26!\&!g'
+}
+
+usage() {
+ cat<<EOF
+Mr. Clean for Cisco's mail snakeoil. It restores the original URL from the URL
+generated by Cisco's mail security software.
+
+Usage:
+ $PROG -h
+ $PROG [FILE]...
+
+If no filename is given then stdin is processed. Otherwise all files passed are
+processed.
+EOF
+}
+
+if [ "$#" -eq 0 ]; then
+ ciscowipe
+else
+ for f in "$@"; do
+ if [ "$f" = "-h" ]; then
+ usage
+ exit
+ fi
+ cat "$f" | ciscowipe
+ done
+fi