Code Monkey home page Code Monkey logo

ps.mta-sts's Introduction

PS.MTA-STS

PowerShell-Mail Transfer Agent-Strict Transport Security | Enhancing mail flow by deploying and testing MTA-STS for Exchange Online using this PowerShell module.

Logo - E-Mail flying around planet earth. This is the logo for this project.

This module is for you, if you ...

  • ... want to improve the security of your mail flow
  • ... use Exchange Online for mail flow
  • ... have lots of domains and want to deploy MTA-STS for all of them
  • ... have an Azure subscription and want to deploy MTA-STS using Azure Static Web Apps or Azure Functions
  • ... want to test your MTA-STS configuration using PowerShell

Why MTA-STS?

MTA-STS is a new internet standard that improves email security and delivery for your organization. MTA-STS leverages the well-known security standard HTTPS, which is used to secure connections to websites, to enable organizations to assert policies and requirements for their email services. MTA-STS also enables organizations to request that remote email servers deliver email messages over a secure connection and to report back on any failures encountered. This helps to ensure that email messages are delivered in a secure and reliable manner.

SMTP MTA Strict Transport Security (MTA-STS)

Defined in rfc8461

MTA-STS consists of two Parts:

  • MTA-STS TXT DNS Record
  • MTA-STS Policy

MTA-STS TXT Record

This DNS Record indicates that the Domain supports MTA-STS. The id can be literally anything it's usualy just a datetime value of the last change.

_mta-sts.example.com.  IN TXT "v=STSv1; id=20160831085700Z;"

MTA-STS Policy

The MTA-STS Policy is located at the "./well-known/" directory and contains a Text file with the Policy https://mta-sts.example.com/.well-known/mta-sts.txt

For Exchange Online the mta-sts.txt looks like this

version: STSv1
mode: enforce
mx: *.mail.protection.outlook.com
max_age: 604800

SMTP TLS Reporting (TLSRPT)

Defined in rfc8460

This DNS Record allows the Sender MTA to send Reports (similar to DMARC) to a defined Emailadress or a HTML Site for reporting purposes. While Microsoft does not offer a Service to aggregate these Reports, there are plenty of TLSRPT Data providers that can do this Job.

_smtp._tls.example.com. IN TXT "v=TLSRPTv1;rua=mailto:[email protected]"
_smtp._tls.example.com. IN TXT "v=TLSRPTv1; rua=https://reporting.example.com/v1/tlsrpt"

What does this module do?

This module supports you at deploying and testing MTA-STS for Exchange Online. It will help you to create the required DNS records and to configure the MTA-STS policy for your domain. It will also help you to test the MTA-STS policy and to troubleshoot any issues you might encounter.

How to install this module?

You can install this module from the PowerShell Gallery.

#Install Module using PowerShellGet
Install-Module -Name PS.MTA-STS

#Install Module using Microsoft.PowerShell.PSResourceGet
Install-PSResource -Name PS.MTA-STS

MTA-STS Deployment

You have two options to deploy MTA-STS for your domain(s) using Azure:

  1. Deploy MTA-STS using Azure Static Web Apps
  2. Deploy MTA-STS using Azure Functions

One major difference is, that Azure Static Web Apps allow you to add 5 custom domains per app, while Azure Functions allow you to add 500 custom domains per app. So if you want to deploy MTA-STS for more than 5 domains, you must deploy a Azure Function App or alternatively multiple Azure Static Web Apps.

If you want to deploy a Azure Static Web App to host your MTA-STS policy, check out the original deployment guide.

If you want to deploy a Azure Function App to host your MTA-STS policy using this repository, check out the PS.MTA-STS deployment guide.

No matter which option you choose, you will end up with a Azure resource that hosts your MTA-STS policy. In both cases, you will be able to use

  • 'Export-PSMTASTSDomainsFromExo' function to get a csv file containing your accepted domains with MX record validation
  • 'Test-MTASTSConfiguration' function to test your MTA-STS configuration for all provided domains

For more information about the functions, import the module and use 'Get-Help' to get the help for the functions.

Import-Module -Name PS.MTA-STS
Get-Help -Name Export-PSMTASTSDomainsFromExo -Full
Get-Help -Name Test-MTASTSConfiguration -Full

Resources / Links

ps.mta-sts's People

Contributors

bohrenan avatar jklotzsche-msft avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.