mail me! sindicaci;ón

Archive for July, 2010

Exim and Exchange

As part of a new project I’ve been working on I’ve had to install and configure an Exchange 2007 server within my home network. I’ve managed to finally get delivery to both Exim and Exchange working, dependent on the address mail is being sent to. Exim works as both a smarthost for Exchange and an independent mail server.

So for example, lm @nothingbutreboots.com goes to Exim (and then onto Cyrus via LMTP), which can be accessed using RoundCube. However, mail to luke.morgan @nothingbutreboots.com gets passed to Exchange. Similarly, Exchange uses my Exim box as it’s smarthost for outbound mail.

Here’s a quick look at the relevant bits of the Exim config files which may give somebody trying to do a similar thing a few pointers:

/etc/exim4/conf.d/router/200_exim4-config_primary

virtual:
driver = redirect
domains = dsearch;/etc/exim4/virtual/
data = ${lookup{$local_part}lsearch{/etc/exim4/virtual/$domain}}
#one_time
no_more

send_to_smart_host:
debug_print = “R: attempting to send to Exchange”
driver = manualroute
domains = ad.nothingbutreboots.com
transport = remote_smtp
route_data = “ad.nothingbutreboots.com”
no_more

send_to_cyrus:
debug_print = “R: attempting to send to cyrus $local_part@$domain”
driver = manualroute
domains = zivi.nothingbutreboots.com
transport = LOCAL_DELIVERY
route_list = +local_domains
no_more

So then you have the relevant domain listings within your virtual folder, which the virtual router will then parse as above and decide which transport to send the mail onto:

/etc/exim4/virtual/nothingbutreboots.com

luke.morgan luke.morgan@ad.nothingbutreboots.com
lm lm@nothingbutreboots.com

For the above to work you’ll obviously need correct MX entries within your BIND config and within your Windows DNS.

Reinstalling IIS6 on an Exchange Server

Following on from this post, it came to a point where I had to face facts – I had to completely reinstall IIS. IIS was working fine, but I was trying to install RSA’s web agent to allow OWA to be secured using SecurID, and the installer was insisting that IIS wasn’t installed. Even after (rather bashfully) running a batch script to register every DLL in the inetsrv folder, it still wasn’t right.

Finally, I decided to give up rooting around in the registry and just reinstall. This is somewhat of a trivial task on a ‘normal’ IIS server, but when you combine it with the half a dozen web apps that Exchange installs, it becomes a little more complex.

Luckily there’s a guide for doing exactly this over at Microsoft’s Support site. However, if you followed the guide and then got the following (all too common) error when trying to access Outlook Web Access (OWA):

Outlook Web Access did not initialize. An event has been logged so that the system administrator can resolve the issue. Please contact technical support for your organization.

This error is commonly caused by a permissions or authentication problem. First, ensure that the owa subdirectory (usually under the ‘Default website’ tree) within IIS Manager has the following authentication methods set:

OWA – Basic
8.1.240.5 – Enable anonymous access
auth – Enable anonymous access
Bin – Enable anonymous access
Current – Basic
forms – Basic
Help – Basic
smime – Basic
spell – Basic

Do an iisreset and try OWA again. If you’re still having problems, your IUSR accounts may have changed password during the reinstall, and IIS won’t be aware of the new ones. Follow this guide here, followed by an iisreset, and hopefully you should now have a functioning OWA.

Strange problems with Windows 2003 x64 R2 & IIS Manager

This post details problems I’ve had with a Windows 2003 Enterprise x64 R2 install, and more specifically the Internet Information Services Manager, and the certicate wizard within.

I’ve had a couple of strange problems with a Windows 2003 install I’ve been carrying out over the past couple of days.

The first is the fact that despite every component Internet Information Services showing as being fully installed in the ‘Windows Add/Remove’ Components dialog, the IIS manager couldn’t be found within Administrator Tools.

The fact that I got the IIS default install webpage when visiting http://localhost confirmed that it was indeed installed. However, if I tried to run iismgr via the command line, the MMC would open with the red cross informing me that “MMC could not create the snap-in”. After a little digging I found a solution to the problem, which is caused by the IIS manager DLL not being registered (for reasons unbeknownst to me). To fix it, run the following in a command prompt (or from Run):

regsvr2 %windir%\system32\inetsrv\inetmgr.dll

You should get the confirmation message box telling you that the DLL has been successfully registered. Close and reopen any IIS MMC and all should now be right.

The next strange problem was found when trying to install an SSL certificate within the IIS manager. Right clicking on the ‘Default Website’ branch and selecting properties, and then clicking on ‘Server Certificate’ within the ‘Directory Security’ tab wouldn’t open the certficate wizard. Clicking on ‘Edit’ had the same result, the certificate wizard just wouldn’t open. Again, this problem is caused by a component not being registered, run the following command to register the Certificate Manager OCX:

regsvr32 %systemroot%\system32\inetsrv\certmap.ocx

Again, you should receive confirmation that the component has registered successfully. Now, if you go back into IIS Manager you’ll see that you can now click on the ‘Edit’ button, but clicking on ‘Server Certificate’ still does nothing. That means that there’s still one more component to register, certwiz.ocx – do so by running the following:

regsvr32 %systemroot%\system32\inetsrv\certwiz.ocx

Et voila! You should now be able to run the certificate wizard.

I haven’t a clue why these two problems have occurred with this particular installation, I’ve done nearly a dozen near-identical installs and never ran into this problem before. I’m just glad it didn’t result in a complete reinstall :)