Community discussions

MikroTik App
 
elmertronics
just joined
Topic Author
Posts: 2
Joined: Sat Oct 17, 2015 8:37 am

Email from/to Gmail Only

Tue May 17, 2022 8:56 am

Hi all. I want to run an email server behind the mikrotik router. I want to receive and send emails from/to Gmail only. How can I implement this to mikrotik router? Thank you.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Email from/to Gmail Only

Tue May 17, 2022 10:01 am

To choose which remote servers / clients to accept, this concerns the mail server configuration, not the RouterBOARD.
To "guess" if you need NAT or just a firewall filter, you have to specify the parameters of the RouterBOARD and the Server.

First of all, clarify what you want and ask a more specific question by providing all the necessary details.

The less details you write, the less help you get.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: Email from/to Gmail Only

Tue May 17, 2022 10:36 am

elmertronics:
I want to run an email server behind the mikrotik router.
Use Firewall DNAT to forward traffic to your MTA.
SNAT to be sure MTA will out the same IP what you use in DNAT.

I want to receive and send emails from/to Gmail only.
on MTA use some whitelist on gmail.com and block others.
You can try filter on Firewall the IP from Gmail servers too.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1041
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

Re: Email from/to Gmail Only

Tue May 17, 2022 10:48 am

Hi all. I want to run an email server behind the mikrotik router. I want to receive and send emails from/to Gmail only. How can I implement this to mikrotik router? Thank you.

As @rextended explained this has very little to do with Mikrotik as such (just a few of filters needed for that). To succeed with relaying using smtp on google mail servers you need a public ip, mx-domain and proper setup of spf/dkim/dimarc (arc) which google is very picky about before any email is let through.

Besides the need for a Corporate or Google Workspace account to setup spf for your domain you have to hijack outbound port 25 to always point to smtp-relay.gmail.com and the other way around to allow only inbound smtp from google. There are plenty of help pages from Google regarding this like: https://support.google.com/a/answer/2956491?hl=en

Who is online

Users browsing this forum: Google [Bot], hatred, PavelRadvan and 78 guests