Tuesday, September 22, 2015

IP : Installing Surgemail and adding mail accounts and How to use


First, you need to download a file. Go to

http://netwinsite.com/cgi-bin/keycgi.exe?cmd=download&product=surgemail&

and choose your Linux distribution. I chose " Linux (All 64 bit variants) " since I have Ubuntu 64 bit.

After downloading, you should have a .tar.gz file , place it in your home folder and extract it by right clicking it. It should give you a folder named "mtemp" and if you don't have any extracting application, then open your terminal and type this 


tar -xvf surgemail_XYZ_linux.tar.gz

replacing surgemail_XYZ_linux with whatever your file is named. Like, my file is named as surgemail_70c2_linux.tar.gz , so i used this command : 


tar -xvf surgemail_70c2_linux64.tar.gz

Now you should have a folder named "mtemp". Now use the terminal and change the directory to this folder using 'cd' command. And now, type

sudo ./install.sh

With this, your installation should start. Press Enter when it asks if it's ok to install in the default the installation path.



Now, type "karupsmail.com" as the full domain name. And type the host name as "mail.karupsmail.com" and then username for web administration as "root" and password as "root" too, and retype it.



Now, it asks for email account for management emails and alerts, and tells the default is "root@karupsmail.com" and now, just press enter.

The installation proceeds.

And it will be complete in a few seconds.




Press enter to exit.

Now, the server is started. To check it, go to

http://127.0.0.1:7026

Now, you will see a web page with many options and buttons. Some of the options that we need are gonna be discusses below. One of them is "Create User Account".



Just click this button and you will be asked the details of the new user. Just type the username and password. And create two users, so that, later, you can use one to send and another to receive.

I have created users : "karuppiah" and "keshav" , with password as their username. So now, their email ids will be "karuppiah@karupsmail.com" and "keshav@karupsmail.com"


Now, you just have to click  "Manager Info" on top left and then click "Web Email Client" and then login to your email accounts to see a GUI interface.









But we have to write java code to actually send mails using code and not using these GUI stuff.

Here's a basic code for Sending and Receiving Text Mail for my mail server :



You can change the code according to your own surgemail configuration ! :)


And finally, you need two jar files : mail.jar and activation.jar which contain the packages which start with the name : javax.mail.x and javax.activation.y

And we import them like 

" import javax.mail.*;
  import javax.activation.*; "

Here are the two jar files :



Place them in

/usr/lib/jvm/Your-Java-folder/jre/lib/ext/

Where "Your-Java-folder" is the name of the folder (containing java files) based on whatever java version you have.

And to place them in the above path, you should have root permissions. So, do it through terminal, using sudo and cp commands. 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.