Re: [gmime-devel] Feature request: custom content headers



Example mime:

To: <foo example com>
Subject: foo bar
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="----------64FE7F17715"

------------64FE7F17715
Content-Type: text/html; charset=random
Content-Transfer-Encoding: 8bit
W-Storage: @36F60000000217E4C8A1
W-Size: 5161

------------64FE7F17715
Content-Type: text/html; charset=random
Content-Transfer-Encoding: 8bit
W-Storage: @36F60000000217E4CFE0
W-Size: 1337

------------64FE7F17715--

And when doing g_mime_object_get_header(part, 'W-Storage') it's being ignored.

So in gmime-part.c, gmime-message.c and gmime-message-part.c, I've
changed all the:

if (!g_ascii_strncasecmp ("Content-", header, 8))

to

if (!g_ascii_strncasecmp ("Content-", header, 8) ||
!g_ascii_strncasecmp("W-", header, 2))

and

if (g_ascii_strncasecmp ("Content-", header, 8) != 0)

to

if (g_ascii_strncasecmp ("Content-", header, 8) != 0 &&
g_ascii_strncasecmp ("W-", header, 2) != 0)

when appropriate.

Of course a more general solution would be to loop over an array of
headers, which by default has 'Content-' and user can append other
headers to.

BTW, I've seen that the mime GMail produces also have non Content-, If
you forward yourself an email from GMail that has attachments, you'll
see that each attachment part has a header that looks like so:

X-Attachment-Id: 94b0d466d277289b_0.0

Thanks


On Sun, Feb 19, 2012 at 6:37 PM, Jeffrey Stedfast <fejj gnome org> wrote:
> Can you send me some sample messages (you can rip out any body content - I
> just need the overall mime structure & headers) so I can get a better
> picture of what you mean?
>
> Send me your local patch for this as well, as that might help me understand
> better too.
>
> Thanks,
>
> Jeff
>
>
> On 02/19/2012 03:42 AM, evil legacy wrote:
>>
>> Hey,
>>
>> As it is now, GMimePart/GMimeMessagePart can only have Content-*
>> headers, and GMimeMessage can only have everything but Content-*
>> headers.
>>
>> Can you consider adding something like a
>> 'add_custom_content_headers()' function?
>>
>> Our legacy mail system uses some non standard content headers (e.g
>> X-Attachment-ID, W-Size, etc), and I have to maintain a local gmime
>> branch to make gmime include these headers in part/messagepart and
>> exclude them in message.
>>
>> Thanks
>>
>



-- 
map{map{$a=unpack"C",$_;map{$c=$a-ord;print$_ x$c and goto"a"if$c>0}("Z",
" ");a:}split//;print"\n"}(q{&[%[%`#[%["},q{&[$[![$[%["[%["},q{&[#[#[#[%[
"[%["},q{&["[%["`#a"},q{[%["a"[([%["},q{[%["[%["[([%["},q{!_#[%["[([%["})


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]