OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Wietse Venema (wietseporcupine.org)
Date: Mon Jun 03 2002 - 12:22:44 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Your patch does not work. Demonstration:

        From: sender
        To: recipient
        Subject: demo 1
        Content-Transfer-Encoding: base64
        Content-type: text/plain

        ..base64 encoded stuff..

    You would not reject the base64 encoded mail.

    Here is another demo:

        From: sender
        To: recipient
        Subject: demo 2
        Content-Transfer-Encoding: 7bit
        Content-type: message/multipart; boundary=foobar

        --foobar
        Content-Transfer-Encoding: 7bit
    >>>>Content-type: text/plain

        Mary had a little lamb

        --foobar
    >>>>Content-transfer-encoding: base64
        Content-type: image/jpeg

        ..base64 encoded stuff here..

        --foobar--

    By matching the lines indicated with >>>>, you would incorrectly
    reject the image/jpeg portion.

            Wietse

    Ulisses T V Guedes:
    >
    > Thanks Wietse,
    >
    > Motivated by my stupid question, I start to study and how to solve my
    > problem modifying few lines.
    >
    > What I have in mind?
    > The line read from message is, as you said, once at a time and
    > transfered to cleanup functions.
    > The patch creates two new states at CLEANUP: NEXTB and ENDNEX.
    > The NEXTB sets an internal variable next_body_line when the expression
    > match. ENDNEX checks the regexp expression. If this last matches and the
    > next_body_line (first matching) are set then some rule may be applied.
    > I'm testing making ENDNEX to reject with success.
    >
    > A preliminary patch version for postfix-1.1.11-20020602 is available in
    > ftp://ftp.dem.inpe.br/pub/postfix-patch/patch-ulisses.diff
    > (transfer in passive mode only)
    >
    > Reproducing:
    > a) apply the patch
    > b) Inserting the expressions at end of file
    > In main.cf
    > body_check = regexp:/etc/postfix/regexp_testing
    >
    > in regexp_testing:
    > ...... regexps ....
    > /content-type: (text|plain)\/(plain|text|html)/ NEXTB
    > /content-transfer-encoding: base64/ ENDNEX rejected by dual matching
    >
    > Trying for header_check it works!
    >
    > Problem (or feature) detected
    > - If the second condition occurs after 2 or more lines then the reject
    > is applied. This may be fixed storing the pointer, size or counter of
    > the line read for the first (NEXTB) and the pointer or counter of the
    > line that satisfy ENDNEX. This info may be included (or is available)
    > in CLEANUP_STATE structure.
    >
    > - only valid for one "dual matching". To use more dual-expressions
    > next_body_line must be changed to array (not yet implememted)
    >
    > - NEXTB may be indexed. The index may be included in "optional_text"
    > (not yet implemented).
    >
    > Comment, suggestion and improvement are welcome.
    >
    >
    > Best regards..
    >
    > Ulisses
    >
    > -
    > To unsubscribe, send mail to majordomopostfix.org with content
    > (not subject): unsubscribe postfix-users
    >
    >

    -
    To unsubscribe, send mail to majordomopostfix.org with content
    (not subject): unsubscribe postfix-users