Skip to content

Instantly share code, notes, and snippets.

@nakal
Created Sep 11, 2015
Embed
What would you like to do?
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