With many thanks to Mowgli who listed most of this info, and Townie who has made some very sensible suggestions : Here's a condensed guide with all the relevant bits in one place. I will continue to keep this updated from time to time as we learn more about the system.
A snapshot guide to working around using DDNS for your domain location.
Using mailstation on a home based diskstation or any other location using dynamic IP addresses has the side effect of preventing most outbound SMTP traffic. This is because dynamic IP address ranges are regarded as probable spam originators and ISPs list them at spamhaus as addresses from which to reject outbound email, so commercial mail servers will reject our outbound content.
To send mail from a mail server that is hosted on a dynamic IP address it must be sent via a registered and authenticated mail server. This is acting as a relay for your email and you will usually use the outgoing SMTP server setup by your ISP unless you pay for an account elsewhere. The relay server can be any SMTP server on which you have a valid account.
Configure the Mailstation using the GUI and confirm that incoming mail is working before proceeding.
To setup an outbound mail relay you will need:
1) The name of the SMTP server to use (probably your ISP's SMTP server such as smtp.orange.uk).
2) The user account name on that server and its password. These may well be case sensitive - so be careful.
To enable SMTP relay you need to edit two files on the Diskstation, then run two commands. Then you may need to re-boot the diskstation if it doesn't work immediately.
From the admin GUI enable telnet access to your diskstation.
From your PC or MAC telnet to the diskstation IP adress and login as "root" with the admin password. Do NOT login as "admin" or it won't work.
type cd /usr/syno/mailstation/etc
vi main.cf
Find the first line starting "#relayhost = "
delete the leading "#" and enter the name of your SMTP server to be used as the relay server.
e.g. "relayhost = smtp.orange.uk"
If you are having problems after using the entry above try putting the relay ISP inside square brackets, it prevents DNS lookups.
e.g. "relayhost = [smtp.orange.uk]"
move to the bottom of the file and add the following three lines
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/usr/syno/mailstation/etc/sasl_passwd
smtp_sasl_security_options =
Now save and close main.cf
Now create a password file as follows:-
cat > sasl_passwd
smtp.orange.uk username@orange.uk:password_for_orange_account
Press Ctrl+D to save the file.
To limit access to the password to the "root" user do the following two steps:
chown root sasl_passwd
chmod 600 sasl_passwd
Then type the following to setup the password in a useable form for the mail progran to use it
../sbin/postmap sasl_passwd
Finally re-start the server processing by entering the following command
../sbin/postfix reload
That's it!
Now the mailstation server is will send all outbound mail to the mailserver that you listed as relayhost using the login info from your sasl_password file.
Troubleshooting
If it doesn't take first time you may need to re-start the mailstation task on the diskstation from the gui, or even re-boot the diskstation if you can't find your way around the gui to the mailstation task.
If it doesn't work first time around go back and look for spelling mistakes, and depending upon your server configuration watch out for case sensitivity errors.
Note: There is a problem which can easily cause frustration in the current builds of MailStation (April/May 2010). It is so subtle in its effect that you can lose a lot of time troubleshooting the MailStation setup when there is nothing wrong at the server. Its the client configuration that is at fault:
A user name that is being used to retrieve mail using IMAP is NOT case sensitive.
The same user name, when it is being used to send mail using IMAP IS CaSe SenSiTive.
The passwords are always case sensitive.
So; if you are using a client that shares authorisation details for reading and sending mail, and you can read but not send mail, if the client reports the details correctly you may also see a login failure despite being able to read mail: The first place to look is at the user identity that is being used to login to the server - have you missed a capital letter somewhere?





