Synology usage series 26 – Install MailStation


Tested Firmware: 3.1
Tested DS: DS207+

It is quite simple to have the DiskStation provides email account for your user. I don’t use diskstation to send email, I use gmail smtp instead. It is not a good idea to use the smtp provided by diskstation for home because we cannot setup reverse DNS record for our temporary i.p. address. Other mail server in the cloud will regards our mail is spam and have it discarded.

Assumption
– use afraid.org DNS server
– your primary domain name is mydomain.com
– your sub domain assigned to diskstation is ds207p (so your diskstation is ds207p.mydomain.com)

  1. The first thing to do is to create dns entries for the mail server resided in our diskstation. Two DNS entries is required because most DDNS client only update type A record. So MX record should point to a type A record and then have DDNS client update your ip address to the type A record instead of MX record.

    DNS entry 1

    DNS Type: MX
    Subdomain: ds207p
    Domain: mydomain.com
    Destination: 10:mx.mydomain.com

    DNS entry 2

    DNS Type: A
    Subdomain: mx
    Domain: mydomain.com
    Destination: ip address of your diskstation

    Again, use any DDNS client to update DNS entry 2 for every ip changes. Otherwise you are losing your mail. However there are still chances mail will not able to deliver during ip changes so it is strongly recommend to have static ip for mail station.

  2. Enable user home

    File Sharing and Privileges > User > User Home > enable user home

  3. If you need webmail, then install the mail station 2 package.
  4. Setup port forwarding from the router. Add port 25 and forward to the diskstation.

    Using tomato as example:

    Protocol: TCP
    Source Address: [empty]
    Ext Ports: 25
    Int Port: [empty]
    Int Address: ip address of diskstation.
    Description: SMTP

  5. Add a firewall rule from your DSM and allow port 25 to be accessible by public.

    Create a new firewall rule, in the “Ports” section, click ‘Select from a list of built-in applications’, then click the ‘Select’ button. Scroll down the long list and select ‘Mail Server’ with ‘Port 25’/Protocol Mail (SMTP). If you want POP3 and/or IMAP, click them as well. To finish, click ‘OK’ button below.

    For ‘Source IP’ section, click ‘All’. For ‘Action’ section, click ‘Allow’.

  6. Done! Now all DS user have email address like user@ds207p.mydomain.com!




Leave a Reply

Your email address will not be published. Required fields are marked *