How to block internet - only outlook and gmail can use

hello, need help i want to block my LAN from accessing the internet only the EMAIL.
OUTLOOK and GMAIL .

is that possible, or software that can block website can do.

any suggestions really appreciate.

thanks

I don’t know of any easy way to do it with the firewall as there are probably a lot of sites that those services connect to and you would need to identify them and then white list them as the only sites allowed through.

e2guardian in “walled garden” mode (block everything), then you make an exception list to allow the sites you desire.

Note that google requires over 10 different exceptions, if you are letting Youtube through, you will need most of them. Add in Google Docs/Drive and you need pretty much everything except the ads and some tracking sites.

This is not a simple way to do this, but is probably the only way to get the job done. Also note that as things shift to encrypted “everything”, it gets harder and harder. Encrypted DNS will defeat this completely, unless you run a certificate on the server/firewall and force all computers to run through that cert’s encryption. You’ll now get some browsers throwing up errors about “man in the middle” attacks.

It’s a project that you’ll need to spend more than a few hours getting done.

Why not block all outgoing ports except SMTP, IMAP and IMAPS? You could tighten these up by restricting to Google and Microsoft Server IPs but that is more difficult as they have quite a few.
This means using a mail client rather than MS and Google webmail interfaces.