Menu

#37 MIME-Enconding / Duplication of Subject: header

open
nobody
None
5
2010-06-02
2010-06-02
No

I have discovered a rather strange problem with my installation of gpgrelay 0.959.

Some recipients were complaining that they got mails with a duplicate Subject: header, like that:
| Received: from thorondor.akallabeth.de [127.0.0.1]
| by thorondor.akallabeth.de (10.0.1.201)
| with SMTP (Classic Hamster Vr. 2.1 Build 2.1.0.11) ; Sat, 22 May 2010 23:39:25 +0200
| From: Thomas Hochstein <thh@inter.net>
| To: testmail@thh.de
! Subject: Test 3d - "Dies ist ein laengerer Test."
| Date: Sat, 22 May 2010 23:39:24 +0200
| Message-ID: <cojgv5ljbanvi8liiokuv2gtgt8dtu18gn@gwaihir.akallabeth.de>
| X-Mailer: Forte Agent 2.0/32.652
| MIME-Version: 1.0
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
! subject:
| X-Relayed-By: GPGrelay Version 0.959 (Win32)
| Return-Path: <thh@inter.net>

Something has added another - empty - header "subject:".

A bit of debugging revealed that this only happens if the Subject: contains (a) a German umlaut (or another 8bit character) and (b) double quotes, and that the "something" adding another "subject:" header is indeed gpgrelay. gpgrelay seems to believe the real Subject: header to be empty, as it doesn't trigger on "Sign" in the Subject: header and it logs an empty Subject: header, too.

I send my mails from Forté Agent 2.0 (a client) via gpgrelay to Classic Hamster 2.1.0.11 (a local server); after processing through gpgrelay, Hamster will do some rather substantial reprocessing of the contents of some headers.

Further debugging - deactivating all header rewriting capabilities of that local server - uncovered two other things:

(1) The kind of Subject: that gpgrelay can't handle really looks like that (before it is reformatted by Hamster after processing through gpgrelay):
| Subject: =?ISO-8859-1?Q?Test_3d_-_"Dies_ist?=
| =?ISO-8859-1?Q?_ein_l=E4ngerer_Test.?=
| =?ISO-8859-1?Q?"?=

(2) If I don't use double quotes in the Subject:, gpgrelay seems to completely remove the MIME encoding from the Subject: header.

(a) Mail send through gpgrelay:
| From: Thomas Hochstein <thh@inter.net>
| To: testmail@thh.de
| Subject: Mäh? Mäh? Mäh? Mäh? Mäh? Mäh? Mäh? Mäh?
| Date: Sat, 22 May 2010 23:54:30 +0200
| X-Relayed-By: GPGrelay Version 0.959 (Win32)

(b) The same mail resend, but *not* send through gpgrelay:
| From: Thomas Hochstein <thh@inter.net>
| To: testmail@thh.de
| Subject: =?ISO-8859-1?Q?M=E4h=3F_M=E4h=3F_M=E4h=3F_M=E4h=3F?=
| =?ISO-8859-1?Q?_M=E4h=3F_M=E4h=3F_M=E4h=3F_M=E4h?=
| =?ISO-8859-1?Q?=3F?=
| Date: Sat, 22 May 2010 23:55:55 +0200

Perhaps gpgrelay can't handly quoted-printable MIME encoding correctly? I don't think it should strip it, sending unencoded 8bit characters in the Subject: header, and it certainly shouldn't stumble on MIME enconding continuing over more than one line.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.