TheGeekery

The Usual Tech Ramblings

Mail Relaying in Sendmail

I’ve always been in favor of removing the standard Sendmail install on most Linux boxes, in favor of Postfix. I’ve found it easier to use, and easier to configure. Having a simple configuration file that doesn’t need compiling is always helpful too. However, in some cases, you really don’t like to touch the delicate balance of an ancient server, in fear of it falling over in a spectacular death.

Due to the nature of a lot of viruses, our firewall blocks outbound SMTP, with the exception of a few hosts. This allows for services to use the server as a mail relay, whilst not allowing infected clients to send bad emails. Due to this, I had to figure out how to reconfigure sendmail on one of our servers to use our postfix based server as a mail relay. This actually turns out to be relatively easy, a single line in the /etc/mail/sendmail.mc file. The bit that caught me was getting it to work.

RedHat is nice, in that they supply a make command in the /etc/mail directory to build new configurations. However, for some reason, the default install of sendmail is missing some critical files that allow the rebuild of the configs to work. The first step to setting up the relaying was to add the line:

DEFINE(`SMART_HOST',`my.relay.host')

This was added into the /etc/mail/sendmail.mc file. Then the idea is you’re supposed to be able to execute:

make -C /etc/mail

This spewed out some data about it processing the directories. I then recycled sendmail. I gave the new setup a quick test, and found it was still trying to direct send. I verified the files, and it was configured right. However, I noticed something odd. Using ls -lt I found the sendmail.cf file (the compiled configuration file) had not been updated. This was odd, as it should have built it.

Having had experience with modifying the sendmail configurations before, I knew the make command was simply issuing an m4 command to compile the configurations. On a hunch, I tried running the command myself:

m4 sendmail.mc > sendmail.cf

This is where the hint of the issue came in…

Cannot open /usr/share/sendmail-cf/m4/cf.m4

So I was missing files required to build the new configuration files. A quick google search showed I needed to have the sendmail-cf package installed. As RedHat 9 is pretty old, I didn’t expect the RedHat FTP servers to still hold the files, so I hit RPMFind, and searched for sendmail-cf. A handful of results returned, but I found the one specifically for RedHat9.

After downloading the RPM file, and installing it using rpm -Uvh file I was then able to execute the make command as I had done before, but this time with a little more success (the files updated). Now it was time to restart sendmail again… This wasn’t as successful….

sendmail[24223]: NOQUEUE: SYSERR(root): No local mailer defined
sendmail[24223]: NOQUEUE: SYSERR(root): QueueDirectory (Q) option must be set

That’s not right. So a quick look in the sendmail.mc file again, I found that the local delivery option was not set, so I added the following line:

MAILER(local)

Then rebuilt the configurations using the make command again, and restarted Sendmail. This time with some success. I then tested the connection, ensuring that it relayed through the remote server…

sendmail[24468]: l7FFWqWF024468: from=jon@netdork, size=45, class=0, nrcpts=1, msgid=<20070815
1533.l7FFWqWF024468@origsmtp_server>, proto=SMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
sendmail[24472]: l7FFWqWF024468: [email protected], delay=00:00:13, xdelay=00:00:01, mailer=relay, pri=300
15, relay=my.relay.host [172.16.10.5], dsn=2.0.0, stat=Sent (Ok: queued as A979D6BCB4)

Now the server is behaving as I need it to.

Pending Storms...

Here are some scary numbers…

  • 2 Million
  • 10 times bigger than any other known
  • 46.2 Million
  • 99%

What are they? Stats from InformationWeek regarding the Storm worm that is zooming around. That’s 2 million computers, 10 times larger than any other email attacks, 99% of 46.2 million malicious emails tracked. This looks like it could be a big one, with some substantial damage.

Honesty

It’s not that often you see honesty from a software company, at least not entirely about everything they can/can’t do. Usually I like to blame this on the sales department trying to get that sale. However, in this case, it really is the software developers being totally honest.

Whilst trying to build a new disk in vmware for one of my servers, it decided to tell me something useful…

Creating monolithic preallocated disk

It sure was, well, pretty large anyway… 20GB.

Hunting IP Conflicts on a Windows Network

Earlier today, somebody mentioned not being able to get to the internet, but didn’t seem to be having any issues getting to local resources (file server, printers, etc). They also mentioned that they had seen a meesage about IP address conflicts with another computer. This is a little interesting trying to debug, because how do you query a host that is conflicting the IP with another machine? If you’re lucky, one of your queries might go to the conflicting host, othertimes it might not.

Minor annoyances with Mozilla

Something has been bugging me since I started using Firefox, and Thunderbird, and sadly it has little to do with the actually application, but rather the site for both of the applications.

The first was the Mozilla team’s decision to use the same file extension for their application extensions (plugins). Why is this annoying? Go install both Firefox, and Thunderbird, open Thunderbird, and select the “Get Extensions”. Now, from inside firefox, select any extension, and click it… Firefox will then proceed to complain it’s not compatible. Of course, they put instructions on what to do with the instructions (save to disk, yada yada), but why do I have to jump through an extra 3 steps, when I can simply click a link for Firefox to perform the same operation?

The second, again related to extensinos, is their site. Go to the Mozilla main site , and click on Add-ons. It defaults to Firefox. While I know the majority of people will want Firefox add-ons, it’s relatively easy to click on the Thunderbird link on the side… Here is the kicker… Go back to the main page, and click on the “New! Thunderbird 2” link, and then click on Add-ons… it still takes you to Firefox.

A third minor annoyance is related to the “crashed” restarts. Sometimes it’s nice to resume a session after the browser has crashed, however, I’ve never done it… And in fact, I think Firefox has only crashed on me twice in the 2 years I’ve been using it. At least, crashed in the sense that it generated an error whilst I was using it. I get the “restore” stuff quite frequently. Sometimes I’ll close firefox, and restart it 15 minutes later to it. It didn’t crash, or at least not a visible crash, I had actually asked it to close. Then there is the incidents of closing it, and it not actually closing. I know in those cases, it’s usually a third party plugin (flash, java, etc), so I’ll let it off there. Another time I usually get the resume sessions is right after start up. I know exactly why too. I often shut down windows, with several applicatinos running. Why? Because Windows tells the other apps to close before it shuts down. If it doesn’t respond in a timely manor, it prompts the user to terminate them. Firefox has never prompted me to terminate it in this incident, but on start-up, considers this a “crash”.

I’m sure the crash stuff has an entry in the about:config, that can disable it, but I’d sure love an entry in the generatl settings to manage it. The other two issues are probably minor, and just something that gets under my nose… oh well… [/rambling rant]

Comment of the day

Whilst attempting to debug some work issues with a vendor today, I stumbled across some amusing comments in the code..

We need to find a model for you. Easy there tiger, we’re talking cars here…

We need to stop here to ask a few questions to Bubba!

We (what is this we shit) I know what model you are !!!

That’s about the scope of the fun I’ve had today. Now I have to knock together a test harness to try and figure out what is throwing an exception from a DLL, which is being used by IIS. If you didn’t know, throwing an exception from a DLL is a bad idea. This is usually because the error cannot properly be handled by the upstream application. In this case, an exception dialog pops up informing of the failure, but as it is IIS, the dialog goes nowhere, and lets IIS hang itself.

Nico Rosberg for the win...

Can’t but help laugh when watching F1. During qualifying, there was a quick interview with Nico Rosberg over performance issues with his car.

I have a good feeling, but I’m not allowed to say, as last time I got a good bollocking

To which the person quizing him responded…

Could you translate bollocking for our American audience?

The response was what got me…

Erm.. yea sorry… erm… no

Finding Foreign Keys in MS SQL 2000

I’ve been asked to perform an upgrade for one of our vendors to a new version of our software. Unfortunately their data is still stored in the old DB format, and app pages. We figured the easier way to perform the upgrade would be to migrate their data to the new format, rather than trying to upgrade their existing version of the application.

Phew...

I’ve forgotten just how exhilarating it is to blast around a track at night on a mountain bike, with tunes jamming away in your ears…

Phew… Now to get back into the rhythm for the triathlon.

Suddenly a perfectionist

Somehow, in the last couple of weeks, I became a perfectionist on some projects. Not sure why, or where it came from, but a small application I’m working on, has suddently become a lot bigger than I had originally planned it. The original goal was a simple todo/request tracker, It’s now got quite large, in that I’ve included AJAX for some autocomplete fields, and it is entirely XHTML compliant. Not sure exactly where, or why, I went to this little perfectionist state, but I’ve found that by doing it, I blasted through a whole bunch of tasks last night.

Oh well, once i’m done, maybe I can release the app, and make millions… wishful thinking.