git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add a MIME-Version header to e-mails

From
Karl Hasselström <kha@treskal.com>
Date
Nov 8, 2006, 10:01 UTC
Message-ID
<20061108100103.GA18117@diana.vm.bytemark.co.uk>
In-Reply-To
<b0943d9e0611080141y3751039v37b0289147237e4f@mail.gmail.com>
On 2006-11-08 09:41:33 +0000, Catalin Marinas wrote:
Show 13 quoted lines
> On 08/11/06, Karl Hasselström <kha@treskal.com> wrote:
>
> > On 2006-11-07 19:09:06 +0000, Catalin Marinas wrote:
> >
> > > I re-implemented parts of the mail and import commands
> > > (inspiring from your patches). They now use the email Python
> > > package. The mail command encodes the body to 7 or 8bit
> > > depending on non-ascii characters.
> >
> > Even though it turned out to be possible to use 8bit always?
>
> I just let the Python email package to the encoding and it first
> tries pure ascii and switches to 8bit if this fails.
Ah, OK, I misread you. This is precisely what I wanted.
> It can also do QP or base64 encodings (if someone complains of an
> old SMTP server, maybe I'll add a config option to force QP body).

Yes, but let's hope we don't have to. :-) And if we do have to, we should probably autodetect it from the SMTP dialog as Linus explained (or rather, we should hope that the library can do this for us).

Show 12 quoted lines
> > > I still have to write a test script but my simple tests showed
> > > that it works. Please let me know if there is anything wrong
> > > (especially with the QP-encoding of the mail headers).
> >
> > I won't have time to check this out today (in fact, it may have to
> > wait until the weekend). But when I do check it out, I might have
> > time to write that test, so please holler if you start working on
> > that.
>
> It would be great if you can run a test script. I've been thinking
> more of an "import" test that also checks both the "export" and "mail"
> commands.

I was thinking along these lines too; first make sure the importer works, by feeding it a number of hard-coded patches in different formats, and then make sure that the importer can read what the exporter produces. (With "exporter" meaning both "stg export" and "stg mail".)

I didn't originally plan to thest the actual e-mail sending, but now that I think of it, a simple script listening on a random port, pretending to be an SMTP daemon, should be quite simple to set up.

> BTW, I'll try to add support for mbox importing which is pretty easy
> with the email package.
Sounds good. If you do it in time, I'll write a test for that too. ;-)
-- 
Karl Hasselström, kha@treskal.com
Previous: Catalin MarinasNext: Karl Hasselström
Message 8 of 10 in “Re: [PATCH] Allow hand-editing of patches before sending”
  1. Jakub NarebskiNov 5, 2006
  2. Add a MIME-Version header to e-mailsKarl Hasselström, Nov 6, 2006
  3. Karl HasselströmNov 6, 2006
  4. Catalin MarinasNov 7, 2006
  5. Catalin MarinasNov 7, 2006
  6. Karl HasselströmNov 8, 2006
  7. Catalin MarinasNov 8, 2006
  8. Karl HasselströmNov 8, 2006
  9. Karl HasselströmNov 11, 2006
  10. Catalin MarinasNov 16, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.