473,796 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it an error in email.Header?


I was using Python module email.Header to decode headers and encountered
problems with some of the headers. One example is given below:

Python 2.3.4 (#1, May 27 2004, 15:48:35)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
import email.Header
email.Header.de code_header(''' =?koi8-r?B?Qm9va3MuUnU gLSDOz9fZyiDTwc rULCDOz9fZxSDTy 8nEy8k?= =?koi8-r?B??=''')

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/var/tmp/python2.3-2.3.4-root/usr/lib/python2.3/email/Header.py",
line 113, in decode_header
email.Errors.He aderParseError

While mailers decode Subject just fine... Is it a case of some
standard deviation?
Sincerely yours, Roman A.Suzi
--
- Petrozavodsk - Karelia - Russia - mailto:rn*@oneg o.ru -

Jul 18 '05 #1
1 1724
Hi !
decode_header not work for all cases of e-mails. Use try, and, if except,
try other decode fonction (utf-8, cp1252, etc.)
Then an header can to have more differents codages. Try to decompose the
item, and to decode each element. The elements are often separate with =?
and ?=

*sorry for my bad english*

Michel Claveau
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2535
by: Matt | last post by:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else. Basically, I have a page where a user inputs his email address. The system is supposed to look up the email address and send the associated password to that email address. It worked up until a few months ago. Note that the validation works. So, if the user tries to submit a blank text box, it returns...
1
1873
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment; filename= " ..basename($file)); @readfile($file); ************************************************************************* to let user get popup window with options to download file on his local machine.
1
1526
by: Cynthia | last post by:
Hi, I have a C++ source file (mymessage.cpp), it is used by two different platforms. PC and VxWorks. The file has a header section to include header files depending on which platform it is compiled. The code is like this: #ifndef _VxWORKS #include "stdafx.h"
13
2486
by: a.zeevi | last post by:
free() multiple allocation error in C ==================================== Hi! I have written a program in C on PC with Windows 2000 in a Visual C environment. I have an error in freeing multiple allocation as follows: 1. I allocated an array of pointer. 2. I Read line by line from a text file. 3. I allocated memory for the read line.
1
2708
littman84
by: littman84 | last post by:
I'm not sure why i have this error, help :( <?php @extract($_POST); $name = stripslashes($name); $email = stripslashes($email); $message = stripslashes($message);
0
3588
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
11
2937
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition: attachment; header("Pragma: no-cache"); header("Expires; 0"); print "$header\n$data";
10
6982
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
15
5697
by: madhu.ab | last post by:
Hi All, I am getting the following errors when i am including header file winuser.h I dont know whats happening. How will an error occur in winuser.h?? Please help. \microsoft visual studio\vc98\include\winuser.h(39) : error C2061: syntax error : identifier 'HDWP'
3
3601
by: graphicssl | last post by:
Okay, so first of all, I'm a designer first and a light coder second (I'm only really trained with HTML and CSS). So I apologize for having to post about something that's probably super-trivial! I'm working on setting up a shopping cart for a one-product web site, and I'm using HTML and CSS, with ASP for the shopping cart. The ASP takes the information from the form on the shopping cart, and formats it in to two e-mails: one for the company...
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.