27 Jan 2021

How To Create Email Account In Webmin


Webmin is a free control panel for webservers. Here I am explaining the way to create a new email account for a domain under your server via webmin control panel.

 

STEP 1: Login to Webmin control panel

http://YourIP:10000

STEP 2: From the left-side Menu, click “System” and then click on “Users and Groups”
STEP 3: Click on “Create a new user” link
STEP 4: Fill in the form with appropriate information,

- Username (if you want to have an email address [email protected] , set the username’s value to demo)
- User ID: leave it automatic
- Real Name: required only for you to identify each account from the list
- Home Directory: Click “Directory” and set it to: /home/ where  is what you set in the Username field
- Shell: Leave it as it is
- Password: click the “Normal password” and type your desired password (it will be encrypted on save/exit)

You will see few more settings/fields on the same form. You may fill them in if you like. However, the above mentioned fields are those required to have a valid e-mail account created. 

FINAL STEP 4: Now click the “Create” button to complete.

You can access the webmail from web browser by using the port 20000

http://YourIP:20000

Thank you for your time. 🙂

 

15 Feb 2018

How to Migrate Email from cPanel to cPanel

When transferring accounts between servers, transferring of email accounts is quite different. Transferring data from one server to another is technically called migration even if it is full website or email accounts or databases. When you perform a full website migration of a cPanel account, you do not need to migrate the emails manually. The cPanel transfer will migrate the email accounts also. As we know, there can be DNS propagation after a DNS change when you migrate your website. In the DNS propagation time, some of the emails coming to your email address may be directed to the old server and some of them to the new server. It should be ensured that you do not loss any valuable emails. This is what makes the email migration different from other migrations. Let’s see how the email account transfer is done for both cPanel and non-cPanel accounts.

Email Migration

Email migration can be performed in two ways, You can either utilize the cPanel interface or use the command line prompt.

In this article we are going to take a look on how to perform the migration in cPanel in order to navigate this process.

Follow the ensuing steps below:

Step 1: Backing up email directories

The first step in the email migration is to backup email directories present in the old server.

1) Login to cPanel interface for the account in question in the old server.

2) Open ‘File Manager’ under the section ‘Files’.

 

 

3) Go ‘Up One Level’ above public_html.

 

 

4) You can see the mail directory there. Enter into the directory.

 

 

5) Right click on the directory and click on the option available to compress the directory.

6) Now, download the compressed file to your computer.

Step 2: Restore email backups

1) Login to the cPanel interface of the new server.

2) Create the email accounts just as you did in the old server. You can create email accounts from the ‘Email Accounts’ section under the ‘Mail’ category.

3) Open ‘File Manager’ under the section ‘Files’.

4) Go ‘Up One Level’ above public_html and you can see the mail directory there. Enter into the directory.

5) Upload the email backup file to the directory.

6) Unzip the backup file and the delete the zip file.

7) Open Webmail and configure it to display the new email folders.

If you need any further assistance please contact our support department.

08 Feb 2018

Cronjob to delete all emails older than one month

Before starting with the cronjob script, we must know the locations where the emails stored in the server. Then we can go to the steps to remove them  Exactly there are three folders in a cPanel based server for managing received emails.

Those are cur, new, tmp. The main differences between these three are listed below

new : This is the folder where all emails are first received.
cur : Is the folder having emails that are opened/read by mail client.
tmp : Is the folder contains processed emails for delivery purpose.

In most cases these emails in the server cause high disk space usage in the server. We can remove older email by using different ways. Here I’m explaining the steps to remove emails older than one month from the server by the help of cron.

To clear old emails from the server means, remove email related files from cur folder under mails directory and all other mail user directory. There are cur and new directories under the mail folder for cPanel default mail and also the same in each users domain directory. ie /home/username/mail/domain.com/***/cur Here *** represents each mail user folder. (admin/ for [email protected])

Step 1 : Creating an executable file with command to remove emails

For simplicity, create an executable file under anywhere (here I selected the location under root) and place the script to remove older mails.

Here I’m using the find command to find and remove mails which are older than 30 days (-mtime switch for finding mails older than 30 days.

[[email protected]]# touch mailcleaner.sh

Edit the file using your favorite file editor

[[email protected]]# vim mailcleaner.sh

find /home/username/mail/yourdomain.com/*/cur -type f -mtime +30 -exec rm -f {} \;
~
 :wq

Then change that file to an executable one. (ie file permission to 755)

[[email protected]]# chmod 755 /root/mailcleaner.sh

Step 2 : Creating CRON job

Next step is to set the cronjob under root (for setting a cronjob refer this link). Here I’m setting the cron job to run every 1 day of the month.

[[email protected]]# crontab -e
 0 0 1 * * /root/mailcleaner.sh > /dev/null 2>&1
 :wq
[[email protected]]# crontab -l : To list all cronjobs.

In this case the file mailcleaner.sh will execute first day of every month and remove all emails older than 30days.

Thank you.

©2021 Tranzmedia Netvision Limited. All Rights Reserved.
Top