spf-discuss
[Top] [All Lists]

Re: MS-Caller-ID to SPF converter (cid2spf.pl)

2004-02-25 05:34:05
On 25 Feb 2004 at 11:05, Ernesto Baschny wrote:

On 24 Feb 2004 at 16:47, Meng Weng Wong wrote:
A Perl script that does cid2spf would be even better.  Who's handy with
XML::Parser?

I wasn't handy with XML::Parser, but it isn't that difficult, as I
noticed. Here is the result of my experiments with it:

  http://www.baschny.de/spf/cid2spf.pl

Being in the perl-mood, here is the same stuff in form of a perl module,
which can be used from other scripts:

  http://www.baschny.de/spf/LMAP-CID2SPF-0.9.tar.gz

This also includes the cid2spf script, so this will be the thing
that I will be maintaining. Should install with the standard
"perl Makefile.PL; make; make test; make install" procedure.

Two ways of using the module:

OO:
        require LMAP::CID2SPF;
        $c2s = LMAP::CID2SPF->new();
        $c2s->cid("<ep xmlns='http://ms.net/1'>...</ep>");
        $spf = $c2s->convert();

non-OO:
        require LMAP::CID2SPF qw(cid2spf);
        $spf = cid2spf("<ep xmlns='http://ms.net/1'>...</ep>");


-- 
Ernesto Baschny <ernst(_at_)baschny(_dot_)de>
 http://www.baschny.de - PGP: http://www.baschny.de/pgp.txt
 Sao Paulo/Brasil - Stuttgart/Germany
 Ernst(_at_)IRCnet - ICQ# 2955403