Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

There is one thing worse than not having a test suite

UP­DATE: There is *an­oth­er* *bet­ter* test suite It is in YAM­L, though, so I need to parse it be­fore I can use it, but that's my prob­lem.

It's hav­ing a test suite that makes no sense.

I have writ­ten, for my ra-­plu­g­ins project (y­ou don't have to know what it is for this post any­way) a piece of code that tries to check mail senders us­ing SPF.

SPF is an open stan­dard. It has stan­dard im­ple­men­ta­tion­s. It has a test suite (http://www.schlit­t.net/spf/test­s/).

The test suite says this:

spf­query -ip=192.0.2.1 -sender=05.spf1-test.­mail­zone.­com -h­elo=05.spf1-test.­mail­zone.­com re­sult /.*/ fail smt­p-­com­ment /.*/ ex­pla­na­tion head­er-­com­ment /.*/ spf­query: do­main of 05.spf1-test.­mail­zone.­com does not des­ig­nate 192.0.2.1 as per­mit­ted sender re­ceived-spf /.*/ Re­ceived-SPF: fail (spf­query: do­main of 05.spf1-test.­mail­zone.­com does not des­ig­nate 192.0.2.1 as per­mit­ted sender) clien­t-ip=192.0.2.1; en­velope-from=­post­mas­ter@05.spf1-test.­mail­zone.­com; helo=05.spf1-test.­mail­zone.­com;

So, yeah:

$ spfquery -ip=192.0.2.1 -sender=05.spf1-test.mailzone.com -helo=05.spf1-test.mailzone.com
fail
Please see http://www.openspf.org/why.html?sender=05.spf1-test.mailzone.com&ip=192.0.2.1&receiver=spfquery
spfquery: domain of 05.spf1-test.mailzone.com does not designate 192.0.2.1 as permitted sender
Received-SPF: fail (spfquery: domain of 05.spf1-test.mailzone.com does not designate
192.0.2.1 as permitted sender) client-ip=192.0.2.1;
envelope-from=05.spf1-test.mailzone.com; helo=05.spf1-test.mailzone.com;

So, the stan­dard im­ple­men­ta­tion does what the test suite says.

Too bad that, if you both­er check­ing the URL you are told to "please see"...

The do­main 05.spf1-test.­mail­zone.­com has pub­lished an SPF pol­i­cy, how­ev­er the pol­i­cy is neu­tral on whether 192.0.2.1 is au­tho­rized to send mail on its be­half.

Ei­ther both the test suite and the sam­ple im­ple­men­ta­tion are wrong, or the site is wrong. And I am lean­ing to­wards "the test suite is wrong", be­cause...

$ host -t txt 05.spf1-test.mailzone.com
05.spf1-test.mailzone.com descriptive text "v=spf1 default=deny"

If you check the record syn­tax (http://www.open­spf.org/SPF_Record_Syn­tax) de­fault is an un­known mod­i­fier, and should be ig­nored, so the record is sim­ply "v=spf1", and in­deed the re­sult is neu­tral and there is no rea­son why this should be a fail.

My qmail-courier-whatever munin plugins

A few peo­ple have asked me for the code. Ok, here it goes.

First, get qm­rt­g.

Then you need this: qmunin.­tar.bz2

Then build and in­stall it. You may need to mod­i­fy the sources, de­pend­ing on just how your qmail work­s. There are some ex­am­ple munin plug­ins in­clud­ed (in span­ish, I am not trans­lat­ing them ;-), which 99% sure­ly will not work for you, but they are sim­ple shell script­s, so you should be able to hack them.

Cre­at­ing a re­al re­lease of this is just use­less, be­cause ev­ery­one's qmail logs look dif­fer­en­t, so take it and hack it.

And that's it.

To the other three guys (or gals)....

... who own a HP Jor­na­da 720 and are us­ing Opie on it and they have the span­ish/lat­in-amer­i­can key­board­... here is your keymap.

I will write some­thing about how to get Lin­ux go­ing right on it soon, but here's the sta­tus re­port, 48 hours in.

This ba­by (un­named yet) has:

  • 32MB of RAM

  • 1 GB of Flash

  • Wifi (802.11b pcm­­ci­a) + IR­­DA + Eth­er­net (pcm­­ci­a) + Any­thing once I find a 16-bit pcm­­ci­a-USB card (any­one has a spare and wants to re­­cy­­cle it? ;-)

  • De­­cent bat­tery life (6 hours use with wifi, 9 with­­out)

  • A key­board

  • A de­­cent screen (640x240)

  • A de­­cent Lin­ux-based GUI (Opie)

  • A some­what er­rat­ic touch­screen

So, what can I do with it:

  • Email

  • Web brows­ing ( With Kon­­queror good­­ness )

  • Pro­­gram­ming (Python, even PyQt2!). They key­board and screen are sur­pris­ing­­ly de­­cen­t.

  • eBook read­­ing. This is the most im­­por­­tant one. In my work, I spend a lot of time wait­­ing. Wait­­ing for the train to ar­rive, for the trip to end, for some­one to come to a meet­ing, for the wait­­er to bring my meal, for stuff to com­pile, for stuff to down­load­­... maybe I wait 3 hours a day. So I read. And this screen (long and some­what thin) is quite spec­­tac­u­lar for read­­ing. Opie-read­­er is pret­­ty good.

  • MP3 and Video play­er (haven't used it yet). I have stream­ing TV at home, cour­tesy of Cher­ryTV (check the links at the left­­). This should work great when Rosario wants to see Mon­te­cristo and I'd rather see Penn & Teller's show.

  • Gen­er­al PIM stuff. Al­though I tend to keep that stuff in my head and my phone.

The bad side:

  • The bizarre screen as­pect ra­­tio con­­fus­es many con­­fig­u­ra­­tion di­alogs.

  • Al­­most no game works un­­less you ro­­tate the screen.

  • The key­board con­­fig­u­ra­­tion took a while, and is not per­­fect yet ( I can't make dead­­_a­­cute work for some rea­­son)

  • The ex­­tra but­­tons don't work (ex­ter­­nal au­­dio recorder, and alarm light-but­­ton)

  • I can't find a way to bind the func­­tion keys to apps in Opie

  • The re­set but­­ton does­n't work (it's now a hang but­­ton)

  • Sus­pend is not re­al­­ly sus­pend on Lin­ux (for un­avoid­able hard­ware rea­­son­s), so it spends bat­tery when sus­pend­ed (may last 12 hours or so, I think).

  • The on­­ly way to re­al­­ly turn it off is to take out the bat­tery (not as bad as it sound­s).

  • If you do that, it takes about one minute to boot.

So, I am us­ing it more as a lap­top (although a re­al­ly, re­al­ly small one, with very, very good bat­tery life :-) than as a PDA.

The small mem­o­ry and CPU means I can't run very de­mand­ing stuff, but I nev­er seem to do that, any­way.

And of course, the re­al­ly bad thing: it's so much fun to hack with, I have trou­ble work­ing!

All in al­l, a great toy, lots of fun, and rather use­ful.


Contents © 2000-2020 Roberto Alsina