cacert.pem   -  CA root certificate
cert.pem     -  Site certificate
privkey.pem  -  Site private key 
caroot.cer   -  CA root certificate for users to import his/her CAPI Store to trust the mail server 
		certificate.
                You can put it on your <RaidenMAILD>\webimages for users to download and import 
		on his operation system.
                download url sample:  http://webmail.yourdomain.com:81/webimages/caroot.cer
		You can provide the link in the login.html template.

************************************************************************************
How to build your site certificate with MaildSSLPackage (packed by openssl win32)

download link: http://www.raidenmaild.com/download/MaildSSLPackage.zip

Please follow the steps below carefully. It is easy but need you to pay attention.

PS1: All pass phrase for raidenmaild issue is 1234 only!

PS2: If you have multiple domains thus you need several Common Names in certificate.
Please open openssl.cnf to edit [alt_names] sections to add alternative common names.

===================================================================================
STEP1: Execute 1MakeCaRootKey.bat
	Enter PEM pass phrase: 1234
	Verifying password - Enter PEM pass phrase: 1234

Result: ca.key will be generated.


STEP2: Execute 2MakeCaRootCert.bat
	Enter PEM pass phrase: 1234
	Country Name (2 letter code) [US]: TW
	PS: This is COUNTRY field. ex: US - United State, TW - Taiwan...so on.
	state Or Province Name [New York]: New Taipei
	PS: This is STATE field. 
	Locality Name (eg, city) [New York]: ChungHe
	PS: This is CITY field.
	Organization Name [none]: Team John Long Software
	PS: This is ORGANIZATION field.
	Organizational Unit Name [none]: R&D
	PS: This is DEPARTMENT field.
	Common name (eg, TU nombre, website) []: mx.raidenmaild.com
	PS: This is COMMON NAME field. The address you will use to connect to server. MX record value is suggested.
	email@adress.com []: xx@xxx.com
	PS: This is EMAIL field. Input your email here.

Result: ca.crt will be generated.


STEP3: Execute 3MakeServerKey.bat
	Enter PEM pass phrase: 1234
	Verifying password - Enter PEM pass phrase: 1234

Result: server.key will be generated.


STEP4: Execute 4MakeServerReq.bat
	Enter PEM pass phrase: 1234

	*** Following field must be the same as STEP2 ***

	Country Name (2 letter code) [US]: TW
	PS: This is COUNTRY field. ex: US - United State, TW - Taiwan...so on.
	state Or Province Name [New York]: New Taipei
	PS: This is STATE field. 
	Locality Name (eg, city) [New York]: ChungHe
	PS: This is CITY field.
	Organization Name [none]: Team John Long Software
	PS: This is ORGANIZATION field.
	Organizational Unit Name [none]: R&D
	PS: This is DEPARTMENT field.
	Common name (eg, TU nombre, website) []: mx.raidenmaild.com
	PS: This is COMMON NAME field. The address you will use to connect to server. MX record value is suggested.
	email@adress.com []: xx@xxx.com
	PS: This is EMAIL field.

	a password []: <== no need, just press [enter] to continue.
	bussines name optional []: <== no need, just press [enter] to continue.

Result: server.csr will be generated.


STEP5: Execute 5SignServerCert.bat
	Enter PEM pass phrase: 1234
	Check that the request matches the signature
	Signature ok
	The Subjects Distinguished Name is as follows
	countryName           :PRINTABLE:'TW'
	stateOrProvinceName   :PRINTABLE:'New Taipei'
	localityName          :PRINTABLE:'ChungHe'
	organizationName      :PRINTABLE:'Team John Long Software'
	organizationalUnitName:PRINTABLE:'R&D'
	commonName            :PRINTABLE:'mx.raidenmaild.com'
	emailAddress          :IA5STRING:'xx@xxx.com'
	Certificate is to be certified until Feb  6 08:45:35 2004 GMT (365 days)
	Sign the certificate? [y/n]: y

	1 out of 1 certificate requests certified, commit? [y/n] y
	Write out database with 1 new entries
	Data Base Updated

Result: server.crt will be generated.
	ca.db.index.old will be generated.
	ca.db.serial.old will be generated.
	ca.db.index will be updated for new cert.
	ca.db.serial will be updated for new cert.
	<serial>.pem will be generated for new cert ( certificate content ).


STEP6: Execute 6PrepareMaildSSLFiles.bat

Result: necessary files will be copied to \Output directory and rename to 
	correct filename for Maild usage.
	Then you can copy the files in \Output to your <Raidenmaild>\SSL directory.

STEP7:	If your user wants to connect to your POP3 SSL or WebMAIL SSL, he must download the caroot.cer 
	from you first and double click on it to import the ca root certificate to trust your server, 
	then he will not popup a dialog to warn him while he connects to your SSL servive.


That's all.
Thanks for your time.

======================================================================================
Author: Arnor
Email: arnor@raidenftpd.com
