Comparing above mail files to what I have on my systems, the first is an "mbox" type mail, while the second seems to be or already have been converted to "thunderbird" format.
Did you try to make thunderbird read them directly?
Thanks so much for the assistance. I really appreciate the fact that your help will allow me to change mail clients again, (which is why I'm doing the conversion to mbox finally), and not lose the last couple of years of emails.
For an initial quick response, the files are email messages stored individually as separate files in a maildir hierarchy. While they are appended with the extension .eml usually in a Microsoft windows environment, in my hierarchy they're stored as files with filenames that are a string of numbers with no extension.
When I edited the first find commands that Derek suggested to search for all files, (removed the EeMmLl), it did indeed locate, and then later count, all affected files. Additionally while I originally thought I should remove the > character from the actual From header line, I found out that the conversion program works whether the > character is there or not. The important part is the removal of the first From line, (mbox postmark), when it exists. I appreciate your suggestion though of removing the > character from the actual From line, and will look to use that as well.
Finally, Rudi, the example headers I posted are pulled from two separate EML files in my hierarchy. They're not in an mbox file, (which is basically a single file with contains a number of email messages).
Thanks all,
Jason
---------- Post updated at 02:08 PM ---------- Previous update was at 08:58 AM ----------
Thanks again Don and Derek. I ended up using Don's shell script, and editing the find filename parameters to;
I ran it from the top level maildir subdirectory, and it worked perfectly, finding every file with an mbox postmark in my maildir hierarchy, displaying the filename, counting the file, and then deleting the mbox postmark from the affected file.
Total 'bad' eml files discovered, and cleaned of mbox postmark; 14,473
Thanks again Don and Derek. I ended up using Don's shell script, and editing the find filename parameters to;
I ran it from the top level maildir subdirectory, and it worked perfectly, finding every file with an mbox postmark in my maildir hierarchy, displaying the filename, counting the file, and then deleting the mbox postmark from the affected file.
Total 'bad' eml files discovered, and cleaned of mbox postmark; 14,473
Thanks very much to both of you!
Jason
Jason,
I'm very glad you were able to get my script to work for you. For future reference note that:
will produce exactly the same output as:
since the -name pattern * will match every file.
This User Gave Thanks to Don Cragun For This Post:
One last thing. Based on Derek's suggestion and his find one liners, is it possible to add to your shell script a function to replace all lines that begin with
with
I'm not sure that is having an effect on this conversion, but I think it would be useful to clean things up from that perspective.
In traditional mbox format mail files, mail body lines starting with From are converted by software submitting messages to the mailer daemons to >From to keep it from being misinterpreted as a message boundary. Assuming that the lines you really want to convert are headers that start with >From and contain an email address (i.e. something containing an @ as in user@company.com), the following, in addition to what it did before, will remove the > from the start of a line that starts with >From and contains an @:
If you really want to remove the > from every line containing >From , change the global substitute line above to:
This User Gave Thanks to Don Cragun For This Post:
I have a test file with the following format, It contains the username_date when the user was locked from the database.
$ cat lockedusers.txt
TEST1_21062016
TEST2_02122015
TEST3_01032016
TEST4_01042016
I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Hi,
I would like have a shell script to check every line in a file to see if it ends with ";". If this is NOT the last character ";" should be added.
MyFile.csv :
web9331801;01/01/2014 23:39:35;;"93962";353150256;
web9331802;01/01/2014 23:44:29;;"479288";353153538;
web9331803;01/01/2014... (14 Replies)
Dear All,
I have a file like:
If $4=2001, a duplicated line will be inserted and $4 will be assigned value 2011; so that the new file would be:
How to write awk to accomplish this? thank you very much! (5 Replies)
Hi All,
I have a file as below:
cat myfile
abcdef
NA
rwer
tyujkl
na
I wish to add the text ".txt" at the end of all lines except the lines starting with NA or na.
I know i can add text at the end of line using following command but I am not sure how to valiate the condition. (14 Replies)
Hi,
I am having 2 servers, Need to delete files from server1 if those files exist in server2 other wise no action using sftp .And the process is non-interactive way. I have got confused how to check the condition in sftp because there is non of the shell condition or loop command is executing.... (2 Replies)
Hi All,
I have 5000 records like this
Request_id|Type|Status|Priority|Ticket Submitted Date and Time|Actual Resolved Date and Time|Current Ticket Owner Group|Case final Ticket Owner Group|Customer Severity|Reported Symptom/Request|Component|Hot Topic|Reason for Missed SLA|Current Ticket... (2 Replies)
Hi All,
I had a file called Input.txt, i need to group up in a single line as 1=ttt and the no of lines may vary bewteen the 1=ttt
cat Input.txt
1=ttt,2=xxxxxx, 3=4545
44545, 4=66667
7777, 5=77723
1=ttt, 2=xxxxxx, 3=34436 66
3545, 4=66666, 5=ffffff, 6=uuuuuuu
1=ttt, 2=xxxxxx,... (4 Replies)
Hello,
I have many csv file, but I would like to delete lines with some values in a column conditionally.
My example look like this,
ex1e, ex2g, ex39, pasg, ssg, mrlc, pc, kb, coop
-112, -53, -177, 64, 62, 71, 1, 487, 20
-101, -61, -53, 0, 32767, 51, 0, ... (6 Replies)