procmail
[Top] [All Lists]

Announce: New MPFS supports sending out multipart MIME messages

1998-06-04 23:35:29

    Hi,

    If anybody is using my MPFS you might be interested that it can
    now send big tar.gz files as MIME multiparts automatically. Added
    Feature description is attached. Get the new modules with:

        mailto: jari(_dot_)aalto(_at_)poboxes(_dot_)com
        Subject: send pm-code.shar      (try also: "send help")

    If you don't have decent MUA that can reassemble multiparts, or
    if you're off line and don't have a nice Mail agent around to
    pick the parts from mailboxes, you may find this perl script
    handy in your toolbox:

        mime+.pl                        ("send mime+.pl")

    It can assemble standard mime multiparts back together. Parts
    can be in any order and speread in several mailboxes. Manual page
    is attached to the end. 

    Cheers!
    jari

Pm-jasrv.rc -- Jari's MPFS (Mime Procmail 3.11+ File server)

 ...

    Description

        This is the MPFS (Mime procmail file server) and it can send MIME
        compliant messages with command

            "send <ITEM> [WORD1] [WORD2]"

        Usually only the ITEM arg is used, and the rest of the words are for
        special use like password and preventing file encoding. A typical
        request looks like:

            Subject: send help              # ask for file named 'help'

    Overview of features

        o   MIME types x-gzip64 and text/plain are supported.
        o   .gz .zip etc. files are sent out as base64 attachements
        o   .gz .tar.gz files that exceed 100K are sent out as MIME multiparts
        o   requires procmail 3.11+ and MATCH operator \/
        o   requires `mmencode' and `gzip' executables to be present in PATH.
 ...

    Multipart mime messages

        If you want to deliver big files, you better be sure not to send
        them as a big file. That blocks connection between every host
        where the hop happend while the big file will be transfered. The
        solution is to use MIME ultiparts that can be assembeld back in
        the receiving MUA. (In case you don't have multipart assembler
        at hand, send message "send mime+.pl" to Contactid and you will
        receive Perl script to do it).

        MIME multiparts are sent out if

        o   Filename matches JA_SRV_BASE64_ALWAYS, typically tar.gz, zip
        o   Filesize is bigger than JA_SRV_MULTIPART_THRESHOLD, where
            defualt chunk size is 100K.

        When file meets these criterias, it is read to the `BODY' of message
        and base64 encoded. This all happens in memory, so watch out
        procmail logs to see any problems with very big files. (>30Meg).
        Next, if the base64 conversion succeeded, the composed is handed
        to

            JA_SRV_MIME_MULTI_SEND

        Which does the actual delivery and splitting. The default program
        used is `splitmail'. Make sure you have it or substitute the
        program with some equivalent one.

NAME
    mime+.pl - Re-assemble multipart mime email messages from mailboxes.

SYNOPSIS
        mime+.pl -b mailbox mailbox ..

OPTIONS
    --base64 -b
    --verbose -v
        Turn on verbose messages.

    --Version -V
        Print program version and contact info.

    --debug -d
        Turn on debug.

    --help -h
        Print help page.

DESCRIPTION
    This program assembles MIME partial mail messages to one chunks. All of
    the *bodies* for the same part id are saved to one file. If you only
    want to save the base64 lines from the bodies, then use --base64 switch.

    The format of the file must be following: The beginning of header is
    indicated with the field "From", which must match "@" and "199". This
    loosely matches typical Berkley mailbox format which starts with line:

        From foo(_at_)bar(_dot_)com  Mon May 25 14:51:28 1998

    But is is also allowed to start like this, as Emacs Gnus newsreader
    converst the incoming From_ field to X-From-Line.

        X-From-Line: foo(_at_)bar(_dot_)com  Mon May 25 14:51:28 1998

    There must also be header Content-Type which defines part id and number.
    The assembled mesages are saved according to part id. Below you see
    example of the required minimum headers:

        X-From-Line: foo\(_at_)bar(_dot_)com  Mon May 25 14:51:28 1998
        Content-Type: message/partial; 
id="Mon_May_25_14:46:46_1998\(_at_)foo(_dot_)bar(_dot_)com
"; number=2; total=8

  Saving base64 lines only

    When you send message as binary multipart, the body will contains extra
    lines, like mime headers. If you turn on the --base64 switch, then only
    the encoded lines from the body are written to file. This way you can
    decode the file with

        % mmencode -u BODY > binary.tar.gz

    Or if you want to decode everything in one pass

        % mmencode -u BODY | gzip -dz | tar -xvf -

    And example of the multipart binary looks like this: the binary file has
    been gzipped and base64 encoded here (notice mime type x-gzip):

        From: <foo\(_at_)bar(_dot_)com>
        To: quux\(_at_)bar(_dot_)com
        Subject: test
        Mime-Version: 1.0 (generated by tm-edit 7.106)
        Content-Type: message/partial; 
id="Mon_May_25_16:32:50_1998\(_at_)foo(_dot_)bar(_dot_)com
"; number=2; total=16
        Content-Transfer-Encoding: 7bit

        --Multipart_Mon_May_25_16:32:45_1998-1
        Content-Type: text/plain; charset=US-ASCII

        --Multipart_Mon_May_25_16:32:45_1998-1
        Content-Type: application/octet-stream
        Content-Disposition: attachment; filename="binary_name"
        Content-Transfer-Encoding: x-gzip64

        H4sIAJRxaTUAA8ycf1hc1ZnHz8zAzPAjmYEMMDADcwcuvxJMJgZNrJgMCZOQFQMNJKJmN9Rg
        ...
        --Multipart_Mon_May_25_16:32:45_1998-1--

NOTES
    This program will *not* check if the mailboxes files contain all part
    fot the distributed file. It simply concatenates all partials that
    belong to same part id together. Turn on the <--verbose> to see what
    parts is did found from mailboxes.

    All mailboxes are read to memory before writing compbined partials to
    files. Make sure you have enough memory.

AUTHOR
    (C) 1998 Jari Aalto. All rights reserved. This program is free software;
    you can redistribute it and/or modify it under the same terms as Perl
    itself or in terms Gnu General Public licence v2 or later.

    mailto: jari(_dot_)aalto(_at_)poboxes(_dot_)com

SEE ALSO
    splitmail(1) to send out multipart MIME messages (at least exist in HP-
    UX)
<Prev in Thread] Current Thread [Next in Thread>
  • Announce: New MPFS supports sending out multipart MIME messages, jari.aalto <=