9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@coraid.com>
To: 9fans@9fans.net
Subject: Re: [9fans] file heuristics on troff input
Date: Tue, 15 Jul 2008 16:07:48 -0400	[thread overview]
Message-ID: <22ed65cc40b95541c09c81c4e2c53e70@coraid.com> (raw)

> From: "roger peppe" <rogpeppe@gma...>

> one thing that has bugged me in the past: upas relies on file -m to
> determine the type of attachments, but file only reads the first block
> of the file, so if you've got a utf-8 file with the first non-ascii character
> beyond the 8192nd byte, you get corrupted mail.
> IMHO for the -m option, file should probably read the whole file,
> but there are probably good reasons for not doing so.

i don't think this is correct.

upas/marshal uses file -m to determine the mime type, e.g.
"text/plain" or "text/html" or whatever.  it tests for bucky bits
in the entire body to determine if it is utf-8 or us-ascii.
(cf. upas/marshal/marshal.c:^/body)  it uses this information
to emit a charset.

(obviously there's a whole in this nulls and bad utf can cause
this algorithm to go pear shaped.)

upas/nedmail also uses file -m.  but since upas/fs does
character set translation, i don't see how using file could
be to blame for corrupt email.

- erik




             reply	other threads:[~2008-07-15 20:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 20:07 erik quanstrom [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-11 14:44 Pietro Gagliardi
2008-07-11 16:11 ` hiro
2008-07-11 17:30   ` Pietro Gagliardi
2008-07-11 16:55 ` C H Forsyth
2008-07-11 17:00 ` Iruata Souza
2008-07-14 16:33 ` Russ Cox
2008-07-14 17:55   ` roger peppe
2008-07-14 18:48     ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22ed65cc40b95541c09c81c4e2c53e70@coraid.com \
    --to=quanstro@coraid.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).