SMTP and IPv6, oh my!

This entry is a reminder to myself more than a contribution to any ongoing or dead discussions about this topic. (Thanks to Stoffi for the initial explanation.)

baker (the machine that’s acting as a mail and web server) has had an IPv6 address and AAAA entry for a few weeks now. Unfortunately, some E-Mail servers don’t handle this well. They see this in my zone:

@       IN  MX   10 baker.boinkor.net
baker   IN  AAAA [ipv6 address]
baker   IN  A    [ipv4 address]

and go “I know! I’ll just connect to the ipv6 address!” Unfortunately, not every host is on a part of the net where they can connect to globally-visible IPv6 addresses yet, so that connection fails. Instead of connecting to the fallback IPv4 address, they’ll consider that MX entry broken and fail to deliver mail to me. Despite the volume of spam I get these days, this isn’t what I want.

Indeed, backup MXes are the solution. Here’s a setup that allows the poor broken MTAs to still connect to my mail host:

@           IN  MX   10 baker-v6.boinkor.net
@           IN  MX   20 baker-v4.boinkor.net
baker-v6    IN  AAAA [ipv6 address]
baker-v6    IN  A    [ipv4 address]
baker-v4    IN  A    [ipv4 address]

So, if an affected MTA comes in and fails to deliver to the primary (ipv6-enabled) mail host, they can always connect to the secondary mail exchanger with IPv4.

A silly CL-PPCRE performance test

I read “Regular Expression Matching can be Simple and Fast” today (via DF), and I immediately had to try its test for exponential-ness with Edi Weitz’s excellent cl-ppcre.

Here’s a little benchmark thing (as noted in the article, “a?nan” translates to e.g. “a?a?a?aaa” for n=3):

(defun match-n (n) 
  (let* ((as (make-list n :initial-element #\a))
         (regex (format nil "~{~A?~}~{~A~}" as as))
         (string (make-string n :initial-element #\a))) 
    (time (cl-ppcre:scan regex string))))

which gives me (on an intel iMac):

CL-USER> (match-n 100)
Evaluation took:
  0.008 seconds of real time
  0.007047 seconds of user run time
  9.4e-5 seconds of system run time
  0 calls to %EVAL
  0 page faults and
  4,562,912 bytes consed.
0
100
#()
#()

Tee hee. Perl 5.8.8 has been sitting on the same regex for the last few minutes; according to the article, it’ll take 1015 years. ^C!

Why is this blog-worthy? Regex benchmarks on bodies of #\a characters aren’t very interesting, after all (even if CL-PPCRE defeats Ruby, Perl and pcre, according to the graph). One reason: I really like how easy it was to format the regex from a list of #\as.

(Update: Sure enough, there’s a reddit discussion on the same topic. Note that this post’s purpose is to praise format, not cl-ppcre (-;)

Unintended consequences

asdf-dependency-grovel seems to be more of a hit than I’d anticipated. Not only have I received great feedback from several people, ignas on #lisp already found the first a use case for it that I hadn’t anticipated.

* ignas loves asdf-dependency-grovel
<antifuchs> ignas: it works for you? (:
<antifuchs> cool!
* antifuchs happy
* ignas just finished stripping closure's sgml parser of all the unnecessary stuff by using it

So, it turns out that not only can you use adg to merge two large systems into one, it’s possible to split one system into smaller components, as well! Not too bad for a tool that makes use of (hopefully) unintended consequences in the CL specification.

II - A Discordian shall always use the official discordian document numbering system

Yay memes! I’ve been tagged, and not in the comfortably delicious way.

  1. I hoped for a long time to somehow avoid compulsory military service. When I no longer cared about it, they let me go because I had flat feet.

  2. I like caffeine, but I hate coffee.

  3. In 2000, I wrote a several-kilobyte big two-dimensional bin-packing program in Scheme. The whole program is a good candidate for a Daily WTF front-page post. My favorite is the function named get-fits.

  4. Weird synchronicity seems to follow me around.

  5. I am an Atheist, and a Discordian. Disbelief is a very unserious business.

In order to avoid planet.lispy combinatorial explosion (and further in-breeding of this meme), I’ll tag boinkmarks feeds baker/SBCL:emulated-x86/(:sb-thread), elgar/SBCL:ppc-on-ppc64, elgar/SBCL:ppc-on-ppc64/((not :gencgc)), walrus.boinkor.net/SBCL:x86, baker/CLISP:x86_64 instead of the few planet.lisp bloggers that are still missing (Xof, rudi — you are memetically free for another day). Expect their statements in a few days.