Advertisement
metalx1000

Parse mbox mail files with Procmail Formail

Aug 15th, 2019
1,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. #Parsing mbox mail box files Procmail and Formail
  2. sudo apt install procmail
  3.  
  4. #Split mbox file into files
  5. cat inbox.mbox| formail -ds sh -c 'cat > msg.$FILENO'
  6.  
  7. #get subject
  8. cat msg.000|formail -subject
  9.  
  10. #loop through each file
  11. for i in msg*;do cat "$i"|formail -x subject -x To -x From;done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement