Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Script By Kris Occhipinti
- #GPLv3 September 11, 2015
- dir="$HOME/mail/<domain>/<mbox>/new/"
- for i in "`ls ${dir}*`"
- do
- pid="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
- address="$(grep "^Cc:" "$i"|grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b")"
- name="$(grep "^From:" "$i"|sed 's/ via /:/g'|cut -d\: -f2|sed "s/^[ \t]*//")"
- subject="$(grep '^Subject: \[Members\] ' "$i"|sed 's/Subject: \[Members\] //g')"
- body="$(sed '/Sender: "Members" /,/_____________________________/!d' "$i"|sed '1d; 2d; $d')"
- date="$(grep "^Date: " "$i"|cut -d\: -f2|sed "s/^[ \t]*//")"
- timestamp="$(date +%s)000"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement