![]()
|
Archives
If you are processing UUCP mailbox files, messages are
separated by a line starting with " To avoid incorrect separator detection, many MUAs perform
a more stricter detection of separators beyond " To fix the problem, use the MSGSEP resource to instruct MHonArc to use a stricter test detecting a message separator. The following MSGSEP resource setting is known to work well: <MsgSep> ^From \S+\s+\S+\s+\S+\s+\d+\s+\d+:\d+:\d+\s+\d+ </MsgSep> In case you have message separates with quoted local parts in the address part of the separator, you can use the following: <MsgSep> ^From\s+(?:"[^"]+"@\S+|\S+)\s+\S+\s+\S+\s+\d+\s+\d+:\d+:\d+\s+\d+ </MsgSep> Make sure to test things out before using in production environments. If this fails, you can try the CONLEN
resource available in v2.0 and later. The CONLEN resource, when set, tells
MHonArc to utilize the If you use Procmail to filter your mail, you can try the following Procmail recipe (contributed by Christopher Lindsey):
If sendmail is your system's MTA and you use Procmail as your local delivery agent, you can configure things to have Content-Length defined for all locally delivered mail. The following technique is contributed by Jason L Tibbitts III:
If possible, try to avoid relying on the use of Content-Length since it is hard to guarantee that it is set properly. When CONLEN is specified, MHonArc will read at least the number of bytes specified by Content-Length before checking for the message separator, as defined by the MSGSEP resource. Therefore, the value of Content-Length can be less than the actual message size, and message extraction will probably work as expected. However, if Content-Length for a message has a value that is larger than the actual size, MHonArc may include the content of the next message as part of the current message.
No. In order to achieve the same effect, you must add the original, unprocessed, message to the destination archive, then remove the appropriate HTML version of the message from the source archive.
Yes. v2.3 of MHonArc introduced a utility program called mha-dbrecover. It gets installed with the other MHonArc files during the installation process. See the documentation for usage information.
Yes. MHonArc performs archive locking to protect from multiple MHonArc process attempting to write to an archive at the same time. This locking allows MHonArc to safely be used to add messages as they are received.
Many users use Procmail <http://www.ii.com/internet/robots/procmail/> to call MHonArc to archive messages. Procmail provides the ability to preprocess mail as it arrives to do selective processing and automated tasks with your mail. For illustrative purposes, the following simple example shows a possible way of archiving messages as it arrives w/o using a tool like Procmail. This example assumes you are on a Unix-based system using sendmail as the mail transfer agent. Please refer to documentation about sendmail if you are not familiar with it (sendmail, 2ed, from O'Reilly is an excellent source). The approach shown here uses a .forward file in the home directory of the account you want mailed archived. For this example, let's assume it is my account. Here is how to set up the .forward file to invoke MHonArc on incoming mail: \ehood, "|/home/ehood/bin/webnewmail #ehood"
webnewmail is a Perl program that calls MHonArc with the appropriate arguments. A wrapper program is used instead of calling MHonArc directly to keep the .forward file simple, but you can call MHonArc directly if you want. Here is the code to the webnewmail program: #!/usr/local/bin/perl # Edit above path to point to where perl is on your system. ## Specify a package to protect names from MHonArc. package WebNewMail; ## Edit to point to installed mhonarc. $MHonArc = "/home/ehood/bin/mhonarc"; ## Define ARGV (ARGV is same across all packages). ## Edit options as required/desired. @ARGV = ("-add", "-quiet", "-outdir", "/home/ehood/public_html/newmail"); ## Just require mhonarc, this prevents the overhead of a ## fork/exec. require $MHonArc; The webnewmail program has to have the executable bit set. This is achieved by using "chmod a+x webnewmail".
Here is a template for archiving messages as they arrive for a Majordomo list to include in sendmail's aliases file: xxxx: "|/usr/lib/majordomo/wrapper resend -l xxxx xxxx-outgoing" xxxx-outgoing: :include:/var/lib/majordomo/lists/xxxx, xxxx-mhonarc xxxx-request: list-admin-address owner-xxxx: list-admin-address xxxx-owner: list-admin-address xxxx-mhonarc: "|/usr/lib/majordomo/wrapper mhonarc -add -quiet -outdir /home/httpd/html/yyyyyyy -rcfile rcs.mrc -stderr /var/log/mhonarc" Replace text that is rendered like this with what is appropriate for your configuration. In order to run MHonArc with Majordomo's wrapper, the program has to be in the same directory where the Majordomo programs are located. An easy way to insure this is to create a symbolic link to in Majordomo's program directory to where MHonArc is installed. For example: shell> ln -s /usr/bin/mhonarc /usr/lib/majordomo/mhonarc Make sure /usr/bin/mhonarc is readable and executable by the majordomo user. Something like the following can be done to insure this: shell> chmod 755 /usr/bin/mhonarc If you redirect stderr to a logfile, the logfile must be owned by the majordomo user and be writable by the majordomo user. The directory for that logfile must exist. The MHonArc-archive directory must be owned by the majordomo user and must have the minimum access permission 755. Group ownership does not matter.
No. This is outside of the MHonArc's scope. You can grow your own filter, using the method described in the previous question, to scan the message header an invoke MHonArc with the proper arguments. Or. you can use a tool like Procmail <http://www.ii.com/internet/robots/procmail/>.
Here are a some messages from users about using Procmail:
Version 2.4, or later, does via the CHECKNOARCHIVE resource. If using an earlier version, or if you are already doing some preprocessing, you can use a pre-processor like Procmail to do the filtering. Here is a message sent to the MHonArc mailing list:
Yes. If MHonArc sees no archive exists when perform an add, it will automatically create the archive.
Big gaps in the message number sequence may occur if you defined the MAXSIZE resource and you have MHonArc rescanning a mail folder for adding new messages. The problem occurs when MHonArc reads in messages that will automatically get deleted due to MAXSIZE. Ie. Messages subject to automatic deletion are the oldest ones. If the input contains old messages that will get deleted at the end of processing, the old messages will still use up message numbers since messages to be deleted are not determined until all input is read. Since MHonArc does not keep information about deleted messages, if the messages are fed into MHonArc again, the "jumping" will occur again (and the jump will get larger for each additional update). To avoid the problem, try to pass only new, never processed, messages to MHonArc instead of having MHonArc rescanning the same mail folder for new messages. Another approach is to set either the EXPIREAGE or EXPIREDATE resources (available in v2.0 beta 2, or later). These work as an alternative to MAXSIZE and will help in preventing message number jumping since expiration of a message is checked when it is initially read (bypassing the assignment of a message number).
This condition may occur when you have MHonArc examine the same folder periodically to add any new message. If there are messages in the folder without message-ids, then those messages will be re-added each time MHonArc runs. Why? Well, MHonArc uses message-ids for determining if a message has been archived, or not. Therefore, if a message-id is missing for a message, then MHonArc believes it is new. In general, mail has message-ids. They get assigned by MTAs. However, if messages are generated by a CGI program, or other non-mail specific software, then the program in question should create a message-id. Else, you will need to move already-processed messages into a different area so MHonArc does not read them again.
A related problem is messages showing up again in the archive after you deleted them with RMM. MHonArc does not keep track of delete message-ids. Therefore, if want to make sure that a message will not appear in the archive after explicitly deleted via RMM, make sure to remove the message from input source.
Automatic removal can be done via the EXPIREAGE or EXPIREDATE resources (available in v2.0 beta 2, or later) or the MAXSIZE resource. Explicit message removal can be done with the RMM resource. Please read the RMM resource page for more information and examples.
Anthony W provides a Perl program called mhn2mbox for converting archives back into mailbox format. To obtain more information and to download the program, goto <http://www.albany.net/~anthonyw/mhonarc/>. $Date: 2002/06/21 22:28:16 $ ![]() Copyright © 1997-2001, Earl Hood, mhonarc@mhonarc.org |