Skip to content

Commit 4a63526

Browse files
committed
Fix direct links to plugin sources
1 parent 0d2c4f0 commit 4a63526

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

plugins/README.md

+22-22
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,57 @@ See the [sample configuration file](../emailproxy.config#L42) for further applic
55

66

77
## Sample plugins
8-
- [`Echo`](plugins/Echo.py): An example plugin that does nothing except call `log_debug` with all received messages.
8+
- [`Echo`](Echo.py): An example plugin that does nothing except call `log_debug` with all received messages.
99
As a result, it is not specific to IMAP, POP or SMTP, and can be used with any type of server.
1010

11-
- [`IMAPCapabilityModifier`](plugins/IMAPCapabilityModifier.py): An example plugin that intercepts a single IMAP `CAPABILITY` response and modifies it to remove support for `LITERAL+` (chosen only as a common example for demonstration purposes; this is not a useful plugin).
11+
- [`IMAPCapabilityModifier`](IMAPCapabilityModifier.py): An example plugin that intercepts a single IMAP `CAPABILITY` response and modifies it to remove support for `LITERAL+` (chosen only as a common example for demonstration purposes; this is not a useful plugin).
1212

13-
- [`IMAPCleanO365ATPLinks`](plugins/IMAPCleanO365ATPLinks.py): An example IMAP plugin that looks for Office 365 Advanced Threat Protection links (also known as Safe Links in Microsoft Defender for Office 365) and replaces them with their original values (i.e., removing the redirect).
13+
- [`IMAPCleanO365ATPLinks`](IMAPCleanO365ATPLinks.py): An example IMAP plugin that looks for Office 365 Advanced Threat Protection links (also known as Safe Links in Microsoft Defender for Office 365) and replaces them with their original values (i.e., removing the redirect).
1414
As with most of the proxy's plugins, it would be more efficient to handle this on the server side (i.e., by disabling link modification), but this is not always possible.
1515

16-
- [`IMAPLinkDestinationRevealer`](plugins/IMAPLinkDestinationRevealer.py): An example IMAP plugin that looks for links that appear to show a URL, but whose text doesn't match the link's actual destination (its `href`), and makes this more visible by replacing the original link destination with the text, and displaying the original destination alongside.
16+
- [`IMAPLinkDestinationRevealer`](IMAPLinkDestinationRevealer.py): An example IMAP plugin that looks for links that appear to show a URL, but whose text doesn't match the link's actual destination (its `href`), and makes this more visible by replacing the original link destination with the text, and displaying the original destination alongside.
1717
If using with the IMAPCleanO365ATPLinks plugin, place that plugin later in the list (so it will be executed first on messages received from the server).
1818

19-
- [`IMAPDecodeDeflateCompression`](plugins/IMAPDecodeDeflateCompression.py): An example IMAP plugin that looks for client requests to enable compression (RFC 1951 and 4978) and, unlike [`IMAPDisableDeflateCompression`](plugins/IMAPDisableDeflateCompression.py), permits compression but decompresses messages within the plugin.
19+
- [`IMAPDecodeDeflateCompression`](IMAPDecodeDeflateCompression.py): An example IMAP plugin that looks for client requests to enable compression (RFC 1951 and 4978) and, unlike [`IMAPDisableDeflateCompression`](IMAPDisableDeflateCompression.py), permits compression but decompresses messages within the plugin.
2020
This allows monitoring and editing of compressed incoming and outgoing communication, but only within this plugin, not any others (and as a result only other deflate-aware plugins can be chained).
21-
An alternative option and further improvement can be found in [`IMAPDeflateCompressionRemoteEnabler`](plugins/IMAPDeflateCompressionRemoteEnabler.py).
21+
An alternative option and further improvement can be found in [`IMAPDeflateCompressionRemoteEnabler`](IMAPDeflateCompressionRemoteEnabler.py).
2222

23-
- [`IMAPDeflateCompressionRemoteEnabler`](plugins/IMAPDeflateCompressionRemoteEnabler.py): An example Email OAuth 2.0 Proxy IMAP plugin that looks for `COMPRESS=DEFLATE` in server capability responses (RFC 1951
24-
and 4978) and, unlike [`IMAPDecodeDeflateCompression`](plugins/IMAPDecodeDeflateCompression.py), handles this entirely within the plugin, keeping an uncompressed channel to the client, but enabling compressed communication with the server.
23+
- [`IMAPDeflateCompressionRemoteEnabler`](IMAPDeflateCompressionRemoteEnabler.py): An example Email OAuth 2.0 Proxy IMAP plugin that looks for `COMPRESS=DEFLATE` in server capability responses (RFC 1951
24+
and 4978) and, unlike [`IMAPDecodeDeflateCompression`](IMAPDecodeDeflateCompression.py), handles this entirely within the plugin, keeping an uncompressed channel to the client, but enabling compressed communication with the server.
2525
Place this plugin at the end of the chain in the proxy's configuration file.
2626

27-
- [`IMAPDisableDeflateCompression`](plugins/IMAPDisableDeflateCompression.py): An example IMAP plugin that looks for client requests to enable compression (RFC 1951 and 4978) and responds with `NO` every time, so that other plugins can continue to intercept requests.
27+
- [`IMAPDisableDeflateCompression`](IMAPDisableDeflateCompression.py): An example IMAP plugin that looks for client requests to enable compression (RFC 1951 and 4978) and responds with `NO` every time, so that other plugins can continue to intercept requests.
2828
Place this plugin before any others if you use a client that automatically tries to enable compression when it finds `COMPRESS=DEFLATE` in a `CAPABILITY` response.
29-
An alternative option here if you do not need to actually edit messages is to keep compression enabled, but decompress within the plugin – see [`IMAPDecodeDeflateCompression`](plugins/IMAPDecodeDeflateCompression.py).
29+
An alternative option here if you do not need to actually edit messages is to keep compression enabled, but decompress within the plugin – see [`IMAPDecodeDeflateCompression`](IMAPDecodeDeflateCompression.py).
3030

31-
- [`IMAPFixO365SearchQuirks`](plugins/IMAPFixO365SearchQuirks.py): An example IMAP plugin that modifies search strings to fix O365's inability to handle uppercase characters in searches.
31+
- [`IMAPFixO365SearchQuirks`](IMAPFixO365SearchQuirks.py): An example IMAP plugin that modifies search strings to fix O365's inability to handle uppercase characters in searches.
3232
The plugin also changes `BODY` searches to `TEXT` to prompt O365 to return flags in the results.
3333
Note that no detection of whether the remote server is actually O365 takes place.
3434

35-
- [`IMAPIgnoreSentMessageUpload`](plugins/IMAPIgnoreSentMessageUpload.py): An example IMAP plugin that accepts client requests to upload sent messages to an IMAP mailbox, but silently discards them without sending to the server.
35+
- [`IMAPIgnoreSentMessageUpload`](IMAPIgnoreSentMessageUpload.py): An example IMAP plugin that accepts client requests to upload sent messages to an IMAP mailbox, but silently discards them without sending to the server.
3636
This plugin helps avoid message duplication for servers that automatically place messages sent via SMTP into the relevant IMAP mailbox.
3737
Note that many clients are aware of this behaviour and provide an option to not upload sent messages – if this is available it is a much more efficient solution than adding a proxy plugin.
3838

39-
- [`IMAPRegexContentReplacer`](plugins/IMAPRegexContentReplacer.py): An example IMAP plugin that performs regular expression searches and substitutions on the content of received messages.
39+
- [`IMAPRegexContentReplacer`](IMAPRegexContentReplacer.py): An example IMAP plugin that performs regular expression searches and substitutions on the content of received messages.
4040
Please note that this is a relatively simplistic example of how such a plugin could work, and if you try to confuse or break it you will likely succeed.
4141

42-
- [`SMTPBlackHole`](plugins/SMTPBlackHole.py): An example SMTP plugin that accepts incoming email messages but silently discards them without passing to the remote server.
42+
- [`SMTPBlackHole`](SMTPBlackHole.py): An example SMTP plugin that accepts incoming email messages but silently discards them without passing to the remote server.
4343
Useful for testing email sending tools with no risk of actually delivering messages.
4444

45-
- [`SMTPDisableO365Reactions`](plugins/SMTPDisableO365Reactions.py): An example SMTP plugin that adds the [`x-ms-reactions: disallow`](https://techcommunity.microsoft.com/t5/outlook-blog/reactions-in-outlook-public-usability-update-september-2023/ba-p/3928103) header to outgoing messages to disable Outlook reactions.
45+
- [`SMTPDisableO365Reactions`](SMTPDisableO365Reactions.py): An example SMTP plugin that adds the [`x-ms-reactions: disallow`](https://techcommunity.microsoft.com/t5/outlook-blog/reactions-in-outlook-public-usability-update-september-2023/ba-p/3928103) header to outgoing messages to disable Outlook reactions.
4646
An optional `domain_whitelist` parameter allows specific domains to be whitelisted (such as your own internal domain(s)).
4747

48-
- [`SMTPRemoveClientIdentifiers`](plugins/SMTPRemoveClientIdentifiers.py): An example SMTP plugin that demonstrates removing the headers `User-Agent`, `X-Mailer` and `X-Originating-IP` from outgoing messages.
48+
- [`SMTPRemoveClientIdentifiers`](SMTPRemoveClientIdentifiers.py): An example SMTP plugin that demonstrates removing the headers `User-Agent`, `X-Mailer` and `X-Originating-IP` from outgoing messages.
4949

50-
- [`SMTPSimpleMailingList`](plugins/SMTPSimpleMailingList.py): An example SMTP plugin that replaces specified recipient addresses in outgoing emails with one or more different recipients.
50+
- [`SMTPSimpleMailingList`](SMTPSimpleMailingList.py): An example SMTP plugin that replaces specified recipient addresses in outgoing emails with one or more different recipients.
5151
Please note that this is a relatively simplistic example of how such a plugin could work, and if you try to confuse or break it you will likely succeed (please use a real mailing list if you need to handle this).
5252
However, this approach works well for basic cases - for example, when you often find yourself sending an email to the same addresses, you can consolidate the group into a single address and never forget any recipients.
5353
Recipients themselves only ever see the real addresses, not your list, so there is no danger of replying to an address that does not exist.
54-
It recommended to chain with [`SMTPBlackHole`](plugins/SMTPBlackHole.py) and enable debug mode in the proxy at first use to check intended behaviour.
54+
It recommended to chain with [`SMTPBlackHole`](SMTPBlackHole.py) and enable debug mode in the proxy at first use to check intended behaviour.
5555

5656

5757
## Creating your own plugins
58-
Extend [`BasePlugin`](plugins/BasePlugin.py) to create your own plugins that customise IMAP/POP/SMTP client/server behaviour.
58+
Extend [`BasePlugin`](BasePlugin.py) to create your own plugins that customise IMAP/POP/SMTP client/server behaviour.
5959
The two overridable methods `receive_from_client` and `receive_from_server` give access to raw IMAP/POP/SMTP messages/commands as they are received.
6060
The return values from these overridden methods, and the two sender methods `send_to_server` and `send_to_client` allow you to send messages/commands to the client/server (and other chained plugins) in response.
6161
The `log_debug`, `log_info` and `log_error` methods allow you to post messages to the proxy's main log.
@@ -64,9 +64,9 @@ See the method documentation and the sample plugins above for further guidance.
6464
Please note that for security reasons, plugins on the client side are inserted after authentication has finished – you will not receive anything from the client until that process is complete.
6565

6666
### Supporting tools
67-
The discussion, methods and variables in [`BasePlugin`](plugins/BasePlugin.py) contain pointers and suggestions about how to develop your own plugins.
67+
The discussion, methods and variables in [`BasePlugin`](BasePlugin.py) contain pointers and suggestions about how to develop your own plugins.
6868
In addition, extending the following helpers may help you get started:
6969

70-
- [`IMAPMessageEditor`](plugins/IMAPMessageEditor.py): An example IMAP plugin helper that can be extended to create other IMAP plugins that modify the content of received messages.
70+
- [`IMAPMessageEditor`](IMAPMessageEditor.py): An example IMAP plugin helper that can be extended to create other IMAP plugins that modify the content of received messages.
7171
This plugin abstracts away the potentially error-prone message decoding process and instead provides a single method that is called whenever an email is loaded.
72-
See [`IMAPRegexContentReplacer`](plugins/IMAPRegexContentReplacer.py) for an example of this helper in use.
72+
See [`IMAPRegexContentReplacer`](IMAPRegexContentReplacer.py) for an example of this helper in use.

0 commit comments

Comments
 (0)