Postfix on home server with static IP

hello…
greetings everyone
i’m about to set up home server with static IP using CentOS 7 and Virtualmin
do i have to open ports on my router? like 80 port for web and 25 for mail server? or 80 port is enough to run web and mail server too?
is there other ports i should open through my router? advice me please

@cezar those ports bellow should be all you need to be running your server from home :+1:

port number, connection, connection, description

21,TCP,UDP,FTP
22,TCP,UDP,SSH
25,TCP,UDP,SMTP
53,TCP,UDP,DNS
80,TCP,UDP,HTTP
110,TCP,UDP,POP3
143,TCP,,IMAP
443,TCP,UDP,HTTPS
587,TCP,,SMTP SUBMISSION
993,TCP,,IMAP SSL
10000,TCP,UDP,WEBMIN
from 49152 to 65534,TCP,UDP,FTP PASSIVE MODE

Edit: if you not use ftp dont open ports for ftp and passive ports range for ftp… ssh would be okay. Also if you dont want to have access to webmin/virutalmin login page from outside of your lan network, keep port for webmin out from your router, but then you would have to use https: //lan-ip-of-your-server:10000 instead of your-domain.com:10000. I hope it helps.

@unborn thank you so much for the quick response, i really appreciate it

1 Like

@cezar no problem :+1:

…you can mark my reply as solution to close this topic or perhaps ask more questions if you have.

ok i have one more question please, in my router port forward options, i should put my static IP right? it won’t let me put it

@cezar on your router you need to setup static ip for your server… its lan ip… like local ip for your server and then you can forward those ports to the server ip…

so anything or anyone type your public ip will go via that port to your server ip only which is local ip provided by router to your machine…

yourdomain.com which is hosted on port:80 is your public-ip ----> lan-ip-of-your-server:80

example:

yourdomain.com ---> 192.168.1.100:80 

If you need help to set this up I can help you, even via chat on whassap. Edit: I mean phone call and navigate you via camera or something…


i’m not sure if i understand i upload photo for my router port forward settings, there is something called local host as you can see in the photo, what should i put in this box? my local router IP address? or server IP?
thank you for being so nice i will try to inbox you my number

@cezar I did try to call you 4 times on whatsapp but could not get answer from you. not your local router ip, your local server IP not your public IP. It would be much easier if spoken over the whatsapp.

Edit I have teamviewer on my laptop, but it would be better if you do it so you can then remember it… remote support is optional if you want.

Hello,

When you manage to fix port forwarding on your router, you should also contact ISP to configure reverse dns.
Otherwise I would say most of your emails will be rejected.

Regards

1 Like

@aplima true but this could be done with proper dmarc and dkmi setup as well… but for permanent solving I agree with you.

@unborn thank you so much i figured it out, reserve DNS can’t be set from webmin?

@aplima thank you for your input but can’t it be set from webmin?

Hi @cezar it can be done, however it really requires more work and period of checkups each other week. Calling your isp would be easier perhaps they would be an obstacle you can always achieve… First of all test it all and if any problems, just pop up back into forums. I’m glad you hosting yourself on your own!

@cezar it was nice to speaking to you, see, its easier when we speak… please consider to use debian os for your server or keep using it centos - both are very very stable and secure… however it would be easier for you to use your dns on your own as I said on phone. gosh I would love to have your isp as my isp provider :slight_smile: anyway speak to you in agreed day and lets solve this for you. good night (i am sorry but my cold is killing me today) cya later.

it was my pleasure @unborn i solved my issue, it was so easy i just had to use my domain name register basicDNS service i’m using namecheap, then i make 3 A records which are www and @ and * those three must point to my static IP and boom my websites are online, i was putting my ISP name server in my domain zone that’s why it was not working, but there is little issue, when i enter my static IP on browser i get my router login page, and also when i accessed my website mydomain.com through the same network from another computer i get my router login page, but when i access my website from outside the network it works fine, any idea? thank you again for being really nice and helpful i truly appreciate it

I’m surprised your local ISP had port 25 open.

@jimdunn actually it was not open i spent hours trying to make postfix work but no success,
i have been having issue with sending emails since 8 years, i couldn’t find solution to this, my IP always get blocked or blacklist, and believe me i never send spam,
i’m about to open social network website and as you know these kind of websites require much emails to be sent, notifications emails like welcoming emails , forgotten passwords and the usual notifications emails,
i was looking for SMTP companies online and found amazon SES i joined them but i found out they have 200 email limit per day, you can ask to increase that, i did ask them to increase that and i was surprised they replied after 12 or 13 hour and refused, i can send 200 email using yahoo or any email provider! why they call it service then!
however i’m still looking for such company to handle all emails in my server, can’t find company with responsible price, setting up my own email server won’t work unless i have like at least 30 or more IPs rotation, any advice guys? EDIT: i wonder how all these websites handle their emails

If the number of outgoing email messages you need is reasonable, I could offer you the use of my postfix / virtualmin install as a pass through upstream server. Or if you need help with setting up virtualmin + postfix on your own server, I could help you with that too.

@calport hello thank you so much for offering your help, i’m currently trying to connect my email home server to external IPs that i own on paid VPS hosting, since my home server ISP IPs block port 25, just to test, i would really appreciate some help from you

I have had the same problem on a server I run on Alibaba. They block port 25 on the VPS. I had to use an external Virtualmin VPS as smarthost to the Alibaba VPS in order to be able to send email from the Alibaba VPS. I had issues with Amazon Lightsail too. On the Virtualmin VPS I run off AWS, the hostname and reverse DNS was set to their internal domain by default. I was able to reconfigure the hostname of course, but my request to AWS for reverse DNS was unanswered. For this VPS too I had to use an external Virtualmin VPS as smarthost. So yes, I do have some experience with this and can help you.

There are two ways I configure postfix to work as smarthost:

  1. give IP based permission to relay mail
  2. give domain based permission to relay mail

There is a third way - of providing a SMTP account via which your entire VPS can send email but that’s not the right way to go about doing this, so let’s leave it at that.

How would you like to proceed @cezar? If you have a static IP on your home server, please share it with me and I can add it to my postfix config so that all domains (created at present or ones you will create in future) on your home VPS can send email through a smarthost. If you do not have a static IP then you must share each domain name that has to send email from your VPS so that I can configure postfix to relay email for those domains.

Awaiting your response.