Thursday 22 January 2015

Send email from your own domain using Zoho and Gmail

Gone the days that Google allowed people to send email as contact@mydomain.com using their gmail account for free. Now you need to buy on of Google app products to do so.
But worry not and don't rush to buy a personalized email solution for your domain!  You still can do that with a little help from Zoho and in  this excellent post in which , Dimitrios Savvopoulos explains how to do that flawlessly. 

We will use a combination of Zoho Mail and Gmail.

Before proceeding with the Zoho setup, we have to own or create a Gmail account. When ready, proceed with creating a Zoho account:

 

Zoho setup

At the moment of this writing, Zoho offers free email for up to 10 Users, using a custom domain. Visit the zoho registration page and go for the free option:

Then enter your domain name and your personal details:
The zoho account is almost now complete:
Now click "Proceed to verify domain ownership". To verify your domain I suggest adding a TXT record in your DNS settings. Select TXT Method:
Follow the given instructions to add the TXT record to your dns settings. When ready, click the verify button.
Awesome! Now add a user for your email and skip the groups setting. Then, go to the MX Records page. Click "Proceed to Point MX".
You will now have to enter the following mx records to your dns. Also remove all other existing mx records.
We skip the steps about email migration and mobile access. Click "Proceed to Access ZohoMail".
Now, go to your mail inbox and go to the settings. Then select Email forwarding and POP/IMAP and apply the following settings:
As you can see, we are forwarding all our emails to our gmail account. We also delete the copies from the zoho inbox to prevent exceeding the space limit. Since gmail has a bigger size limit, this would be the first one to reach the limit, but we don't want that.
Then we disable the POP Access and enable the IMAP Access.

 

Gmail settings

We want to use gmail only as a storage medium, therefore we have to configure it to send mail as our domain email.
Open gmail and go to the settings, and then to accounts and import. Select "Add another email address you own" and enter your name and your domain email.
Next, we enter the smtp settings of our zoho account:
And finally, confirm your email address.
If you enabled forwarding from zoho mail already, the confirmation email should be received in your gmail inbox.

Tuesday 20 January 2015

Simple bash command to convert all tables in a mysql database to utf8

  for t in $(mysql --user=root --password=admin  --database=DBNAME -e "show tables";);
    do 
       echo "Altering" $t;
       mysql --user=root --password=admin --database=DBNAME -e "ALTER TABLE $t CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;";
    done
Source