summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsammleEmails36
1 files changed, 36 insertions, 0 deletions
diff --git a/sammleEmails b/sammleEmails
new file mode 100755
index 0000000..4aba3e7
--- /dev/null
+++ b/sammleEmails
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+quelle="$1"
+[ -z "${quelle}" ] && quelle=~/.thunderbird/xguz6fup.default/ImapMail/imap.gmx.net/INBOX
+
+grep '^\($\|From\|[-a-zA-Z0-9.]\+: \)' "${quelle}" | \
+ grep -vi '^\(X-[-a-zA-Z]\+\|Bounces-to\|Content-Id\|Message-Id\|References\|In-Reply-To\|Return-Path\):' | \
+ while read -r s
+ do
+ [[ "$s" = 'From - '* ]] && \
+ sammle=true
+ [ -z "$s" ] && \
+ sammle=false
+ $sammle && \
+ echo "$s"
+ done | \
+ tr ' <>;()":,' '\n' | \
+ grep -v '^#' | \
+ sed 's|?.*$||; s|\(@.*\)@.*$|\1|' | \
+ grep -v '\[[0-9]\+\.' | \
+ grep -vi bounce | \
+ tr '[]' '\n' | \
+ sed 's|^\s\+||; s|\s\+$||' | \
+ sed 's@=\(20\|0A\|5F\|3D\)@\n@g' | \
+ sed 's@^\(envelope-from\|header\.i\|news\|service\)=@\n@' | \
+ sed 's|&gt$||' | \
+ tr "'"'%# `|/' '\n' | \
+ grep -v '=' | \
+ grep '.\+@.\+\..\+' | \
+ pv --line-mode | \
+ sort -fu | \
+ while read -r s
+ do
+ seq -s' ' 100 | \
+ gpg --search-keys "$s"
+ done