summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-01-09 11:47:19 +0100
committerErich Eckner <git@eckner.net>2017-01-09 11:47:19 +0100
commit21a0006689c798cc9a4faa9179bd8f14d3169f37 (patch)
tree0d403bbfda361e8e67d12fe8f06b33d61d333ed6
downloadsammleEmails-21a0006689c798cc9a4faa9179bd8f14d3169f37.tar.xz
Initial commit
-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