diff options
Diffstat (limited to 'collect-tos-for-alpine-addressbook')
-rwxr-xr-x | collect-tos-for-alpine-addressbook | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/collect-tos-for-alpine-addressbook b/collect-tos-for-alpine-addressbook index aed5522..a2766ca 100755 --- a/collect-tos-for-alpine-addressbook +++ b/collect-tos-for-alpine-addressbook @@ -1,5 +1,32 @@ #!/bin/bash +decode() { + sed ' + :a + s/=?\(ISO-8859-15\?\|windows-1252\|UTF-8\)?Q?\([^=_]*\)?=/\2/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)_/\1 / + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=E4/\1ä/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=E9/\1é/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=F6/\1ö/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=F8/\1ř/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=FC/\1ü/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=FD/\1ý/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=DF/\1ß/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=22/\1"/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=2C/\1,/ + s/\(=?\(ISO-8859-15\?\|windows-1252\)?Q?[^=]*\)=2E/\1,/ + s/\(=?UTF-8?Q?[^=]*\)_/\1 / + s/\(=?UTF-8?Q?[^=]*\)=c3=a4/\1ä/ + s/\(=?UTF-8?Q?[^=]*\)=c3=b6/\1ö/ + s/\(=?UTF-8?Q?[^=]*\)=c3=bc/\1ü/ + s/\(=?UTF-8?Q?[^=]*\)=c3=9f/\1ß/ + s/\(=?UTF-8?Q?[^=]*\)=c3=98/\1ø/ + s/\(=?UTF-8?Q?[^=]*\)=22/\1"/ + s/\(=?UTF-8?Q?[^=]*\)=2c/\1,/ + ta + ' +} + sed ' :a N @@ -35,7 +62,8 @@ done \ "$( printf '%s\n' "${comment}" \ | base64 -d \ - | sed 's@^\(["'"'"']\)\(.*\)\1@\2@' + | sed 's@^\(["'"'"']\)\(.*\)\1@\2@' \ + | decode )" \ "${email}" done |