Skip to main content

Ralsina.Me — Roberto Alsina's website

RaSPF: A C SPF library


RaSPF is a C port of the ex­cel­lent PySPF Python li­brary.


RaSPF aims to be:

  • Com­­pli­ant to the SPF RFC and am­­mend­­ments.

    For that goal, I am mak­ing ex­ten­­sive use of test suites, and right now it pass­es all the tests in the of­­fi­­cial SPF test suit­­e, and has no di­ver­­gences with PySPF in over 300 test­s.

  • Sol­id.

    I am mak­ing ex­ten­­sive use of tools like Val­­grind, and li­braries to han­­dle dic­­tio­­nar­ies and strings, try­ing to avoid the com­­mon pit­­falls of C.

  • Main­­tained.

    Once the first two goals are achieved, this one should be easy, since on­­ly track­­ing stan­­dard changes will be nec­es­sary.

  • Re­spon­­sive to us­er re­quest­s.

    You have a prob­lem? Please let me know! I want peo­­ple to use RaSPF, and I want it to be GOOD. Please use the Google is­­sue track­­er for the pro­jec­t.

  • In­­­clu­­sive.

    I will hap­pi­­ly give SVN write ac­cess to any­one who asks for it and shows his met­­tle with a patch for an out­­­s­tand­ing is­­sue.

  • Well doc­u­­men­t­ed.

    This is the weak­est point right now, and the next thing to be at­­tacked af­ter com­­pli­ance is achieved.

    You can help by do­ing things in the Google Wi­­ki of the pro­jec­t.

  • Freely us­able.

    The code is un­der the Python Li­­cense, which is a MIT/B­SD style li­­cense. How­ev­er, I am us­ing EX­CC which is un­der the GPL. That makes the whole li­brary GPL for all prac­ti­­cal pur­­pos­es. The EX­CC au­thor is in­­ves­ti­­gat­ing re­li­­cen­s­ing, so this prob­lem should go away soon.

    Right now, don't use RaSPF on any­thing that's not GPL.


You have two choic­es:

  1. Use the spf_check func­­tion. Read the raspf­­query sources for an ex­am­­ple.

  2. Use the spf_­­query ob­­ject and all the spf_­­query_* func­­tion­s. The API is sim­i­lar to PySPF's.


  • You need a C com­pil­er and CMake

  • En­ter the sources fold­er, and run ./

Getting RaSPF

At the mo­men­t, there is no of­fi­cial re­lease, un­til the SPF test suite is passed. I don't in­tend to en­cour­age use of non-­com­pli­ant soft­ware.

How­ev­er, for test­ing pur­pos­es, you can use the SVN code at the Source Page at google code.

Contents © 2000-2023 Roberto Alsina