Ray: Experimental

My Visitor

Like this site!

Wanna help other found this site? +1 us now!

Google +1 Button Privacy Policy

Synology Tags

My WebHost

I recommend hostgator, here is why.

Synology DS101j usage series 14: Setup Postfix SMTP server with gmail relay

Install Postfix on DS101j

* many tutorial I found from the web told me create client certificate in order to use gmail as relay. But the fact is that client certificate is NOT a must in order to talk to gmail SMTP. I just want the installation as simple as possible because all I need is to send out some alert email and some snapshot from the IP cam.

1. Login to the admin console. Create a user ‘mail’ and a group ‘mail’.

2. Telnet/SSH as root. Install postfix using ipkg. (uninstall xmail first if it is already existed)

# ipkg remove xmail
# ipkg install postfix -force-depends

Make sure cyrus-sasl and cyrus-sasl-libs are installed as well, if not..)

# ipkg install cyrus-sasl
# ipkg install cyrus-sasl-libs

3. Edit the configuration /opt/etc/postfix/main.cf

myhostname = my ddns domain name
mydomain = my ddns domain name
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.80.0/24,127.0.0.0/8
relayhost = [smtp.gmail.com]:587

# SASL authentication
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/opt/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_type=cyrus

# TLS
smtp_use_tls = yes
smtp_tls_CAfile = /opt/etc/postfix/cacert.pem

alias_maps = hash:/opt/etc/aliases
alias_database = hash:/opt/etc/aliases

Change the value 192.168.80.0 to your network address.
Leave the rest of the options as default.

4. Create sasl password file, then hash it using postmap command

# vi /opt/etc/postfix/sasl_passwd
smtp.gmail.com user@gmail.com:password

replace user@gmail.com to your own gmail address, replace password to your gmail password.

# chown root:root /opt/etc/postfix/sasl_passwd
# chmod 600 /opt/etc/postfix/sasl_passwd
# postmap /opt/etc/postfix/sasl_passwd

5. Edit /opt/etc/postfix/transport

# vi /opt/etc/postfix/transport
* smtp:[smtp.gmail.com]:587

6. Download the cacert.pem (I doubt this is necessary, but it won’t hurt doing this)

# cd /opt/etc/postfix
# wget http://curl.haxx.se/ca/cacert.pem

7. Start the postfix server

/opt/etc/init.d/S69postfix

Now my cheap IP cam can send out email alert and snapshot though my DS101j :)

Love my DiskStation.

4 comments to Synology usage series 14: Setup Postfix SMTP server with gmail relay

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Before you submit form:
Human test by Not Captcha