-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add support for incoming emails #22056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
5713613
47029bf
e159bb8
7c818d5
ecb606d
90860b6
f7e74bb
b82efef
d85d448
f46ca3f
ed3c24f
28a34fe
80c1466
f7ee50e
35aa103
4e38af3
5387897
a334f55
1834a3f
0beb48a
6b2fe10
b0a2c8f
5094c0d
5066d29
9c54fcf
93b3469
661c367
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -750,6 +750,20 @@ and | |
- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue. **DEPRECATED** use `LENGTH` in `[queue.mailer]` | ||
- `SEND_AS_PLAIN_TEXT`: **false**: Send mails only in plain text, without HTML alternative. | ||
|
||
## Incoming Email (`incoming_email`) | ||
|
||
- `ENABLED`: **false**: Enable handling of incoming emails. | ||
- `REPLY_TO_ADDRESS`: **\<empty\>**: The email address including the `%{token}` placeholder that will be replaced per user/action. Example: `incoming+%{token}@example.com`. The placeholder must appear in the user part of the address (before the `@`). | ||
- `HOST`: **\<empty\>**: IMAP server host. | ||
- `PORT`: **\<empty\>**: IMAP server port. | ||
- `USERNAME`: **\<empty\>**: Username of the receiving account. | ||
- `PASSWORD`: **\<empty\>**: Password of the receiving account. | ||
- `USE_TLS`: **false**: Whether the IMAP server uses TLS. | ||
- `SKIP_TLS_VERIFY`: **false**: If set to `true`, completely ignores server certificate validation errors. This option is unsafe. | ||
- `MAILBOX`: **INBOX**: The mailbox name where incoming mail will end up. | ||
- `DELETE_HANDLED_MESSAGE`: **true**: Whether handled messages should be deleted from the mailbox. | ||
- `MAXIMUM_MESSAGE_SIZE`: **0**: Maximum size of a message to handle. Bigger messages are ignored. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, does this accept the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently it does not accept a human readable notation. I added that only for the packages. Should I make it available for other setting types too? |
||
|
||
## Cache (`cache`) | ||
|
||
- `ENABLED`: **true**: Enable the cache. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
date: "2022-12-01T00:00:00+00:00" | ||
title: "Incoming Email" | ||
slug: "incoming-email" | ||
draft: false | ||
toc: false | ||
menu: | ||
sidebar: | ||
parent: "usage" | ||
name: "Incoming Email" | ||
weight: 13 | ||
identifier: "incoming-email" | ||
--- | ||
|
||
# Incoming Email | ||
|
||
Gitea supports the execution of several actions through incoming mails. This page describes how to set this up. | ||
|
||
**Table of Contents** | ||
|
||
{{< toc >}} | ||
|
||
## Requirements | ||
|
||
Handling incoming email messages requires an IMAP-enabled email account. | ||
The recommended strategy is to use [email sub-addressing](https://en.wikipedia.org/wiki/Email_address#Sub-addressing) but a catch-all mailbox does work too. | ||
The receiving email address contains a user/action specific token which tells Gitea which action should be performed. | ||
This token is expected in the `To` and `Delivered-To` header fields. | ||
|
||
Gitea tries to detect automatic responses to skip and the email server should be configured to reduce the incoming noise too (spam, newsletter). | ||
|
||
## Configuration | ||
|
||
To activate the handling of incoming email messages you have to configure the `incoming_email` section in the configuration file. | ||
|
||
The `REPLY_TO_ADDRESS` contains the address an email client will respond to. | ||
This address needs to contain the `%{token}` placeholder which will be replaced with a token describing the user/action. | ||
This placeholder must only appear once in the address and must be in the user part of the address (before the `@`). | ||
|
||
An example using email sub-addressing may look like this: `incoming+%{token}@example.com` | ||
|
||
If a catch-all mailbox is used, the placeholder may be used anywhere in the user part of the address: `incoming+%{token}@example.com`, `incoming_%{token}@example.com`, `%{token}@example.com` | ||
|
||
## Security | ||
|
||
Be careful when choosing the domain used for receiving incoming email. | ||
It's recommended receiving incoming email on a subdomain, such as `incoming.example.com` to prevent potential security problems with other services running on `example.com`. |
Uh oh!
There was an error while loading. Please reload this page.