Skip to content

Instantly share code, notes, and snippets.

@nakal
Created September 11, 2015 09:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nakal/87195dd29f25bccffb05 to your computer and use it in GitHub Desktop.
Save nakal/87195dd29f25bccffb05 to your computer and use it in GitHub Desktop.
Split a single MBOX into many small email files
# generates mails 1.eml, 2.eml,... from a single mbox file
# when (e.g.) procmailrc is flawed and everything was delivered
# locally
#
# then you can feed these files into the LDA one-by-one
awk '/^From / {nr += 1; getline }; { print $0 >> ( nr".eml" ) }' /var/mail/$USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment