Students mailed me their homework as attachments. My current strategy is something like “munpack /path/to/maildir/cur/*” to extract all the attachments.
But: Smalltalk outputs its code with CR (no LF) ending lines. Some of the extracted files are lacking any CRs or LFs. Weirder, mutt (in its inline attachment viewer) shows the CRs (as “^M”).
It seems to only happen for attachments that are text/plain, encoding base64, but not for all of them (...?!).
Which piece do I blame?
I can manually export them one by one, but how many will that be?
for i in *; do grep '^M' $i >/dev/null || echo $i; done | wc -l