I have been cleaning up old email files and in the process created a mess I have several mail directories containing emails from different times and collected under slightly different operating condition. I want to merge them into a single directory with the emails arranged in threads by topic and in chronological order. More detail follows:
I'm running Wheezy. I get my email from several places using fetchmail. My .fetchmailrc works. I type 'fetchmail' at an xterm command line whenever I want to get another batch of accumulate email, which is what I want to do. No, bell signaling arrival of mail interrupting some useful work for me. I have procmail configured to deliver email to several mbox format files, all in a directory whose name is ~/mail. I have about 60 delivery mbox files in ~/mail. Procmail also runs bogofilter for spam suppression. I read my email using Mutt. My problems with SMTP and Mutt from some time ago are solved. >From my investigations of other email arrangements I have accumulated other directories of email folders, mostly in mbox format, but also one in Maildir format. All these other email directories are also in my home directory (of course with different names ;). I want help to devise some command line that will read emails from one of these old directories and move copies into my current email directory. I think this can be done starting with cat and using formail and ending with procmail, but I'm getting a lot of emails that purport to come from foo@bar , which I know is because I've some formail options wrong. Here is an example of things I've tried: cat mail-20140812_004037/* | formail +1 -tzeds procmail I've renamed all the old email directories to contain a timestamp extension. The above shows one of them. I don't really understand +1, but a lot of email magic seems to have it. I'm hoping that this will feed the emails to procmail and it will process them as if they were coming from fetchmail, which I know works for currently arriving email. I know that many of the emails don't have a envelope From line, but I don't know how to get formail to pick out a string that can be made into a functional From line. My understanding is that the envelope From line is only used in routeing the email throug the internet and once it arrives at a destination the data in it is ignored in deference to the actual headers that contain a colon, and the text of the body. So, I guess I'm looking for a way to get emails that have missing parts to appear to be whole to formail and procmail. Only I don't really know what they look for or why. Suggestions? TIA -- Paul E Condon pecon...@mesanetworks.net -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/20140812213601.ga25...@big.lan.gnu