[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to deal with FOLDER INTERNAL DATA dummy message



Hello,

I've been looking for how to get around the problem that MHonArc
inserts a dummy message into the generated HTML mail archive. I use
MHonArc v2.4.4. I couldn't find any straight forward solutions in this
mail list - most of the solutions here dealt with using procmail/perl,
and seemed to require more programming experience than I could handle.
Below, I describe a way (maybe someone think it's a bit dirty, but
still it works), that uses a simple Unix script, and I hope this could
be handy for not so experienced users.

The dummy message that is being included, looks something like:

-------------------------------------------------------------


>From MAILER-DAEMON@student.uu.se  Sun Nov 25 10:26:12 2001
Date: 22 Nov 2001 18:35:02 +0100
From: Mail System Internal Data <MAILER-DAEMON@student.uu.se>
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
Message-ID: <1006450502@student.uu.se>
X-IMAP: 1006427719 0000000021
Status: RO
Approved: mungril

This text is part of the internal format of your mail folder, and is
not a real message.  It is created automatically by the mail system
software. If deleted, important folder data will be lost, and it will
be re-created with the data reset to initial values.

-------------------------------------------------------------------

When MHonArc converts a folder to html, it converts all the messages
in the folder, including the normally invisible one above. If looking
in the corresponding file to the specific folder, the file begins with
this invisible message, and MHonArc treats it as a normal message.

One solution to the problem would be to utilize the no-archive flag;
i.e. if mail messages have one of the following lines in the header,

    X-no-archive: yes
    Restrict: no-external-archive

using the switch -checknoarchive will cause such messages not to be
archived. Unfortunately, such no-archive flag is not always applied,
so the problem is still there for many of us. A pretty simple way then
to get around this, is as follows: 

1) When creating the mail archive for the first time, insert manually
into the folder file, in the top of the file, the line 
"X-no-archive: yes". Executing MHonArc with the -checknoarchive
switch, will cause MHonArc to exclude the dummy message into the mail
archive.

2) Every time a new message arrives to the mail folder, the invisible
message above, will be rewritten, and any manually editings in the
folder file, will disappear. Therefor, when updating the mail archive,
with the -add switch, use the following script, a file called for
instance email2html, which contains:

	cat xnoarchive_line folderfile > folderfile_tmp
	mhonarc -add -checknoarchive -outdir ~/pub_html folderfile_tmp
	test -f folderfile_tmp && rm folderfile_tmp

The file xnoarchive_line contains one line:

	X-no-archive: yes

Putting the file email2html in the bin directory, executing 
chmod 755 email2html, and adapt all the paths in the script above to
local conditions, the script automatically fixes our problem and
updates the mail archive.

I hope some of you will find this useful. :) Email me comments.
Regards, Mårten Berglund.


[Index of Archives]     [Bugtraq]     [Yosemite News]     [Mhonarc Home]