Archive for the 'Tech' Category

Page 2 of 2

Enemies Of Carlotta with Postfix 2.0 and virtual domains

Well, first off, thanks Lars Wirzenius (liw) for this really fine piece of software, it saved me from the mailman hell I was going to enter.

That being said, here’s the setup, with Postfix 2.0 and virtual domains on a Sarge system; the manpage of eoc is slightly outdated wrt to Postfix it seems, so I hope this will be helpful (with apologies to Planet readers for the length of this entry):

  • Create an eoc or whatever user, who will receive the mails and hold the eoc configuration. I created a system user, with a disabled password and /bin/bash as its shell, member of the list group.
  • su - eoc and create your mailing list, with something like

    enemies-of-carlotta --name=testlist@lists.example.com --owner=foo@example.com --create

    Now, add yourself to the testlist:

    enemies-of-carlotta --name=testlist@lists.example.com --subscribe your@email.address

    As eoc places its configuration data in ~/.enemies-of-carlotta, it’s important to run the enemies-of-carlotta command as the eoc user.
  • Edit /etc/postfix/main.cf, and add the file /etc/postfix/virtual_eoc_aliases to the virtual_alias_map configuration item, e.g.

    ...
    virtual_alias_maps = hash:/etc/postfix/virtual_aliases, pcre:/etc/postfix/virtual_eoc_aliases
    ...

    Now, create /etc/postfix/virtual_eoc_aliases:

    #
    # virtual aliases for EOC (mailing-lists)
    #
     
    /^(testlist|testlist-.*)@(lists.example.com)$/ eoc+lists.example.com_$1

    This way, a mail addressed to (testlist|testlist-.*)@lists.example.com will be redirected to eoc+lists.example.com_<whatgotmatched>.

    You’ll need the postfix-pcre package for this to work, and the recipient delimiter must be set to + (recipient_delimiter = + in /etc/postfix/main.cf). Restart postfix.

  • Send a mail to your test list, it should end up in the mailbox of your eoc user. If it doesn’t, check the postfix logs and fix the problem ;-)
  • Create the .forward file in the user’s homedir, here’s its content

    "| procmail -p"
  • Now, create the .procmailrc file for the eoc user. This is what I came up with:

    PATH=$HOME/bin:/bin:/usr/bin
    LOGFILE=$HOME/eoc-log
    ARCHIVES=$HOME/archives
    THISMONTH=`date "+%Y%m"`
     
    # determine the full list name (list@domain)
    :0
    EOCLIST=| eoc-extract-list $EXTENSION
     
    # set recipient to the full list name, ie list@domain
    RECIPIENT=$EOCLIST
     
    # feed the mail to EOC
    :0
    * ? enemies-of-carlotta --name=$EOCLIST --is-list
    {
    # send the mail to the list
    :0 c
    | enemies-of-carlotta --quiet --incoming
     
    # archive it
    UMASK=033
    :0
    $ARCHIVES/$EOCLIST/${THISMONTH}.mbox
    }
     
    # trap other mails ...
    :0
    trapped-mails

    The eoc-extract-list does nothing more than that, at the moment:

    echo $1 | sed -e 's/\([^_]*\)[_]\(.*\)/\2@\1/'

    The trapped-mails mbox file will need to be emptied periodically; actually, I redirect those mails to another address, feel free to pass them on to Dave Null.
    As you can see, the mails get archived in an mbox by the procmail rule. I use mhonarc to generate a web archive from this mbox.

OK, here you are, your test mailing-list should now be functional. Send a mail, and see what happens.

To add a list, all you have to do is:

  • Add the regexp into /etc/postfix/virtual_eoc_aliases
  • Create the list in eoc

The procmailrc doesn’t need to be modified afterwards. It can probably be improved still, but I’m happy with it as it is now.

Now, if someone knows of a mailing-list archiver that doesn’t suck, I’d be glad to give it a try.

European Parliament rejects Software Patents

So, here we are, the European Parliament finally rejected the Software Patents. At last.

With 648 votes against the proposal out of 680 total votes, it’s quite a strong signal towards the European Commission. Hope they’ll learn something from that event.

Thanks to all the folks who worked for that day to happen, especially the FFII and Michel Rocard.

Now, let’s get back to Free Software. We’ve got a C++ transition to do.

Upgrading to Sarge, at last

I upgraded my gateway from Woody to Sarge right after the release, and all went fine on the Debian side. Switching to the 2.6 kernel, while I was at it, has been a bit painful as Linux 2.6 decided it wouldn’t order its network interfaces the same way Linux 2.4 did. I admit that I forgot about that before doing the upgrade.

This week-end, I finally found the time to upgrade my server, and this was a much feared upgrade, as I expected it would take me a whole day to be done with it. It all went rather fine, and I did the whole upgrade in half a day only.

The problems I anticipated were:

  • Switching from Netsaint to Nagios: went fine, as I prepared the Nagios config on a test machine before the upgrade.
  • INN: it just can’t survive an upgrade. Only a couple of minor fixes to inn.conf were needed to get it back up and running — good surprise.
  • NUT: new major version, although I was running a backported version of NUT and no configuration changes were required. But nut-cgi failed to upgrade properly, I had to purge and reinstall it.
  • Postfix/Courier-imap: this is my MX, so, if something goes wrong here, my mail doesn’t arrive anymore. And I absolutely HATE losing mail.

Once everything was back up and running, I switched from Apache to Apache2, then switched to Linux 2.6. The server is much faster now (even with Linux 2.4); especially, deleting mail from my IMAP folders now takes less than a second, where it could take as much as 20 seconds before. Happy I am.

In the end, Debian is still Debian, the upgrades are still painless compared to other distributions, and I love that. Now, if only services could get restarted faster during the upgrade, I’d be even more happy. For now, it’ll do ;-)

Checking for HP C4137A… found.

When I wrote the previous blog entry, I had a quick look at ebay, and didn’t find an offer that would suit my needs and price range.

A few days later, Eric Poehlman sent me a couple of ebay links in a kind email, and there I found what I was looking for: a C4137A-compatible part for 25 Euros, and it’s not even a used one. It got shipped by the seller the same day; I must say that I wasn’t too confident with buying on ebay, but it all went really well.

So my printer is now happy to print big images with its 18 MB of RAM. It’s faster for text too, it doesn’t pause for soooooooo long between pages anymore.

Thanks, Eric!

Fun with PostScript and PDF

A couple of weeks ago, I needed to make a big PostScript file (4x3m, more on this later), and it seems like InkScape won’t let me use an arbitrary format. So I went ahead, googled for a PostScript tutorial, got the BlueBook as the first result and downloaded the reference manual for PostScript level 3 from Adobe.

I must say that PostScript is really a fun language to play with, and I had quite some fun doing something that would have been pretty boring otherwise. Enjoy the power of a complete programing language to automatise a couple of things while you’re at it.

I eventually had a look at the DSC and EPS specifications too, and ended up reading the PDF reference for PDF 1.6. I’m quite disappointed they scrapped the “PostScript is a complete programing language” part. I’m also quite disappointed by the “let’s use byte offsets in the xref table”, which is really painful to manage when writing a PDF file with a text editor, but I admit that it’s probably the best solution.

So, it was time for a cool hack using what I gathered about PS and PDF. Here it is, I added EPS and PDF as output formats for the screenshot in TiLP; the screenshot is written as a raw RGB (or black & white) inline image, compressed with zlib and encoded in ASCII85.

I wish I had learned all of this a year ago, when I had to debug a printing problem with CUPS. Now I can tell what the bug was; CUPS wasn’t honoring the DSC indicating the next page was to be printed on A3 paper with landscape orientation. Instead, the stupid thing added a DSC telling the page was to be printed on A4 paper. If this bug still exists, I’m going to send them a dead-tree copy of the DSC specs, so they can bang their heads against it :-P

Looking for HP C4137A

I’ve been looking at getting some more RAM for my HP LaserJet 1100 (C4224A, not a 1100A) for some time now, but it seems I just can’t find that in France at a decent price. Not even a clone.

An original HP part (16 MB, C4137A) costs about 100-400 USD depending on your vendor. I could find 2 or 3 resellers in France at about 150-200 Euros, but that’s a lot more than what I’m prepared to spend for this printer. Might as well put in the extra 300 Euros it’d cost to get a faster printer (and it would be a color LaserJet, even).

Alternatives are:

  • Smart Modular Technologies: known to work, about 50 USD
  • MemoryX: known to work, about 30 USD, plus 19 USD international shipping
  • Viking: sold on Amazon, known to be incompatible with the LJ1100

I’m >that< close to go and order a module from MemoryX, but the shipping would be 2/3 of the hardware price... which is a bit too much.

The memory needed is a 100-pin EDO DRAM module, which isn't exactly widespread (read: I don't have that lying around in my office).

Hints welcome :-)

IBM/Hitachi HDD reliability … or lack thereof


May 7 14:36:11 arrakis kernel: hde: dma_timer_expiry: dma status == 0x20
May 7 14:36:11 arrakis kernel: hde: DMA timeout retry
May 7 14:36:11 arrakis kernel: PDC202XX: Primary channel reset.
May 7 14:36:11 arrakis kernel: hde: status timeout: status=0xd0 { Busy }

This is the second Hitachi HDD that breaks this year. The first one was a 6-month old 120 GB SATA drive, this one is a 2-year old 120 GB PATA drive.

Oddly enough, I have a couple of 60GXP and 75GXP drives that are still running fine with the updated firmware.

This drive should still be under warranty, but the Hitachi website tells me the warranty expired in Feb. 2004… given that the disk was manufactured on Dec. 2002 and that there’s a 3-year warranty, I’m going to phone them and get my RMA.

If only they could focus a little bit more on reliability instead of capacity … my 10-year old 342 MB IBM drive, my very first hard drive, is still running happily. That really doesn’t match the definition of evolution in my book :-(

Thanks to the Linux software RAID for keeping the server running.