[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GNU]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GNU\XMail]
MAIL_ROOT=d:\XMail
MAIL_CMD_LINE=
Kurulum ve temel ayarlar için aşağıdaki betiği kullanabilirsiniz:
@echo off
setlocal
REM Note: Port used include 25 for SMTP, 110 for POP, 6017 for Admin services
set INSTALLDIR=%CD%
set MAIL_ADMIN=demoadmin
set DOMAIN=example.com
if not defined DRV set DRV=D:
if not defined HOSTNAME set HOSTNAME=%COMPUTERNAME%
if not defined DOMAIN set DOMAIN=example.com
if not defined MAILROOT set MAILROOT=%DRV%\XMail
if not defined MAILROOT_REG set MAILROOT_REG=%DRV%\\XMail
if exist %MAILROOT% (
echo Stopping XMail Service
net stop xmail
)
unzip -oq %INSTALLDIR%\XMail.zip -d %MAILROOT%
REM
REM Generate and install a registry entries from a .reg file for XMail
REM
echo Generating and setting Xmail registry entries
if not defined XMAIL_REG_FILE set XMAIL_REG_FILE=XMail_gen.reg
echo Windows Registry Editor Version 5.00 > %XMAIL_REG_FILE%
echo. >> %XMAIL_REG_FILE%
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GNU] >> %XMAIL_REG_FILE%
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\GNU\XMail] >> %XMAIL_REG_FILE%
echo "MAIL_ROOT"="%MAILROOT_REG%" >> %XMAIL_REG_FILE%
echo "MAIL_CMD_LINE"="" >> %XMAIL_REG_FILE%
regedit /s %XMAIL_REG_FILE%
del/q %XMAIL_REG_FILE%
REM
REM Create the (1) domains.tab (2) smtpreply.tab (3) server.tab (4) aliasdomain.tab in the mail root directory
REM
REM 1. domains.tab
echo Creating Xmail domains.tab file
echo "%HOSTNAME%.%DOMAIN%" > %MAILROOT%\domains.tab
REM 2. Create empty smtprelay.tab
echo Creating Xmail smtpreplay.tab file
echo. > %MAILROOT%\smtprelay.tab
REM 3. server.tab
echo Creating Xmail server.tab file
echo # > %MAILROOT%\server.tab
echo # Server configuration file >> %MAILROOT%\server.tab
echo # Note : remember to use _REAL_ TABs and double quotes to format this file >> %MAILROOT%\server.tab
echo # >> %MAILROOT%\server.tab
echo "RootDomain" "%HOSTNAME%.%DOMAIN%" >> %MAILROOT%\server.tab
echo "SmtpServerDomain" "%HOSTNAME%.%DOMAIN%" >> %MAILROOT%\server.tab
echo "POP3Domain" "%HOSTNAME%.%DOMAIN%" >> %MAILROOT%\server.tab
echo "HeloDomain" "%HOSTNAME%.%DOMAIN%" >> %MAILROOT%\server.tab
echo "PostMaster" "%MAIL_ADMIN%@%HOSTNAME%.%DOMAIN%" >> %MAILROOT%\server.tab
echo "ErrorsAdmin" "%MAIL_ADMIN%@%HOSTNAME%.%DOMAIN%" >> %MAILROOT%\server.tab
REM
REM Add other settings
REM
echo "RemoveSpoolErrors" "0" >> %MAILROOT%\server.tab
echo "MaxMTAOps" "16" >> %MAILROOT%\server.tab
echo "ReceivedHdrType" "0" >> %MAILROOT%\server.tab
echo "FetchHdrTags" "+X-Deliver-To,+Received,To,Cc" >> %MAILROOT%\server.tab
echo "DefaultSmtpPerms" "MRVZ" >> %MAILROOT%\server.tab
echo. >> %MAILROOT%\server.tab
REM 4. aliasdomain.tab
echo Creating Xmail aliasdomain.tab file
echo "server1.example.com" "%HOSTNAME%.%DOMAIN%" > %MAILROOT%\aliasdomain.tab
REM 5. Create ctrlaccounts.tab with administrator username
echo "admin" "120009060a080054" > %MAILROOT%\ctrlaccounts.tab
echo Mail server: %HOSTNAME%.%DOMAIN%
echo Creating XMail User accounts
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%
set USRLIST=user1 user2 sking jcooper wfaulk jstein istone mtwain jlondon cdickens ltolstoy fkafka szweig mmitch jausten achrist rsteven cdoyle wshake sfitzger
set USRPWD=120009060a080054
for %%i in (%MAIL_ADMIN% %USRLIST%) do (
echo Creating user: %%i
echo "%HOSTNAME%.%DOMAIN%" "%%i" "%USRPWD%" 1 "%%i" "U" >> %MAILROOT%\mailusers.tab
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i
echo "ReceiveEnable" "1" > %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\user.tab
echo "PopEnable" "1" >> %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\user.tab
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\mailbox
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\Maildir
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\Maildir\cur
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\Maildir\new
mkdir %MAILROOT%\domains\%HOSTNAME%.%DOMAIN%\%%i\Maildir\tmp
)
echo Installing XMail Server as a service
%MAILROOT%\bin\XMail --install-auto
echo Starting XMail Server service
net start xmail
echo XMAil Server service started.
endlocal
Kurulum tamamlandığında servisler listesinde XMail adlı bir servis görülecektir.
İstenildiğinde bu servis net stop xmail komutu ile durdurulabilinir.