Setup XMail
XMail Mail Server
XMail is an Internet and intranet mail server featuring an ESMTP server, POP3 server, finger server, TLS support for SMTP and POP3 (both server and client side), multiple domains, no need for users to have a real system account, SMTP relay checking, DNS based maps check, custom (IP based and address based) spam protection, SMTP authentication (PLAIN LOGIN CRAM-MD5 POP3-before-SMTP and custom), a POP3 account syncronizer with external POP3 accounts, account aliases, domain aliases, custom mail processing, direct mail files delivery, custom mail filters, mailing lists, remote administration, custom mail exchangers, logging, and multi-platform code. XMail sources compile under GNU/Linux, FreeBSD, OpenBSD, NetBSD, OSX, Solaris and NT/2K/XP.
--------------------------------------------------------------------------------------------------------------------------------------------------------
arrow: UPDATED 12/10/2007
XMail, Dovecot, Cyrus IMAP and many more MTA, MUA related softwares can now be installed as easy as typing in a line of text and hit enter thru Optware/IPKG.
Here are the details on how to install Optware/IPKG.
Once installed type in this to install XMail:
1. ipkg install xmail
this to install dovecot:
1. ipkg install dovecot
and this to install Cyrus IMAPD
1. ipkg install cyrus-imapd
Once installed and configurated you can then download their web
interface.
For XMail you can download here.
For Roundcube you can download here.
--------------------------------------------------------------------------------------------------------------------------------------------------------
Step by Step Installation Guide
Step 1. Download the file package
Download the all-in-one package HERE onto the /share/Public directory on your NAS:
Step 2. Install XMail chroot environment
Telnet/SSH to your NAS. Upon command prompt type:
For TS-109 & TS-209 with single disk:
# mkdir /share/HDA_DATA/Xmail
1. chmod 700 /share/HDA_DATA/Xmail
For TS-209 running RAID1:
# mkdir /share/MD0_DATA/Xmail
1. chmod 700 /share/MD0_DATA/Xmail
then untar
# cd /share/Public
1. tar -zxvf xmail-1.24_phpxmail-1.5_ARM-chroot-tsx09.tar.gz
1. cd xmail-1.24_phpxmail-1.5_ARM-chroot-tsx09
For TS-109 & TS-209 with single disk:
# tar -C /share/HDA_DATA/Xmail -zxvf arm_chroot.tar.gz
For TS-209 running RAID 1:
# tar -C /share/MD0_DATA/Xmail -zxvf arm_chroot.tar.gz
Step 3. Port Forwarding
Forward these ports:
6017 (xmail remote control access)
25 (smtp)
110 (pop3)
from your router to your NAS. Besides, obtain a DDNS account and setup in the Network Config/DDNS section of your TS-109/209 if you don't have a static WAN IP and a registered domain name. I was able to use my DDNS address (xxx.dyndns.org) as my POP3 and SMTP mailserver hostname as well as my mailserver's domain name (eg. test@xxx.dyndns.org).
Step 4. create an CTRL admin account for XMail
To creat an account/password we will need to Telnet/SSH to the NAS again :
chroot
For TS-109 & TS-209 with single disk:
# chroot /share/HDA_DATA/Xmail
For TS-209 running RAID 1:
# chroot /share/MD0_DATA/Xmail
use the built-in application to generate encrypted password, if say your password is "password".
1. XMCrypt password
It should output this:
1. 15041616120a1701
This is the encrypted value for the "password". Although one already created as an example in the file package I will demonstrate how to do it as below:
1. vi /var/MailRoot/ctrlaccounts.tab
press "i" for insert mode then type in:
admin
press 'tab' once and type:
15041616120a1701 (the password)
Then press "Esc" then ":wq" then "Enter" to save and escape out vi mode.
To start Xmail type:
1. /etc/init.d/xmail start
1. exit
To check we issue "ps" to see whether or not the daemon is up and running (you should see an entry like this /bin/XMail).
1. ps -ax
Step 5. Install PHPXmail
Untar phpxmail from where we untarred the whole package at Step 2.
1. cd /share/Public/xmail-1.24_phpxmail-1.5_ARM-chroot-tsx09
1. tar -C /share/Qweb zxvf phpxmail1.5.tar.gz
Now open up your browser and type in "http://your-nas-ip/phpxmail/
you should then see this screen below if you have successfully started your XMail server demon.
Image
Now click on "Add new server" then type in the server infomation as below:
Server hostname: qnap.kicks-**.net (Your NAS' Domain Name, or simply your DDNS name if you don't have a FQDN (Fully quarlified domain name).)
Server port: 6017 (Just leave it as default)
CTRL account: admin (The one we created at Step 4)
CTRL password: password (The one we created at Step 4 too)
Then click on "Submit" you will be brought to the log-in page and just log in with the details you just set. Once in you can start to create your mail users or configure other settings as needed.
Un-installation / Remove
To uninstall Xmail:
Simply delete the entire chroot environment. (you might wanna back up your mails before you do this.)
For TS-109 & TS-209 with single disk:
# rm -rf /share/HDA_DATA/Xmail
For TS-209 running RAID 1:
# rm -rf /share/MD0_DATA/Xmail
To uninstall PHPXmail:
Same here just delete the entire script folder.
1. rm -rf /share/Qweb/phpxmail
Optional Tips and Tricks
1. To get Xmail to start automatially on every reboot.
1. mount /dev/mtdblock5 -t ext2 /tmp/config
1. cd /tmp/config
1. vi autorun.sh
(add the following startup command to the file - autorun.sh)
1. chroot /share/HDA_DATA/Xmail/etc/init.d/xmail start
Save and close.
1. chmod 755 autorun.sh
1. cd /
1. umount /dev/mtdblock5
2. To save your bills and have full rights on mailserver administration.
Simply pick up your phone and cancel your mail hosting after successful installation.
(Nah, this one i am just kidding) :lol:
Configuration and references
So does it really work? Well I've successfully sent/received mails using it so the answer is 'yes'. As for details regarding the server config and how to use Xmail, I guess I'll leave that to you with the information and resources below. Good luck!
XMail configuration
http://www.xmailserver.org/Readme.html#configuration
XMail admin configuration
http://www.xmailserver.org/Readme.html# ... n_protocol
PHPXMail support forum
http://nextcode.org/forums/
Changelogs - 2007.11.12
*re-compress the chroot archive (arm_chroot.tar.gz) without the folder arm_root so your get straight to the root of chroot directory once decompressed.
*change the MailRoot location from /share/Xmail/MailRoot to the original location /var/MailRoot also edited the daemon file /etc/init.d/xmail to reflect the new path.
*moved the main executable binaries under /var/MailRoot/bin to /bin for ease of global access.
*remove the need for renaming sendmail to sendmail.foo
*add the "Un-installation / Remove" section.
*add the "Optional Tips and Tricks" section