mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-29 23:25:31 +02:00
docs(refactor): Large refactor + additions + fixes
Consistency pass, formatting cleanup and fixes, introduce admonitions, add front-matter. --- docs: Add front-matter --- docs: Fix and format links - Some links were invalid (eg files moved or renamed) - Some were valid but had invalid section headers (content removed or migrated) - Some use `http://` instead of `https://` when the website supports a secure connection. - Some already used the `[name][reference]` convention but often with a number that wasn't as useful for maintenance. - All referenced docs needed URLs replaced. Opted for the `[name][reference]` approach to group them all clearly at the bottom of the doc, especially with the relative URLs and in some cases many duplicate entries. - All `tomav` references from the original repo prior to switch to an organization have been corrected. - Minor cosmetic changes to the `name` part of the URL, such as for referencing issues to be consistent. - Some small changes to text body, usually due to duplicate URL reference that was unnecessary (open relay, youtous) - Switched other links to use the `[name][reference]` format when there was a large group of URLs such as wikipedia or kubernetes. Github repos that reference projects related to `docker-mailserver` also got placed here so they're noticed better by maintainers. This also helped quite a bit with `mermaid` external links that are very long. - There was a Github Wiki supported syntax in use `[[name | link]]` for `fetchmail` page that isn't compatible by default with MkDocs (needs a plugin), converted to `[name][reference]` instead since it's a relative link. --- docs: Update commit link for LDAP override script Logic moved to another file, keeping the permalink commit reference so it's unaffected by any changes in the file referenced in future. --- docs: Heading corrections Consistency pass. Helps with the Table of Contents (top-right UI) aka Document Outline. docs: codefence cleanup --- docs: misc cleanup --- docs: Add Admonitions Switches `<details>` usage for collapsible admonitions (`???`) while other text content is switched to the visually more distinct admoniton (`!!!` or `???+`) style. This does affect editor syntax highlighting a bit and markdown linting as it's custom non-standard markdown syntax.
This commit is contained in:
parent
f13df19b87
commit
021e942c4c
30 changed files with 1369 additions and 1027 deletions
|
@ -1,10 +1,14 @@
|
|||
# Introduction
|
||||
---
|
||||
title: 'Mail Forwarding | Relay Hosts'
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
Rather than having Postfix deliver mail directly, you can configure Postfix to send mail via another mail relay (smarthost). Examples include [Mailgun](https://www.mailgun.com/), [Sendgrid](https://sendgrid.com/) and [AWS SES](https://aws.amazon.com/ses/).
|
||||
|
||||
Depending on the domain of the sender, you may want to send via a different relay, or authenticate in a different way.
|
||||
|
||||
# Basic Configuration
|
||||
## Basic Configuration
|
||||
|
||||
Basic configuration is done via environment variables:
|
||||
|
||||
|
@ -15,57 +19,62 @@ Basic configuration is done via environment variables:
|
|||
|
||||
Setting these environment variables will cause mail for all sender domains to be routed via the specified host, authenticating with the user/password combination.
|
||||
|
||||
Note for users of the previous AWS_SES_* variables: please update your configuration to use these new variables, no other configuration is required.
|
||||
!!! note
|
||||
For users of the previous `AWS_SES_*` variables: please update your configuration to use these new variables, no other configuration is required.
|
||||
|
||||
# Advanced Configuration
|
||||
## Sender-dependent Authentication
|
||||
## Advanced Configuration
|
||||
|
||||
Sender dependent authentication is done in `config/postfix-sasl-password.cf`. You can create this file manually, or use
|
||||
### Sender-dependent Authentication
|
||||
|
||||
```bash
|
||||
Sender dependent authentication is done in `config/postfix-sasl-password.cf`. You can create this file manually, or use:
|
||||
|
||||
```sh
|
||||
setup.sh relay add-auth <domain> <username> [<password>]
|
||||
```
|
||||
|
||||
An example configuration file looks like this:
|
||||
|
||||
```
|
||||
```txt
|
||||
@domain1.com relay_user_1:password_1
|
||||
@domain2.com relay_user_2:password_2
|
||||
```
|
||||
|
||||
If there is no other configuration, this will cause Postfix to deliver email throught the relay specified in `RELAY_HOST` env variable, authenticating as `relay_user_1` when sent from domain1.com and authenticating as `relay_user_2` when sending from domain2.com.
|
||||
If there is no other configuration, this will cause Postfix to deliver email throught the relay specified in `RELAY_HOST` env variable, authenticating as `relay_user_1` when sent from `domain1.com` and authenticating as `relay_user_2` when sending from domain2.com.
|
||||
|
||||
**NOTE** to activate the configuration you must either restart the container, or you can also trigger an update by modifying a mail account.
|
||||
!!! note
|
||||
To activate the configuration you must either restart the container, or you can also trigger an update by modifying a mail account.
|
||||
|
||||
## Sender-dependent Relay Host
|
||||
### Sender-dependent Relay Host
|
||||
|
||||
Sender dependent relay hosts are configured in `config/postfix-relaymap.cf`. You can create this file manually, or use
|
||||
Sender dependent relay hosts are configured in `config/postfix-relaymap.cf`. You can create this file manually, or use:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
setup.sh relay add-domain <domain> <host> [<port>]
|
||||
```
|
||||
|
||||
An example configuration file looks like this:
|
||||
|
||||
```
|
||||
```txt
|
||||
@domain1.com [relay1.org]:587
|
||||
@domain2.com [relay2.org]:2525
|
||||
```
|
||||
|
||||
Combined with the previous configuration in `config/postfix-sasl-password.cf`, this will cause Postfix to deliver mail sent from domain1.com via `relay1.org:587`, authenticating as `relay_user_1`, and mail sent from domain2.com via `relay2.org:2525` authenticating as `relay_user_2`.
|
||||
**NOTE** You still have to define RELAY_HOST to activate the feature
|
||||
Combined with the previous configuration in `config/postfix-sasl-password.cf`, this will cause Postfix to deliver mail sent from domain1.com via `relay1.org:587`, authenticating as `relay_user_1`, and mail sent from domain2.com via `relay2.org:2525` authenticating as `relay_user_2`.
|
||||
|
||||
## Excluding Sender Domains
|
||||
!!! note
|
||||
You still have to define `RELAY_HOST` to activate the feature
|
||||
|
||||
If you want mail sent from some domains to be delivered directly, you can exclude them from being delivered via the default relay by adding them to `config/postfix-relaymap.cf` with no destination. You can also do this via
|
||||
### Excluding Sender Domains
|
||||
|
||||
```bash
|
||||
If you want mail sent from some domains to be delivered directly, you can exclude them from being delivered via the default relay by adding them to `config/postfix-relaymap.cf` with no destination. You can also do this via:
|
||||
|
||||
```sh
|
||||
setup.sh relay exclude-domain <domain>
|
||||
```
|
||||
|
||||
Extending the configuration file from above:
|
||||
|
||||
```
|
||||
```txt
|
||||
@domain1.com [relay1.org]:587
|
||||
@domain2.com [relay2.org]:2525
|
||||
@domain3.com
|
||||
|
@ -73,7 +82,7 @@ Extending the configuration file from above:
|
|||
|
||||
This will cause email sent from domain3.com to be delivered directly.
|
||||
|
||||
### References
|
||||
#### References
|
||||
|
||||
Thanks to the author of [this article][1] for the inspiration. This is also worth reading to understand a bit more about how to set up Mailgun to work with this.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue