Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41054

Re: This mail never gets delivered. Any ideas why?

From Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de>
Newsgroups comp.lang.python
Subject Re: This mail never gets delivered. Any ideas why?
Date 2013-03-11 06:59 +0100
Organization A newly installed InterNetNews server
Message-ID <khjrsq$u7o$1@r03.glglgl.gl> (permalink)
References <fdc2a4d2-1967-4906-907e-3cf121694549@googlegroups.com> <khjpt4$r66$1@r03.glglgl.gl> <khjr65$tbr$1@r03.glglgl.gl>

Show all headers | View raw


Am 11.03.2013 06:47 schrieb Thomas Rachel:

> # either
> message.add_header('Subject', email.quoprimime.header_encode(SUBJECT))
>
> # or
> message.add_header('Subject', email.base64mime.header_encode(SUBJECT))

Sorry! These were completely wrong.

# either
message.add_header('Subject', email.quoprimime.header_encode(SUBJECT,
     charset='utf8'))

# or
message.add_header('Subject', email.base64mime.header_encode(SUBJECT,
     charset='utf8'))

should be correct, however.


But be aware that both seem to potentially break the UTF8 surrogates 
apart, which in turn confuses at least Thunderbird, so it might not be 
the ideal solution.

Maybe you transcode the subject into iso-8859-7 and declare it as such, 
if you only have greek characters.

Let's try:

[...]
# and then
# either
enc = email.base64mime.header_encode
# or
enc = email.quoprimime.header_encode

message.add_header('Subject', enc(
     SUBJECT.decode('utf8').encode('iso-8859-7'),
     charset='iso-8859-7'))

I tried both values for enc(), and both seem to work with the subject 
string you provided.


HTH,


Thomas

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-09 13:20 -0800
  Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-09 13:25 -0800
    Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-09 20:42 -0800
      Re: This mail never gets delivered. Any ideas why? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-10 05:56 +0000
        Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-09 22:00 -0800
          Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-10 03:19 -0700
          Re: This mail never gets delivered. Any ideas why? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-10 10:37 +0000
            Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-10 11:39 -0700
              Re: This mail never gets delivered. Any ideas why? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-03-11 23:34 +0100
                Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-26 01:49 -0700
                Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-26 03:26 -0700
                Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 13:44 -0700
                Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 13:48 -0700
                Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-05-26 14:43 -0700
                Re: This mail never gets delivered. Any ideas why? Cameron Simpson <cs@zip.com.au> - 2013-05-27 10:22 +1000
    Re: This mail never gets delivered. Any ideas why? Michael Torrie <torriem@gmail.com> - 2013-03-09 22:07 -0700
      Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-09 21:10 -0800
        Re: This mail never gets delivered. Any ideas why? Michael Torrie <torriem@gmail.com> - 2013-03-10 10:09 -0600
          Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-10 10:53 -0700
            Re: This mail never gets delivered. Any ideas why? Michael Torrie <torriem@gmail.com> - 2013-03-10 20:20 -0600
          Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-10 10:53 -0700
      Re: This mail never gets delivered. Any ideas why? Νίκος Γκρ33κ <nikos.gr33k@gmail.com> - 2013-03-09 21:10 -0800
    Re: This mail never gets delivered. Any ideas why? Chris Angelico <rosuav@gmail.com> - 2013-03-10 09:15 +1100
  Re: This mail never gets delivered. Any ideas why? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-03-11 06:25 +0100
    Re: This mail never gets delivered. Any ideas why? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-03-11 06:47 +0100
      Re: This mail never gets delivered. Any ideas why? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-03-11 06:59 +0100
  Re: This mail never gets delivered. Any ideas why? nagia.retsina@gmail.com - 2013-03-11 02:15 -0700
    Re: This mail never gets delivered. Any ideas why? Benjamin Schollnick <benjamin@schollnick.net> - 2013-03-11 06:44 -0400
    Re: This mail never gets delivered. Any ideas why? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-03-11 17:24 +0100

csiph-web