[clear] Python packages for email authentication
David MacQuigg
dmquigg-clear at yahoo.com
Tue Aug 23 11:14:28 PDT 2005
At 11:37 AM 8/23/2005 +0100, David Wilson wrote:
>Richard Kay wrote:
>
>>>0.3x is a version in transition from .3 to .4. I think its OK, because
>>>it was *after* I changed the name from pyCSV.py to csv.py, but you may
>>>want to download version 0.4 just to be
>>>sure. http://purl.net/macquigg/email/python
>
>>Have done this. Comparing the version linked from this page ( 0.3x ) to
>>the .4 version (csv.py) on:
>
>The name csv.py conflicts with the Comma Separated File module present in
>Python 2.3 and upwards. This means that a program can't use both modules
>unless it artificially places your csv.py in a package directory so that
>it doesn't exist on the 'primary' module path:
>
> import csv
>
>When csv.py is in the current working directory, or the package directory
>for the currently executing module, it will always shadow the stdlib's csv.py.
>
>The only way I can see around this is renaming, or creating a dummy
>package (and dummy __init__.py), and placing csv.py within that. eg:
>
> import dummy.csv as csv
>
>
>Might I suggest you create a package called "CLEAR" or "clear", and
>distribute csv.py as part of that? It would then natural for a BATV
>implementation to live inside that as batv.py. eg:
>
> from clear import csv, batv
> from clear.csv import *
I've created two packages, one for Linux, one for Windows, which should
avoid the name conflicts.
http://purl.net/macquigg/email/python email_auth(.tgz, .zip) These
packages contain two modules (csv.py and spf.py). I think 'email_auth'
might be a more neutral name than 'clear' (unless CLEAR wants to broaden
its mission).
Unzip (or un-tar) the appropriate package, copy the email_auth directory to
a directory on your Python sys.path, and you should be able to use these
modules with statements like:
# Authentication methods available at this site:
from email_auth import spf
# SPF1 from sourceforge.net/projects/pymilter - milter-0.8.2
from email_auth import csv # based on spec from mipassoc.org/csv
##import sid # SenderID from Microsoft
# Methods that require transfer of DATA:
##import dkim # from Yahoo/Cisco
Having avoided name conflicts with other modules, we can now call the csa
function from the csv module like this:
result, SMTP_reply = csv.csa(IP, HELO)
The checkID() module has not yet been added to the package, as it needs a
little more testing.
--
Dave
************************************************************ *
* David MacQuigg, PhD email: david_macquigg at yahoo.com * *
* IC Design Engineer phone: USA 520-721-4583 * * *
* Analog Design Methodologies * * *
* 9320 East Mikelyn Lane * * *
* VRS Consulting, P.C. Tucson, Arizona 85710 *
************************************************************ *
More information about the ietf-clear
mailing list