Thursday 3 March 2011

setting up xmail server on windows (xp)

Notes on how to setup XMail Server on Windows XP
------------------------------------------------

(Instructions are copied and modified from these sites - http://xmailforum.homelinux.net/index.php?showtopic=3438
http://www.halfdone.com/Articles/XMailInstall/
)

1.1) Download XMail server, & Extract to a temp folder.
http://xmailserver.org/xmail-1.27.win32bin.zip

1.2) Copy the mailroot folder to c:\

1.3) Copy these 5 exe files from the unzipped folder to the C:\Mailroot\Bin Folder
ctrlclnt.exe,mkusers.exe,sendmail.exe,XMail.exe,xmcrypt.exe

1.4) Copy these 2 dll files from the unzipped folder to the C:\Mailroot\Bin folder
libeay32.dll ssleay32.dll

1.5)Add a hostname for your machine
Edit C:\Windows\System32\drivers\etc\hosts file using notepad,
Add an entry for domain name
Eg: 127.0.0.1 test.mydomain.com
Please remember that tab should be used, not spaces.
Ping test.mydomain.com (or your domain name you entered) and make sure it is resolving.

1.6) Edit server.tab file
-Add values for : RootDomain,SmtpServerDomain,POP3Domain,HeloDomain (Replace all instances of xmailserver.test with your domain name. Eg: Replace all instances of xmailserver.test with test.mydomain.com)

- Add valid PostMaster & ErrorsAdmin addresses for your domain. (Optional)
- #"EnableAuthSMTP-POP3" "0" take out the # to enable this. Prevent's relaying. See forum
- #"SMTP-RDNSCheck" "1" Take out the # to enable.
- #"CheckMailerDomain" "1" Take out the # to enable.

Note: You need to use REAL TABS in config files! And not Spaces!!!!

2) Download XMail installer
http://xmail.eye-catcher.com/files/tools/XMInstaller/XMailInstaller.zip

2.1) Unzip, & Open Xmail Installer. This is not an application that you install to the system. It just helps with configuring Xmail. Very easy to use. Just fill in the blanks!

- Xmail root: Path to xmail ( c:\mailroot )
- Xmail Location: Path to xmail.exe ( C:\mailroot\bin\xmail.exe )
The Tabs at the bottom of Xmail Installer: (This is how mine are configured)
- POP3 - Tick port 110,Max thread count 30, Session Timeout 300, Bad login delay 240, Enable logging.
- SMTP - Tick Port 25, Max thread count 30, Session Timeout 300, Max Recipients 100, Enable logging.
- Smail - Tick Thread count 30, Retry Timeout 38, Increment Ratio 5, Enable Logging.
- Ctrl - Tick Port 6017, Max thread count 2, Enable Logging.
- LMail - Tick Thread count 110, Enable Logging.

You will see that adding values to the Tabs as described above that values were added at "Mail Command Line" These are the values that gets written to Windows Registry. You need to make the Values Permanent now by clicking on : "Update Registry" Button. This writes the "Mail Command Line" values to the registry.

Now you need to add xmail as a Windows Service. Just click on the "Install Service" Button.Now you need to start Xmail. Just click on the "Start Service" Button
That is that! If ever you need to change any of these settings or values, Just open Xmail Installer and change them. Do not forget to click "Update Registry" button to make the changes to the registry when you have changed values!

You can now close Xmail Installer.

3) Add an administrator account

3.1) Run xmcrypt.exe (from command line) to create an encoded password. It's used in the format of XMCRYPT.EXE .

eg: C:\Mailroot\bin\xmcrypt password

3.2) CTRLACCOUNTS.TAB contains the usernames and passwords for admin access. It has a format of "username" [tab]"password" [newline]
(eg: "admin" "15041616120a1701"
)
3.3) close the file (make sure of double quotes, and new line in the end)

4) Install Xmail Administrator. This is to manage and configure your domains and users on Xmail. This is installed on your server and you will use this app to Manage Xmail Server.
http://www.webifi.com/xmail/XMailAdmin0.26-installer.zip

When you install it it will ( Maybe ) Ask to overwrite MSCOMCTL.OCX The file in the installer is OLDER then the one on Windows. DO NOT OVERWRITE IT!

Create a shortcut on the desktop for Xmail Admin and then you can open it.
Add your xmail Server to manage!

ServerName - My Xmail Server. (it can be anything)
Server Address - IP of your xmail Server. (or domain name)
Port - 6017 - This is the default port for xmail Admin. It can be changed. It is listed in Step 2 ( - Ctrl) But leave on default port for now.
Login Name - This was the User ID Spesified in Step 3
Password - This was the password Spesified in Step 3

Click on Add Server When all info is Correct
You will see that your server is added on the left.

So to add your domain (test.mydomain.com as an example) add test.mydomain.com in the "Add new Domain" field. Then click on "Add new Domain"
You will see your domain added on the left.
Now you can add users and passwords, Specify Max mailbox size, add redirection, download mail from another pop3 account to the current users account.... etc!
This is where you manage your domain and users now!
(Note: Create two users with passwords atleast).

Basic XMail server setup is done.

5. To test, download Thunderbird e-mail client
www.mozillamessaging.com/thunderbird

5.1 Create accounts for users you created in the xmail server.
5.2 Add the following settings: (for POP mail server)
Server name: your domain name (eg: test.mydomain.com)
Connection Security: None
Authentication Method: Password, transmitted insecurely.

(Repeat the same steps for the second account also)

5.3 Configure an SMTP server entry with the following settings
Server Name: Your domain name (eg: test.mydomain.com)
Connection Security: None
Authentication Method: No Authentication

5.4 For each account, set the outgoing server (SMTP) to this entry

You should be able to test sending emails between these two accounts now.