473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

email.Utils.parseaddr() gives arcane result

email.Utils.parseaddr('Real Name ((comment)) <ad*****@example.com>')

returns

('comment <ad*****@example.com>', 'Real')

Granted the string above is invalid as RFC 2822 does not allow
parentheses within comments, but most mail agents seem to at least take
the contents of the angle brackets as the address.

rfc822.parseaddr() returns the same result in this case.

If these functions aren't going to return their respective failure
indication in this case, I think they should at least return
'ad*****@example.com' as the second item of the returned tuple.

--
(for email use this address please - you can figure it out)

Mark Sapiro msapiro -at- value net Any clod can have the facts;
San Francisco Bay Area, California having opinions is an art. -
C. McCabe, The Fearless Spectator

Jan 9 '06 #1
0 1003

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

Similar topics

3
by: Stuart D. Gathman | last post by:
Running the following with Python 2.2.2: from email.Parser import Parser txt = """Subject: IE is Evil Content-Type: image/pjpeg; name="Jim&amp;&amp;Jill" <html> </html> """
3
by: dont bother | last post by:
Hey, I have been trying to parse emails: But I could not find any examples or snippets of parsing emails in python from the documentation. Google did not help me much too. I am trying to...
4
by: Russell Bungay | last post by:
Hello all, I have written a short function, based on a recipe in the Python Cookbook, that sends an e-mail. The function takes arguments that define who the e-mail is to, from, the subject, the...
9
by: Ernesto | last post by:
Is there a special module for mail ? I'd like to send an email from a python script. Thanks !
1
by: fuzzylollipop | last post by:
I want to do email address format validations, without turning to ANTLR or pyparsing, anyone know of a regex that is COMPLIANT with RFC 821. Most of the ones I have found from google searches are...
4
by: Christoph Haas | last post by:
Hello, everyone... I'm trying to send an email to people with non-ASCII characters in their names. A recpient's address may look like: "Jörg Nørgens" <joerg@nowhere> My example code: ...
0
by: Nico Grubert | last post by:
Hi there, I wrote a short python script that sends an email using python's email module and I am using Python 2.3.5. The problem is, that umlauts are not displayed properly in some email...
1
by: Roopesh | last post by:
Hi, I tried using parseaddr of email.utils, but it gave the following result when the name had a comma inside. ('', 'K') Thanks and Regards, Roopesh
2
by: anu b | last post by:
Now i am sending email to my friend using session variable... but my code is as below private bool SendEmail(string email) { try
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.