Re: Any way to only add a header when there's not one there already?

Urs Janßen <[email protected]> Thu, 16 May 2013 18:46:25 +0200
Newsgroups gmane.network.tin.user
Message-ID <[email protected]>
On Thu, May 16, 2013 at 05:33:02PM +0200, Dennis Preiser wrote:
> >> ... and I have finally found what the interface from gmane to DBA needs,
> >> a Content-Type: header.  I have added this to the bottom of my
> >> attributes file:-
> >> 
> >>     x_headers=Content-Type: text/plain; charset=UTF-8; format=flowed
> >> 
> >> and now it seems to work OK.
> >> 
> > However, it only works for posts I initiate.
> > 
> > If I followup a post there will already be a Content-Type: header there
> > and my posting gets rejected because of the duplicate Content-Type:

The mime headers (Content-Type, Content-Transfer-Encoding, Mime-Version) are
somwhat special as they are added after the user left the $EDITOR. Theier
contents will be automatically generated (if needed), any user specified
mime-headers are not taken into account (but they are also not removed if
tin automatically add those headers, this might be rated as a bug) as
specifying wrong headers or combinatios could make the massage unreadable.

> You could put a sign into your signature that is outside ascii.
> For instance a MIDDLE DOT (U+00B7):
> 
> ·
> 
> This ensures that every post gets a Content-Type header. (And don't
> forget to remove the x_headers line from your attributes file.
> Otherwise, there are again two Content-Type: header.)

[untested]
another approach (I'd go for the non-ascii char in the sig, the sig
can be choosen on a per group basis via attributes) would be:
disable mime generation entirely via post_8bit_header=ON (can be done on a
per group basis via attributes) and insert the header 'manually' as befor.

This setup has the disadvantage that any headers which do need encoding
cause they do contain non ascii chars would be sent plain (unencoded).
this violates standards and is discuraged in most newsgroups.

urs 
-- 
"Only whimps use tape backup: _real_ men just upload their important stuff
 on ftp, and let the rest of the world mirror it ;)" - Linus