Getting started with Digital Ocean VPS: configuring DNS and Postfix for email forwarding

Posted on Sun 31 August 2014 in HowTo • Tagged with dns, postfix, vps, howto, digitalocean, email

I have recently migrated my website from a shared hosting to a dedicated VPS on Digital Ocean. Having a VPS surely gives you unlimited possibilities, compared to a shared hosting, but of course you have to manage some services by yourself.

In my case I only needed: SSH access, LEMP configuration (Nginx + MySQL + PHP) to serve my WordPress blog and Postfix to use email forwarding from my aliases to my personal email.

Configuring DNS on Digital Ocean

Understanding how to properly configure the DNS entries in the panel could be a bit tricky if it's not your daily bread. In particular there is a Digital Ocean configuration that assumes certain things about your droplet, so it's better to configure it properly.

For example the droplet name should not be casual, but it should match your domain name: I initially called my host "andreagrandi" and I had to rename it to "" to have the proper PTR values.

You will need to create at least a "mail" record, pointing to your IP and an "MX" record pointing to (please note the dot at the end of the domain name). Here is the configuration of my own droplet (you will notice also a CNAME record. You need it if you want to correctly point to your ip.


Configuring Postfix

In my case I only needed some aliases that I use to forward emails to my GMail account, so the configuration is quite easy. First you need to install Postfix:

sudo apt-get install postfix

Then you need to edit /etc/postfix/ customizing myhostname with your domain name and add virtual_alias_maps and virtual_alias_domains parameters. Please also check that mynetworks is configured exactly as I did, or you will make your mail server vulnerable to spam bots. You can see my complete configuration here:

Add your email aliases

Edit /etc/postfix/virtual file and add your aliases, one per line, like in this example:

At this point update the alias map and reload Postfix configuration:

sudo postmap /etc/postfix/virtual
sudo /etc/init.d/postfix reload


As you can see, configuring Postfix is quite easy, you just need to be careful when you configure the DNS records in the control panel. Are you curious to try how Digital Ocean VPS works? Fancy 10\$ credit (enough for 2 months if you choose the basic droplet) for free? Use this link and enjoy it

Making Maemo email client usable with GMail

Posted on Sat 08 August 2009 in HowTo, Igalia, Linux, Maemo (EN) • Tagged with client, email, gmail, maemo, modest, recent

I must admit, I wasn't using Maemo email client, because I did find it was simply unusable, at least with my GMail account.

I tried both POP3 and IMAP, but having about 25.000+ messages in my account, downloading just the headers was a job that the client simply couldn't manage.

Yesterday I knew about "recent mode" support in POP3, a functionality that GMail supports too. This mode allow you to download only last 30 days messages (in my case, no more than 1000)  so the client can manage them without any problem.

All you have to do to enable this mode is put the "recent:" string before the username. For example: if your username is "[email protected]" you have to write "recent:[email protected]". Important: this mode only works with POP3, not with IMAP.

To conclude, let me say thank you to the kind guy who let me discover this mode. Thank you Sergio! Now there is another thing I can do with my tablet!