# VPS with Postfix as outgoing mail server



## knielsen (Sep 3, 2017)

Hi

I'm trying to figure out how to solve my mail server problem the best possible way. 

The reason for this is that my ISP blocks smtp port 25 and that's no problem since they provide a smtprelay server 
I can use to send mail thru. But recently more and more of my mails have been blocked by Google, Hotmail/Outlook 
since they blocked the ISPs smtprelay due to spam.

So I'm looking to setup Postfix on my VPS to use for my mail server at home to relay mail thru, and also a few of 
the VPS I have could use it.

So far I think that I will setup Postfix with I guess SASL for authorization, TLS and DKIM signing for outgoing mails. 
Since this will be sending for mulitple domains I want clamav to scan the mails.

Does any one have have any good suggestions, guide or tutorial to approch this issue? Or is there a better way to solve it?

Thank you for any input.


----------



## obsigna (Sep 3, 2017)

This How To is somewhat dated, however, most of the concepts do still apply:
https://forums.freebsd.org/threads/42507/


----------



## SirDice (Sep 4, 2017)

Definitely make sure you're using authentication to be able to send mail through it. I would also recommend adding something like security/sshguard or security/py-fail2ban. Those will help against the inevitable brute-force attacks you're going to be receiving.


----------



## Martin Garcia (Sep 14, 2017)

Hello, 
Im not an experienced FreeBSD user, however I know some about postfix.
Since you can setup your server behind your ISP, you will need to setup rDNS, MX records to a public static IP in order to send your emails,
Asuming that you have all of this, you can setup your postfix to relay mails for you, using TLS/SASLauth. Your backend can be ldap/mysql or system user.
By the other hand, dont forget to setup dovecot in order to retrieve mails via pop3 or imap

The configuration for postfix is very similar from Linux to Unix.

Hope this helps,

Martin


----------

