Results 1 to 10 of 10

Thread: text/plain vs. octet/stream

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    25
    Rep Power
    8

    Default text/plain vs. octet/stream

    Hello,

    I have a user who receives large ASCII text files. The files do not have a .txt extension in their file name. The files are getting typed as octet/stream which makes opening them from a mail tool difficult. User must download/save and then open another tool to read a text file.

    If I run the command "file" to determine the file type, it returns ASCII text. I am wondering why Zimbra is not identifying the file properly.

    Thanks,
    Kirk

  2. #2
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default

    I believe that the user's browser is making this decision, not Zimbra. Zimbra is returning the attachment's Content-Type as specified in the message's MIME headers.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  3. #3
    Join Date
    Mar 2007
    Posts
    25
    Rep Power
    8

    Default

    Quote Originally Posted by dkarp View Post
    I believe that the user's browser is making this decision, not Zimbra. Zimbra is returning the attachment's Content-Type as specified in the message's MIME headers.
    I guess what I am asking is why is Zimbra marking a file that is clearly ASCII as octet/stream in the mime type?

    Thanks,
    Kirk

  4. #4
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default

    I'd be willing to bet that Zimbra is not marking it as application/octet-stream. I believe that the user's browser is ignoring the Content-Type specified in Zimbra's HTTP GET response and is instead looking at the (missing) file extension.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    Join Date
    Mar 2007
    Posts
    25
    Rep Power
    8

    Default

    Quote Originally Posted by dkarp View Post
    I'd be willing to bet that Zimbra is not marking it as application/octet-stream. I believe that the user's browser is ignoring the Content-Type specified in Zimbra's HTTP GET response and is instead looking at the (missing) file extension.
    I tried sending myself a test file that I am having problems with from another mailer (mutt). Mutt sent the file as "text/plain" while the Zimbra web client sent it as "octet/stream". Seems like the web client is not determining the file type properly.

    The problem is easy to replicate. Try sending a plain text file with no extension from the web client. It comes across as "octet/stream".

    Thanks,
    Kirk

    Here is the test message as sent from the Zimbra web client. It show "octet/stream".

    Received: from localhost (localhost.localdomain [127.0.0.1])
    by usmail1.montalvosystems.com (Postfix) with ESMTP id CAD103A44C4
    for <kpatton@montalvosystems.com>; Thu, 13 Sep 2007 17:34:15 -0700 (PDT)
    X-Virus-Scanned: amavisd-new at
    X-Spam-Score: -4.294
    X-Spam-Level:
    X-Spam-Status: No, score=-4.294 tagged_above=-10 required=6.6
    tests=[ALL_TRUSTED=-1.8, AWL=0.105, BAYES_00=-2.599]
    Received: from usmail1.montalvosystems.com ([127.0.0.1])
    by localhost (usmail1.montalvosystems.com [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id 3oI0glikr3UR for <kpatton@montalvosystems.com>;
    Thu, 13 Sep 2007 17:34:15 -0700 (PDT)
    Received: from usmail1.montalvosystems.com (usmail1.montalvosystems.com [10.17.0.50])
    by usmail1.montalvosystems.com (Postfix) with ESMTP id 9F9843A44AA
    for <kpatton@montalvosystems.com>; Thu, 13 Sep 2007 17:34:15 -0700 (PDT)
    Date: Thu, 13 Sep 2007 17:34:15 -0700 (PDT)
    From: Kirk Patton <kpatton@montalvosystems.com>
    To: Kirk Patton <kpatton@montalvosystems.com>
    Message-ID: <1252993997.1104761189730055537.JavaMail.root@usma il1>
    Subject: test simple
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
    boundary="----=_Part_52459_1850970744.1189730055533"
    X-Originating-IP: [10.17.4.217]

    ------=_Part_52459_1850970744.1189730055533
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 7bit



    --
    Kirk Patton x5585
    Sr. systems Administrator
    Montalvo Systems

    ------=_Part_52459_1850970744.1189730055533
    Content-Type: application/octet-stream; name=test
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=test

    This is some text

    ------=_Part_52459_1850970744.1189730055533--
    Last edited by kpatton; 09-13-2007 at 06:38 PM. Reason: Included text message

  6. #6
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default

    Now I understand the situation, and my description of the root of the problem was indeed slightly wrong.

    What's happening is that when you attach a file to the outgoing message, your browser specifies the Content-Type during the form upload. Zimbra takes that Content-Type and faithfully inserts it into the outbound message. Zimbra never guesses as to Content-Type. It just relies on what the browser says. In this case, your browser instructs Zimbra that the attachment's Content-Type is "application/octet-stream". Hence that's what's in the message and that's what it appears as at attachment download time.
    Bugzilla - Wiki - Downloads - Before posting... Search!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •