Press "Enter" to skip to content

Category: nuxx.net

SMTP-AUTH for Postfix via courier-authlib (authdaemond)

Getting SMTP authentication working with Postfix via authdaemond on FreeBSD 7.0 without occasional, useless errors in /var/log/messages has just caused me an hour of frustration. Therefore, I wish to document what I had to do to make it work right:

First off, Postfix (mail/postfix) and courier-authlib with MySQL support (security/courier-authlib with AUTH_MYSQL set in the config) must be installed. Setting up courier-authlib to talk to a MySQL db is beyond the scope of this document, but it basically involves setting the following lines:

/usr/local/etc/authlib/authdaemonrc:

authmodulelist="authmysql"

/usr/local/etc/authlib/authmysqlrc:

MYSQL_SERVER localhost
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_PORT 0
MYSQL_OPT 0
MYSQL_USERNAME mail
MYSQL_PASSWORD [OBSCURED]
MYSQL_DATABASE mail
MYSQL_USER_TABLE mailbox
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid
MYSQL_LOGIN_FIELD pobox
MYSQL_HOME_FIELD homedir
MYSQL_MAILDIR_FIELD CONCAT(homedir,'/',maildir,'/')
MYSQL_QUOTA_FIELD quota
MYSQL_NAME_FIELD name

After that is set, Postfix’s main.cf must have SASL enabled with smtpd_sasl_auth_enable = yes. Next, the following smtpd.conf must be placed in /usr/local/etc/sasl2:

/usr/local/etc/sasl2/smtpd.conf

pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path: /var/run/authdaemond/socket

auxprop_plugin: mysql
sql_select: select password from users where email = '%u@%r'

Now, here’s the stupid part. See those last two lines, auxprop_plugin: mysql and sql_select: select...? They don’t do anything, and that SELECT statement won’t even return anything useful on my db. Without them there SMTP AUTH works great. However, if you don’t have those lines there, Postfix will regularly complain loudly with errors such as these:

Sep 4 21:30:02 banstyle postfix/smtpd[47677]: sql_select option missing
Sep 4 21:30:02 banstyle postfix/smtpd[47677]: auxpropfunc error no mechanism available

Please note that with authdaemond, CRAM-MD5 and DIGEST-MD5 authentication mechanisms won’t work. (These would normally be set with mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5.) If enabled they will appear available but won’t work.

One final thing… Want to know how to be sure that the server is notifying clients that it supports authentication? Just simply telnet to port 25 on your mail server and type in EHLO domain.com. The AUTH LOGIN PLAIN and AUTH=LOGIN PLAIN lines show you that plain-text authentication is now available:

c0nsumer@banstyle:~> telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 banstyle.nuxx.net ESMTP Postfix
EHLO nuxx.net
250-banstyle.nuxx.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
QUIT
221 2.0.0 Bye
Connection closed by foreign host.

2 Comments

nuxx.net Mail Move

Tonight I ran into a harsh realization that the setup I’d intended to use for mail administration, Postfix Admin, has no facilities for editing server-side filters. Therefore, I’m moving my old, highly modified vMail.Admin install over to the new server.

Tonight I got everything working and tested except for the web-based front end for Postfix’s database. That shouldn’t be too hard to get going, I just don’t feel like working on it any more tonight. After that is going I will be shutting down mail on the old box and moving it to the new one. During this time you may (read:will) experience problems having mail delivered, checking mail, the works.

Sorry.

Due to how email works nothing should be lost, it might just take a while to arrive. Just keep using secure.nuxx.net for pop3s / imaps or SquirrelMail and everything will work fine.

Leave a Comment

Sites Moved to banstyle.nuxx.net

As mentioned before, I am in the process of moving to a new colo provider while at the same time moving everything hosted on nuxx.net to the shiny new banstyle.nuxx.net.

As part of this I moved all websites to the new server. That means if I host your site, it’s now on the new box. Mail, nor any of the shiny tools used for checking logs and such have been moved; I hope to get to that later in the week.

If you have any problems, please don’t hesitate to contact me.

Oh, and I might be sticking ads on the sites of people for whom I host just simple galleries (aka nuxxfriends). This is to offset the cost of the server and colocation. Hopefully that’s not a problem.

Leave a Comment

Moving from Waveform

Tomorrow I will begin the move away from Waveform Technology to Clear Rate Communications. Within the last six months I have been having a number of weird problems (to be detailed at a later time) with Waveform, prompting the move to a new provider. At the same time I’ll be moving to a much faster box, banstyle.nuxx.net. Provided everything goes as planned I’ll be moved over to the new box by the end of next week.

This means that, during the move, all of you who I host stuff for will be down for a little while. If there are any problems, just get a hold of me and we’ll sort it out.

Leave a Comment

Download Tools

You all know those shiny download tools which open loads of connections on a file to try and get it quicker? Those are crappy and put lots of unneeded load on servers. Here’s an example:

I host this simple page for a friend of mine in the UK for when he needs US-based hosting or some place high speed to distribute files from. As part of this he hosts the animations found on this page, which overall aren’t very big. However, someone in Thailand (125.24.191.195) is deciding to get them as quickly as possible using some stupid download tool.

What I see is that the workload on the httpd is at ~277, up from it’s typical of 2 or 3. netstat shows lots and lots and lots of connections (currently 276) from that box, all of them established.

The http log currently shows 9291 these:

125.24.191.195 rowla.dyndns.org - [11/Jun/2008:16:58:34 -0400] "GET /justin/img/piston_std4.mpg HTTP/1.1" 200 32768 "http://www.wis.co.uk/justin/deltic-engine.html" "Mozilla/4.0 (compatible; MSIE 5.00; Windows 98)"

Load on the box itself is .23, which is tolerable, so I’ll probably let this continue. If it’s still going at midnight I’ll take some action, but for now it’s just a bit of irritation. Yes, I know I could limit connections on a per-IP basis, but I prefer not to do this unless it’s actually a problem. If I do need to block that IP, I’ll probably just fail to return anything on that vhost to that netblock. Hopefully they’ll finish getting their file sooner than that.

If you’d like to see it, here’s the current netstat: netstat_11jun2008_1.txt
Here’s a capture of a minute or so of 45 seconds of traffic with that address. Note that each GET results in a whole conversation of only 10k or so: 11jun2008_weird_1.cap.gz

Leave a Comment

SiI3124 Not Working… Right

Top view of the Koutech PSA421 on the antistatic bag. It has four internal single lane SATA ports.

Thanks to everyone who wished me a happy birthday today. You all made me smile lots. (Yes, I do share a birthday with Karl Marx, and yes, I am now 30.)

I received the SiI3124-based disk controller mentioned earlier, but it didn’t wish me a happy birthday. In fact, it just didn’t work as I hoped. For some reason its on-board option ROM isn’t starting up when the rest of the computer does, so it’s not initializing the disks and making the main BIOS aware of their existence. This prevents me from booting off of them. FreeBSD can talk to the disks on it just fine, but without the BIOS it’s not useful to me.

When I tried the card in my MAME cabinet and it works fine there, so I think something like the following is occurring: The on-board SATA / RAID controller is a SiI3114, and when I disable this via the BIOS, perhaps this somehow disables the SiI3124? Or, perhaps when the controller is enabled, the option ROM from one is interfering with the other? After all, the SiI3114 BIOS still loads and displays. I did also try changing the PCI enumeration order and tried the cards in other PCI-X slots and the lone PCI slot, and none of that produced positive results. The SiI3114 always enumerates first (or not at all?).

As a test I put a classic Adaptec AHA-2940UW (can you believe this card is more than 10 years old at this point?) card in the box and its option ROM displayed just fine. So, the motherboard seems to handle disk controllers in slots, just not this one.

Instead of the SiI3124-based card I really would like a 3ware 9550SXU-4LP, but its $319.99 price tag is a bit hard to stomach. Maybe I’ll just return the card and stick with the onboard controller and software RAID.

Oh, and if you want to see them, there are more photos of the Koutech PSA421 in banstyle.nuxx.net here on page 3 of my gallery.

4 Comments

Southern Tier’s Back Burner

Souther Tier's Back Burner Barley Wine poured into a glass.

Things have been a bit boring around here lately, with me working at my job, working on the new server, riding my bike, and trying to relax a bit, so I just thought I’d post this photo of Souther Tier‘s Back Burner, a decent (and quite hoppy) barleywine which I drank while watching The Life Aquatic with Steve Zissou with Danielle on Sunday night.

Today I got GEOM-based disk mirroring working on banstyle.nuxx.net, but in doing so I realized that the on-board SiI3114 controller only supports SATA/150 (aka SATA I) and thusly no NCQ, which disappointed me. To remedy this I ordered part number N82E16816104007 from Newegg.com, a Koutech PSA421 4-Channel Serial ATA & Serial ATA II 64-bit PCI Host Controller which appears to be a reference (or very standard) implementation of the SiI3124 PCI/PCI-X to 4 Port SATA300 chipset. This should fit in the one usable slot in the case and provide the SATA interface that I really want. I just wish it’d arrive sooner.

Leave a Comment

Loud and Fast

The two Opterons 885 CPUs, seated nicely in the sockets.

Yesterday I received very kindly sent FedEx package containing some spare computer hardware a friend of mine had, a pair of Opteron 885 dual-core 2.6GHz CPUs and 8GB of registered RAM, to be used in my new server.

I’ve been having some problems with it all, but I’m not quite sure what the cause is yet. With all 8 DIMMs fitted the machine kept hanging while installing FreeBSD 7.0. Per my friend’s suggestion I’m trying the install again with only one DIMM per CPU installed, as he said he’s seen problems with a fully kitted out machine installing some OS’, for som reason. For the first half of the memory things have gone just fine, so I’ll finish running through the pieces two at a time. After those tests I’ll run Memtest86+ on discreet pairs of DIMMs, then on the full 8GB.

I might also install XP on it so that I can run SiSoftware Sandra on it for a while, as it’s really good at eating a machine alive.

Unfortunately I can only run these tests during the day because the server is simply too loud to do otherwise. I measured it at 74dB while standing next to it at the keyboard, and the noise seems to be three distinct tones (low, mid, and high) caused by the different fans in the box. It’s really not much different from a siren. The noise is enough to bother me a bit while just sitting around the house doing other things, so trying to sleep while it is running would be just awful.

Oh, and some quick testing last night showed that it ran most things in openssl speed faster than my Mac Pro. Hopefully I’ll be able to run the whole DB from RAM.

Hmm, I just dropped the full 8GB back in there, turned on PowerNow! and ACPI 2.0 and I’m building ImageMagick to see how things go. While that runs I think I’m going to go for a bike ride.

Leave a Comment

Tyan Transport GX28 (B2882)

I just hit submit at Newegg.com to complete the purchase of a Tyan Transport GX28 server with a Tyan Thunder K8S Pro (S2882). As item number N82E16856152008 the barebones server was only $409.99, with $31.24 shipping. Thanks to a friend helping me out with some RAM and some disks which I’ll be able to make redundant I’ll likely end up with a 1U server with a pair of Opteron 800-series CPUs, 8GB of RAM, and mirrored 500GB SATA disks.

This all brings about an interesting question of where to host the new box. I’ve discussed this before, and the more I think about it the more I want to get my box out of Waveform. Things are working fine for now, but I question what will happen if or when the box does start to have problems. The provider I’m most seriously looking at would run $100/mo

So, now I just have to wait for things to be shipped and delivered and then I can start assembling it all. I imagine I’ll let it cook for a few weeks to a month before installing it. It’ll be running FreeBSD 7.0, likely with a custom kernel and world rebuilt specifically for the CPU. I think I’ll also want to give the new ULE scheduler a go, particularly after seeing this presentation (PDF) about where FreeBSD is going.

I’ll continue to stick with lighttpd, although I hope that the OpenSSL bug in 1.4.19 is fixed in ports soon. Disks will likely be mirrored with gmirror, although I will investigate the on-board hardware RAID. I’ll probably also stick with MySQL for the db and Postfix for mail. Basically, nothing will change in that regard.

I may opt to eliminate some individuals I currently host from the box, mostly because I never have contact with them. I don’t mind hosting people, but when the sites sit mostly unused and I have almost no contact with the individuals who use them (except when there are problems, of course), it’s a bit frustrating to keep up maintenance on apps running on the sites. Also, this new provider has stricter limits on bandwidth (1mb, 95th percentile), and I need to be a bit more careful about how it is used. Anyway, if I’m opting to remove your site from hosting I’ll contact you outside of here and provide you with a chance to get your data.

For now I wait, then build. This could be pretty nifty. Oh, and the colocation provider offers IPv6 at no extra charge, so that ought to be fun to play with as well.

Leave a Comment