procmail
[Top] [All Lists]

Re: convert all mails of a catch-all mailbox to html or .txt. files infolders named by the recipient

2007-09-02 08:52:28
Hi everyone,

I now use the following config. It works fine- thank you all very much.

PATH=$HOME/bin:/usr/bin:/global/bin:/usr/ucb:/bin:/usr/local/bin:
MAILDIR =    $HOME/Mail
DEFAULT =    $MAILDIR/STANDARDMAILBOX
VERBOSE=yes
LOGFILE =    $MAILDIR/LOGDATEI
LOCKFILE=    $HOME/.lockmail

:0
         * ^TO\/(_dot_)*(_at_)MYDOMAIN\(_dot_)de\>?
         {
                FROMADDR=$MATCH
         }

:0
$MATCH

I have just one issue left:

Now I have the splitted mboxes which have emailadresses as names, and 
contain only the emails which were send to that alias. Now I want to 
convert them to html that they are reachable at 
http://mylanserver/FOLDER_NAMED_LIKE_THE_MBOXES

Piping to the program hypermail (man-page at 
http://pwet.fr/man/linux/commandes/hypermail ) works with the 
procmail-config below

This config was just a test to test if I can set up hypermail to get 
data over a pipe. All emails from the mailbox are directly piped to 
hypermail- without seperating them into small mboxes befor:
-------------------------------------------

PATH=$HOME/bin:/usr/bin:/global/bin:/usr/ucb:/bin:/usr/local/bin:
MAILDIR =    $HOME/Mail
DEFAULT =    $MAILDIR/STANDARDMAILBOX2
VERBOSE=yes
LOGFILE =    $MAILDIR/LOGDATEI
LOCKFILE=    $HOME/.lockmail

:0:

     | hypermail

:0
$MATCH 
------------------------------------------

(hypermail looks in $HOME/ for the config file .hmrc  but there are no 
important thinks in there)
The html data then can be found in $HOME/archive   (without subdirectories)
 

The issue is: I want the html data to be created in folders named the 
same as the name of the mboxes.

man hypermail says:

*-d*/ directory/
    Specifies the directory to put the HTML files and index files that
    are created. If the directory doesn't exist, a new one will be
    created with the name that is specified. If the *-d* option isn't
    used, Hypermail will look for a directory with the same name as the
    input mailbox or will create one if needed.

It works like discribed when I give hypermail the name of an mbox-file 
in the shell (with "-m  MBOXFILE")

 hypermail -m /var/spool/mail/TESTMBOX

this generates a folder which is named like the mbox in $HOME/archive

I don´t know much about "piping" but I guess when hypermail is "piped" 
directly from procmail it gets just one arriving email, and not a whole 
mbox, so it can´t name the target dir after the mbox-file.

Is there a possibility to execute "hypermail -m 
/var/spool/mail/NAMES_OF_THE_CREATED_MBOXES" for each created mbox 
instead piping hypermail?

I would solve it with a cronjob, but hypermail can´t convert "all mboxes 
of a folder". I would have to look for the mboxes´ names, and run the 
command for each mbox.

The command for procmail to execute would look like "hypermail -m 
/path/to/yust-created-mboxes"

Any idea? Thank you

Stefan

PS: If that is impossible, please tell me





____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail