redturtle.sesmailer 1.0.0a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ """Init and utils."""
2
+
3
+ from zope.i18nmessageid import MessageFactory
4
+
5
+ import logging
6
+
7
+
8
+ __version__ = "1.0.0a0"
9
+
10
+ PACKAGE_NAME = "redturtle.sesmailer"
11
+
12
+ _ = MessageFactory(PACKAGE_NAME)
13
+
14
+ logger = logging.getLogger(PACKAGE_NAME)
@@ -0,0 +1,49 @@
1
+ """Shared boto3 SESv2 clients.
2
+
3
+ ``MailHost`` builds a new mailer for every message, so the (expensive)
4
+ boto3 client must not be created by the mailer itself. Clients are cached at
5
+ module level, one per ``(region, endpoint_url)``. boto3 clients are
6
+ thread-safe once created; only their creation needs to be serialized.
7
+ """
8
+
9
+ from botocore.config import Config
10
+ from redturtle.sesmailer import config
11
+
12
+ import boto3
13
+ import threading
14
+
15
+
16
+ _clients = {}
17
+ _lock = threading.Lock()
18
+
19
+
20
+ def _create_client(region, endpoint_url):
21
+ client_config = Config(
22
+ retries={"mode": "standard", "max_attempts": config.get_max_attempts()},
23
+ connect_timeout=config.get_connect_timeout(),
24
+ read_timeout=config.get_read_timeout(),
25
+ )
26
+ return boto3.client(
27
+ "sesv2",
28
+ region_name=region,
29
+ endpoint_url=endpoint_url,
30
+ config=client_config,
31
+ )
32
+
33
+
34
+ def get_client(region, endpoint_url=None):
35
+ """Return the cached SESv2 client for ``(region, endpoint_url)``."""
36
+ key = (region, endpoint_url)
37
+ client = _clients.get(key)
38
+ if client is None:
39
+ with _lock:
40
+ client = _clients.get(key)
41
+ if client is None:
42
+ client = _clients[key] = _create_client(region, endpoint_url)
43
+ return client
44
+
45
+
46
+ def reset_clients():
47
+ """Drop all cached clients (for tests)."""
48
+ with _lock:
49
+ _clients.clear()
@@ -0,0 +1,61 @@
1
+ """Runtime configuration, read from environment variables.
2
+
3
+ Values are read every time they are requested (never at import time), so
4
+ that tests, and operators using process managers, can change them freely.
5
+ """
6
+
7
+ from redturtle.sesmailer import logger
8
+
9
+ import os
10
+
11
+
12
+ DEFAULT_MAX_ATTEMPTS = 5
13
+ DEFAULT_CONNECT_TIMEOUT = 5
14
+ DEFAULT_READ_TIMEOUT = 15
15
+
16
+
17
+ def _get(name):
18
+ """Return the stripped value of an env variable, or an empty string."""
19
+ return os.environ.get(name, "").strip()
20
+
21
+
22
+ def _get_number(name, default, cast=int):
23
+ value = _get(name)
24
+ if not value:
25
+ return default
26
+ try:
27
+ number = cast(value)
28
+ except ValueError:
29
+ logger.warning("Invalid value for %s, using default %s", name, default)
30
+ return default
31
+ if number <= 0:
32
+ logger.warning("Invalid value for %s, using default %s", name, default)
33
+ return default
34
+ return number
35
+
36
+
37
+ def get_region():
38
+ """Return the SES region, or an empty string when SES is not enabled."""
39
+ return _get("SES_REGION")
40
+
41
+
42
+ def get_configuration_set():
43
+ """Return the SES configuration set name, or None."""
44
+ return _get("SES_CONFIGURATION_SET") or None
45
+
46
+
47
+ def get_endpoint_url():
48
+ """Return the alternative SES endpoint (LocalStack, tests), or None."""
49
+ return _get("SES_ENDPOINT_URL") or None
50
+
51
+
52
+ def get_max_attempts():
53
+ return _get_number("SES_MAX_ATTEMPTS", DEFAULT_MAX_ATTEMPTS)
54
+
55
+
56
+ def get_connect_timeout():
57
+ return _get_number("SES_CONNECT_TIMEOUT", DEFAULT_CONNECT_TIMEOUT, float)
58
+
59
+
60
+ def get_read_timeout():
61
+ return _get_number("SES_READ_TIMEOUT", DEFAULT_READ_TIMEOUT, float)
@@ -0,0 +1,18 @@
1
+ <configure
2
+ xmlns="http://namespaces.zope.org/zope"
3
+ xmlns:monkey="http://namespaces.plone.org/monkey"
4
+ i18n_domain="redturtle.sesmailer"
5
+ >
6
+
7
+ <include package="collective.monkeypatcher" />
8
+ <include file="profiles.zcml" />
9
+
10
+ <monkey:patch
11
+ original="_makeMailer"
12
+ replacement=".patches.makeMailer"
13
+ class="Products.MailHost.MailHost.MailBase"
14
+ description="Use Amazon SES API for MailHost when SES_REGION is set"
15
+ preserveOriginal="true"
16
+ />
17
+
18
+ </configure>
@@ -0,0 +1,101 @@
1
+ """A ``zope.sendmail`` mailer that delivers through the Amazon SES v2 API."""
2
+
3
+ from botocore.exceptions import BotoCoreError
4
+ from botocore.exceptions import ClientError
5
+ from redturtle.sesmailer import logger
6
+ from redturtle.sesmailer.client import get_client
7
+ from email.utils import parseaddr
8
+ from zope.interface import implementer
9
+ from zope.sendmail.interfaces import IMailer
10
+
11
+
12
+ # SES accepts at most 50 destinations per SendEmail call.
13
+ MAX_RECIPIENTS_PER_CALL = 50
14
+
15
+
16
+ def _chunks(items, size):
17
+ for start in range(0, len(items), size):
18
+ yield items[start : start + size]
19
+
20
+
21
+ def _envelope_address(address):
22
+ """Return the bare address of ``"Name <user@example.com>"``.
23
+
24
+ ``MailHost`` passes the site sender with its display name as envelope
25
+ sender; the display name already travels in the message's own ``From``
26
+ header, and an envelope sender must be a bare address.
27
+ """
28
+ return parseaddr(address)[1] or address
29
+
30
+
31
+ @implementer(IMailer)
32
+ class SESMailer:
33
+ """Send raw messages with ``sesv2.send_email``.
34
+
35
+ Errors are logged and re-raised, so ``zope.sendmail`` applies its usual
36
+ behavior (log on direct delivery, retry on queued delivery).
37
+ """
38
+
39
+ def __init__(self, region, configuration_set=None, endpoint_url=None):
40
+ self.region = region
41
+ self.configuration_set = configuration_set
42
+ self.endpoint_url = endpoint_url
43
+
44
+ @property
45
+ def client(self):
46
+ return get_client(self.region, self.endpoint_url)
47
+
48
+ def send(self, fromaddr, toaddrs, message):
49
+ fromaddr = _envelope_address(fromaddr)
50
+ if isinstance(message, str):
51
+ message = message.encode("utf-8")
52
+ if isinstance(toaddrs, str):
53
+ toaddrs = [toaddrs]
54
+ toaddrs = list(toaddrs)
55
+ if not toaddrs:
56
+ logger.warning("No recipients, message from %s not sent", fromaddr)
57
+ return
58
+
59
+ for recipients in _chunks(toaddrs, MAX_RECIPIENTS_PER_CALL):
60
+ self._send_chunk(fromaddr, recipients, message)
61
+
62
+ def _send_chunk(self, fromaddr, recipients, message):
63
+ params = {
64
+ "FromEmailAddress": fromaddr,
65
+ "Destination": {"ToAddresses": recipients},
66
+ "Content": {"Raw": {"Data": message}},
67
+ }
68
+ if self.configuration_set:
69
+ params["ConfigurationSetName"] = self.configuration_set
70
+ try:
71
+ response = self.client.send_email(**params)
72
+ except ClientError as exc:
73
+ error = exc.response.get("Error", {})
74
+ logger.error(
75
+ "SES rejected message from %s to %s: %s: %s",
76
+ fromaddr,
77
+ recipients,
78
+ error.get("Code", "Unknown"),
79
+ error.get("Message", ""),
80
+ )
81
+ raise
82
+ except BotoCoreError as exc:
83
+ logger.error(
84
+ "SES call failed for message from %s to %s: %s: %s",
85
+ fromaddr,
86
+ recipients,
87
+ type(exc).__name__,
88
+ exc,
89
+ )
90
+ raise
91
+ logger.info(
92
+ "SES message sent: MessageId=%s recipients=%s",
93
+ response.get("MessageId"),
94
+ recipients,
95
+ )
96
+
97
+ def vote(self, fromaddr, toaddrs, message):
98
+ """Nothing to vote on: SES has no two-phase commit."""
99
+
100
+ def abort(self):
101
+ """Nothing to abort."""
@@ -0,0 +1,32 @@
1
+ """Monkey patches, registered in ``configure.zcml``."""
2
+
3
+ from redturtle.sesmailer import config
4
+ from redturtle.sesmailer import logger
5
+ from redturtle.sesmailer.mailer import SESMailer
6
+
7
+
8
+ _announced = False
9
+
10
+
11
+ def _announce(region):
12
+ """Log once per process that SES is in use. Never log credentials."""
13
+ global _announced
14
+ if not _announced:
15
+ _announced = True
16
+ logger.info("Amazon SES API enabled for MailHost, region %s", region)
17
+
18
+
19
+ def makeMailer(self):
20
+ """Replacement for ``MailBase._makeMailer``.
21
+
22
+ Without ``SES_REGION`` the original SMTP mailer is returned, untouched.
23
+ """
24
+ region = config.get_region()
25
+ if not region:
26
+ return self._old__makeMailer()
27
+ _announce(region)
28
+ return SESMailer(
29
+ region=region,
30
+ configuration_set=config.get_configuration_set(),
31
+ endpoint_url=config.get_endpoint_url(),
32
+ )
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <metadata>
3
+ <version>1000</version>
4
+ </metadata>
@@ -0,0 +1,17 @@
1
+ <configure
2
+ xmlns="http://namespaces.zope.org/zope"
3
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
4
+ i18n_domain="redturtle.sesmailer"
5
+ >
6
+
7
+ <!-- Empty profile: the package has no persistent configuration, but it
8
+ still shows up (and can be installed) in the Add-ons control panel. -->
9
+ <genericsetup:registerProfile
10
+ name="default"
11
+ title="redturtle.sesmailer"
12
+ description="Send MailHost emails through the Amazon SES v2 API (configured with SES_* environment variables)."
13
+ provides="Products.GenericSetup.interfaces.EXTENSION"
14
+ directory="profiles/default"
15
+ />
16
+
17
+ </configure>
@@ -0,0 +1,33 @@
1
+ from plone.app.testing import applyProfile
2
+ from plone.app.testing import FunctionalTesting
3
+ from plone.app.testing import IntegrationTesting
4
+ from plone.app.testing import PLONE_FIXTURE
5
+ from plone.app.testing import PloneSandboxLayer
6
+
7
+ import redturtle.sesmailer
8
+
9
+
10
+ class Layer(PloneSandboxLayer):
11
+ defaultBases = (PLONE_FIXTURE,)
12
+
13
+ def setUpZope(self, app, configurationContext):
14
+ # The z3c.autoinclude feature is disabled in the Plone fixture base
15
+ # layer, so load the ZCML explicitly.
16
+ self.loadZCML(package=redturtle.sesmailer)
17
+
18
+ def setUpPloneSite(self, portal):
19
+ applyProfile(portal, "redturtle.sesmailer:default")
20
+
21
+
22
+ FIXTURE = Layer()
23
+
24
+ INTEGRATION_TESTING = IntegrationTesting(
25
+ bases=(FIXTURE,),
26
+ name="Redturtle.SesmailerLayer:IntegrationTesting",
27
+ )
28
+
29
+
30
+ FUNCTIONAL_TESTING = FunctionalTesting(
31
+ bases=(FIXTURE,),
32
+ name="Redturtle.SesmailerLayer:FunctionalTesting",
33
+ )
@@ -0,0 +1,579 @@
1
+ Metadata-Version: 2.5
2
+ Name: redturtle.sesmailer
3
+ Version: 1.0.0a0
4
+ Summary: Send Plone MailHost emails through the Amazon SES v2 API instead of SMTP
5
+ Project-URL: Homepage, https://github.com/RedTurtle/redturtle.sesmailer
6
+ Project-URL: PyPI, https://pypi.org/project/redturtle.sesmailer
7
+ Project-URL: Source, https://github.com/RedTurtle/redturtle.sesmailer
8
+ Project-URL: Tracker, https://github.com/RedTurtle/redturtle.sesmailer/issues
9
+ Author-email: RedTurtle <sviluppo@redturtle.it>
10
+ License: GNU GENERAL PUBLIC LICENSE
11
+ Version 2, June 1991
12
+
13
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
14
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
+ Everyone is permitted to copy and distribute verbatim copies
16
+ of this license document, but changing it is not allowed.
17
+
18
+ Preamble
19
+
20
+ The licenses for most software are designed to take away your
21
+ freedom to share and change it. By contrast, the GNU General Public
22
+ License is intended to guarantee your freedom to share and change free
23
+ software--to make sure the software is free for all its users. This
24
+ General Public License applies to most of the Free Software
25
+ Foundation's software and to any other program whose authors commit to
26
+ using it. (Some other Free Software Foundation software is covered by
27
+ the GNU Lesser General Public License instead.) You can apply it to
28
+ your programs, too.
29
+
30
+ When we speak of free software, we are referring to freedom, not
31
+ price. Our General Public Licenses are designed to make sure that you
32
+ have the freedom to distribute copies of free software (and charge for
33
+ this service if you wish), that you receive source code or can get it
34
+ if you want it, that you can change the software or use pieces of it
35
+ in new free programs; and that you know you can do these things.
36
+
37
+ To protect your rights, we need to make restrictions that forbid
38
+ anyone to deny you these rights or to ask you to surrender the rights.
39
+ These restrictions translate to certain responsibilities for you if you
40
+ distribute copies of the software, or if you modify it.
41
+
42
+ For example, if you distribute copies of such a program, whether
43
+ gratis or for a fee, you must give the recipients all the rights that
44
+ you have. You must make sure that they, too, receive or can get the
45
+ source code. And you must show them these terms so they know their
46
+ rights.
47
+
48
+ We protect your rights with two steps: (1) copyright the software, and
49
+ (2) offer you this license which gives you legal permission to copy,
50
+ distribute and/or modify the software.
51
+
52
+ Also, for each author's protection and ours, we want to make certain
53
+ that everyone understands that there is no warranty for this free
54
+ software. If the software is modified by someone else and passed on, we
55
+ want its recipients to know that what they have is not the original, so
56
+ that any problems introduced by others will not reflect on the original
57
+ authors' reputations.
58
+
59
+ Finally, any free program is threatened constantly by software
60
+ patents. We wish to avoid the danger that redistributors of a free
61
+ program will individually obtain patent licenses, in effect making the
62
+ program proprietary. To prevent this, we have made it clear that any
63
+ patent must be licensed for everyone's free use or not licensed at all.
64
+
65
+ The precise terms and conditions for copying, distribution and
66
+ modification follow.
67
+
68
+ GNU GENERAL PUBLIC LICENSE
69
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
70
+
71
+ 0. This License applies to any program or other work which contains
72
+ a notice placed by the copyright holder saying it may be distributed
73
+ under the terms of this General Public License. The "Program", below,
74
+ refers to any such program or work, and a "work based on the Program"
75
+ means either the Program or any derivative work under copyright law:
76
+ that is to say, a work containing the Program or a portion of it,
77
+ either verbatim or with modifications and/or translated into another
78
+ language. (Hereinafter, translation is included without limitation in
79
+ the term "modification".) Each licensee is addressed as "you".
80
+
81
+ Activities other than copying, distribution and modification are not
82
+ covered by this License; they are outside its scope. The act of
83
+ running the Program is not restricted, and the output from the Program
84
+ is covered only if its contents constitute a work based on the
85
+ Program (independent of having been made by running the Program).
86
+ Whether that is true depends on what the Program does.
87
+
88
+ 1. You may copy and distribute verbatim copies of the Program's
89
+ source code as you receive it, in any medium, provided that you
90
+ conspicuously and appropriately publish on each copy an appropriate
91
+ copyright notice and disclaimer of warranty; keep intact all the
92
+ notices that refer to this License and to the absence of any warranty;
93
+ and give any other recipients of the Program a copy of this License
94
+ along with the Program.
95
+
96
+ You may charge a fee for the physical act of transferring a copy, and
97
+ you may at your option offer warranty protection in exchange for a fee.
98
+
99
+ 2. You may modify your copy or copies of the Program or any portion
100
+ of it, thus forming a work based on the Program, and copy and
101
+ distribute such modifications or work under the terms of Section 1
102
+ above, provided that you also meet all of these conditions:
103
+
104
+ a) You must cause the modified files to carry prominent notices
105
+ stating that you changed the files and the date of any change.
106
+
107
+ b) You must cause any work that you distribute or publish, that in
108
+ whole or in part contains or is derived from the Program or any
109
+ part thereof, to be licensed as a whole at no charge to all third
110
+ parties under the terms of this License.
111
+
112
+ c) If the modified program normally reads commands interactively
113
+ when run, you must cause it, when started running for such
114
+ interactive use in the most ordinary way, to print or display an
115
+ announcement including an appropriate copyright notice and a
116
+ notice that there is no warranty (or else, saying that you provide
117
+ a warranty) and that users may redistribute the program under
118
+ these conditions, and telling the user how to view a copy of this
119
+ License. (Exception: if the Program itself is interactive but
120
+ does not normally print such an announcement, your work based on
121
+ the Program is not required to print an announcement.)
122
+
123
+ These requirements apply to the modified work as a whole. If
124
+ identifiable sections of that work are not derived from the Program,
125
+ and can be reasonably considered independent and separate works in
126
+ themselves, then this License, and its terms, do not apply to those
127
+ sections when you distribute them as separate works. But when you
128
+ distribute the same sections as part of a whole which is a work based
129
+ on the Program, the distribution of the whole must be on the terms of
130
+ this License, whose permissions for other licensees extend to the
131
+ entire whole, and thus to each and every part regardless of who wrote it.
132
+
133
+ Thus, it is not the intent of this section to claim rights or contest
134
+ your rights to work written entirely by you; rather, the intent is to
135
+ exercise the right to control the distribution of derivative or
136
+ collective works based on the Program.
137
+
138
+ In addition, mere aggregation of another work not based on the Program
139
+ with the Program (or with a work based on the Program) on a volume of
140
+ a storage or distribution medium does not bring the other work under
141
+ the scope of this License.
142
+
143
+ 3. You may copy and distribute the Program (or a work based on it,
144
+ under Section 2) in object code or executable form under the terms of
145
+ Sections 1 and 2 above provided that you also do one of the following:
146
+
147
+ a) Accompany it with the complete corresponding machine-readable
148
+ source code, which must be distributed under the terms of Sections
149
+ 1 and 2 above on a medium customarily used for software interchange; or,
150
+
151
+ b) Accompany it with a written offer, valid for at least three
152
+ years, to give any third party, for a charge no more than your
153
+ cost of physically performing source distribution, a complete
154
+ machine-readable copy of the corresponding source code, to be
155
+ distributed under the terms of Sections 1 and 2 above on a medium
156
+ customarily used for software interchange; or,
157
+
158
+ c) Accompany it with the information you received as to the offer
159
+ to distribute corresponding source code. (This alternative is
160
+ allowed only for noncommercial distribution and only if you
161
+ received the program in object code or executable form with such
162
+ an offer, in accord with Subsection b above.)
163
+
164
+ The source code for a work means the preferred form of the work for
165
+ making modifications to it. For an executable work, complete source
166
+ code means all the source code for all modules it contains, plus any
167
+ associated interface definition files, plus the scripts used to
168
+ control compilation and installation of the executable. However, as a
169
+ special exception, the source code distributed need not include
170
+ anything that is normally distributed (in either source or binary
171
+ form) with the major components (compiler, kernel, and so on) of the
172
+ operating system on which the executable runs, unless that component
173
+ itself accompanies the executable.
174
+
175
+ If distribution of executable or object code is made by offering
176
+ access to copy from a designated place, then offering equivalent
177
+ access to copy the source code from the same place counts as
178
+ distribution of the source code, even though third parties are not
179
+ compelled to copy the source along with the object code.
180
+
181
+ 4. You may not copy, modify, sublicense, or distribute the Program
182
+ except as expressly provided under this License. Any attempt
183
+ otherwise to copy, modify, sublicense or distribute the Program is
184
+ void, and will automatically terminate your rights under this License.
185
+ However, parties who have received copies, or rights, from you under
186
+ this License will not have their licenses terminated so long as such
187
+ parties remain in full compliance.
188
+
189
+ 5. You are not required to accept this License, since you have not
190
+ signed it. However, nothing else grants you permission to modify or
191
+ distribute the Program or its derivative works. These actions are
192
+ prohibited by law if you do not accept this License. Therefore, by
193
+ modifying or distributing the Program (or any work based on the
194
+ Program), you indicate your acceptance of this License to do so, and
195
+ all its terms and conditions for copying, distributing or modifying
196
+ the Program or works based on it.
197
+
198
+ 6. Each time you redistribute the Program (or any work based on the
199
+ Program), the recipient automatically receives a license from the
200
+ original licensor to copy, distribute or modify the Program subject to
201
+ these terms and conditions. You may not impose any further
202
+ restrictions on the recipients' exercise of the rights granted herein.
203
+ You are not responsible for enforcing compliance by third parties to
204
+ this License.
205
+
206
+ 7. If, as a consequence of a court judgment or allegation of patent
207
+ infringement or for any other reason (not limited to patent issues),
208
+ conditions are imposed on you (whether by court order, agreement or
209
+ otherwise) that contradict the conditions of this License, they do not
210
+ excuse you from the conditions of this License. If you cannot
211
+ distribute so as to satisfy simultaneously your obligations under this
212
+ License and any other pertinent obligations, then as a consequence you
213
+ may not distribute the Program at all. For example, if a patent
214
+ license would not permit royalty-free redistribution of the Program by
215
+ all those who receive copies directly or indirectly through you, then
216
+ the only way you could satisfy both it and this License would be to
217
+ refrain entirely from distribution of the Program.
218
+
219
+ If any portion of this section is held invalid or unenforceable under
220
+ any particular circumstance, the balance of the section is intended to
221
+ apply and the section as a whole is intended to apply in other
222
+ circumstances.
223
+
224
+ It is not the purpose of this section to induce you to infringe any
225
+ patents or other property right claims or to contest validity of any
226
+ such claims; this section has the sole purpose of protecting the
227
+ integrity of the free software distribution system, which is
228
+ implemented by public license practices. Many people have made
229
+ generous contributions to the wide range of software distributed
230
+ through that system in reliance on consistent application of that
231
+ system; it is up to the author/donor to decide if he or she is willing
232
+ to distribute software through any other system and a licensee cannot
233
+ impose that choice.
234
+
235
+ This section is intended to make thoroughly clear what is believed to
236
+ be a consequence of the rest of this License.
237
+
238
+ 8. If the distribution and/or use of the Program is restricted in
239
+ certain countries either by patents or by copyrighted interfaces, the
240
+ original copyright holder who places the Program under this License
241
+ may add an explicit geographical distribution limitation excluding
242
+ those countries, so that distribution is permitted only in or among
243
+ countries not thus excluded. In such case, this License incorporates
244
+ the limitation as if written in the body of this License.
245
+
246
+ 9. The Free Software Foundation may publish revised and/or new versions
247
+ of the General Public License from time to time. Such new versions will
248
+ be similar in spirit to the present version, but may differ in detail to
249
+ address new problems or concerns.
250
+
251
+ Each version is given a distinguishing version number. If the Program
252
+ specifies a version number of this License which applies to it and "any
253
+ later version", you have the option of following the terms and conditions
254
+ either of that version or of any later version published by the Free
255
+ Software Foundation. If the Program does not specify a version number of
256
+ this License, you may choose any version ever published by the Free Software
257
+ Foundation.
258
+
259
+ 10. If you wish to incorporate parts of the Program into other free
260
+ programs whose distribution conditions are different, write to the author
261
+ to ask for permission. For software which is copyrighted by the Free
262
+ Software Foundation, write to the Free Software Foundation; we sometimes
263
+ make exceptions for this. Our decision will be guided by the two goals
264
+ of preserving the free status of all derivatives of our free software and
265
+ of promoting the sharing and reuse of software generally.
266
+
267
+ NO WARRANTY
268
+
269
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
270
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
271
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
272
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
273
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
274
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
275
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
276
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
277
+ REPAIR OR CORRECTION.
278
+
279
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
280
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
281
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
282
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
283
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
284
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
285
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
286
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
287
+ POSSIBILITY OF SUCH DAMAGES.
288
+
289
+ END OF TERMS AND CONDITIONS
290
+
291
+ How to Apply These Terms to Your New Programs
292
+
293
+ If you develop a new program, and you want it to be of the greatest
294
+ possible use to the public, the best way to achieve this is to make it
295
+ free software which everyone can redistribute and change under these terms.
296
+
297
+ To do so, attach the following notices to the program. It is safest
298
+ to attach them to the start of each source file to most effectively
299
+ convey the exclusion of warranty; and each file should have at least
300
+ the "copyright" line and a pointer to where the full notice is found.
301
+
302
+ <one line to give the program's name and a brief idea of what it does.>
303
+ Copyright (C) <year> <name of author>
304
+
305
+ This program is free software; you can redistribute it and/or modify
306
+ it under the terms of the GNU General Public License as published by
307
+ the Free Software Foundation; either version 2 of the License, or
308
+ (at your option) any later version.
309
+
310
+ This program is distributed in the hope that it will be useful,
311
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
312
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
313
+ GNU General Public License for more details.
314
+
315
+ You should have received a copy of the GNU General Public License along
316
+ with this program; if not, write to the Free Software Foundation, Inc.,
317
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
318
+
319
+ Also add information on how to contact you by electronic and paper mail.
320
+
321
+ If the program is interactive, make it output a short notice like this
322
+ when it starts in an interactive mode:
323
+
324
+ Gnomovision version 69, Copyright (C) year name of author
325
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
326
+ This is free software, and you are welcome to redistribute it
327
+ under certain conditions; type `show c' for details.
328
+
329
+ The hypothetical commands `show w' and `show c' should show the appropriate
330
+ parts of the General Public License. Of course, the commands you use may
331
+ be called something other than `show w' and `show c'; they could even be
332
+ mouse-clicks or menu items--whatever suits your program.
333
+
334
+ You should also get your employer (if you work as a programmer) or your
335
+ school, if any, to sign a "copyright disclaimer" for the program, if
336
+ necessary. Here is a sample; alter the names:
337
+
338
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
339
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
340
+
341
+ <signature of Ty Coon>, 1 April 1989
342
+ Ty Coon, President of Vice
343
+
344
+ This General Public License does not permit incorporating your program into
345
+ proprietary programs. If your program is a subroutine library, you may
346
+ consider it more useful to permit linking proprietary applications with the
347
+ library. If this is what you want to do, use the GNU Lesser General
348
+ Public License instead of this License.
349
+ License-File: LICENSE.GPL
350
+ License-File: LICENSE.md
351
+ Keywords: CMS,Plone,Python
352
+ Classifier: Development Status :: 3 - Alpha
353
+ Classifier: Environment :: Web Environment
354
+ Classifier: Framework :: Plone
355
+ Classifier: Framework :: Plone :: 6.0
356
+ Classifier: Framework :: Plone :: 6.1
357
+ Classifier: Framework :: Plone :: Addon
358
+ Classifier: Operating System :: OS Independent
359
+ Classifier: Programming Language :: Python
360
+ Classifier: Programming Language :: Python :: 3.10
361
+ Classifier: Programming Language :: Python :: 3.11
362
+ Classifier: Programming Language :: Python :: 3.12
363
+ Classifier: Programming Language :: Python :: 3.13
364
+ Requires-Python: >=3.10
365
+ Requires-Dist: boto3
366
+ Requires-Dist: collective-monkeypatcher
367
+ Requires-Dist: products-mailhost
368
+ Requires-Dist: setuptools
369
+ Requires-Dist: zope-interface
370
+ Requires-Dist: zope-sendmail
371
+ Provides-Extra: release
372
+ Requires-Dist: zest-pocompile; extra == 'release'
373
+ Requires-Dist: zest-releaser[recommended]; extra == 'release'
374
+ Requires-Dist: zestreleaser-towncrier; extra == 'release'
375
+ Provides-Extra: test
376
+ Requires-Dist: botocore; extra == 'test'
377
+ Requires-Dist: horse-with-no-namespace; extra == 'test'
378
+ Requires-Dist: plone-api; extra == 'test'
379
+ Requires-Dist: plone-app-testing; extra == 'test'
380
+ Requires-Dist: products-cmfplone; extra == 'test'
381
+ Requires-Dist: pytest; extra == 'test'
382
+ Requires-Dist: pytest-cov; extra == 'test'
383
+ Requires-Dist: pytest-plone>=1.0.0a2; extra == 'test'
384
+ Description-Content-Type: text/markdown
385
+
386
+ <div align="center">
387
+ <h1 align="center">redturtle.sesmailer</h1>
388
+ </div>
389
+ <div align="center">
390
+
391
+ [![PyPI](https://img.shields.io/pypi/v/redturtle.sesmailer)](https://pypi.org/project/redturtle.sesmailer/)
392
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/redturtle.sesmailer)](https://pypi.org/project/redturtle.sesmailer/)
393
+ [![PyPI - License](https://img.shields.io/pypi/l/redturtle.sesmailer)](https://pypi.org/project/redturtle.sesmailer/)
394
+ [![CI](https://github.com/RedTurtle/redturtle.sesmailer/actions/workflows/main.yml/badge.svg)](https://github.com/RedTurtle/redturtle.sesmailer/actions/workflows/main.yml)
395
+
396
+ </div>
397
+
398
+ Send the emails of Plone's `MailHost` through the **Amazon SES v2 API**
399
+ (HTTPS, boto3) instead of SMTP.
400
+
401
+ ## Why
402
+
403
+ Some AWS regions (for example **eu-south-1, Milan**) have no SES SMTP
404
+ endpoint, only the API. This add-on lets Plone use SES in those regions
405
+ without external relays.
406
+
407
+ It replaces the mailer used by `Products.MailHost` with one based on
408
+ `sesv2.send_email` (raw content). Plone's transactional behavior is
409
+ unchanged: mails are sent at transaction commit, `immediate=True` sends at
410
+ once, and the `zope.sendmail` queue processor (if configured) uses SES too.
411
+
412
+ It is enabled and configured **only through environment variables**. If
413
+ `SES_REGION` is not set, Plone keeps using SMTP exactly as before.
414
+
415
+ ## Installation
416
+
417
+ Install `redturtle.sesmailer` with `pip`:
418
+
419
+ ```shell
420
+ pip install redturtle.sesmailer
421
+ ```
422
+
423
+ (or add it to your `mxdev` / `requirements` file). The package is loaded
424
+ through `z3c.autoinclude` (`target = plone`), so no ZCML slug is needed.
425
+
426
+ There is no persistent configuration. Installing the (empty) `default`
427
+ GenericSetup profile is optional and only makes the add-on visible in the
428
+ Add-ons control panel.
429
+
430
+ ## Configuration
431
+
432
+ Variables are read at runtime, every time a mailer is created.
433
+
434
+ | Variable | Required | Default | Meaning |
435
+ | --- | --- | --- | --- |
436
+ | `SES_REGION` | yes, to enable | — | SES region (e.g. `eu-south-1`). If missing or empty the package does nothing and Plone uses SMTP |
437
+ | `SES_CONFIGURATION_SET` | no | — | Configuration set passed on every send. Not needed if it is already the default of the identity |
438
+ | `SES_ENDPOINT_URL` | no | — | Alternative endpoint (e.g. LocalStack, tests) |
439
+ | `SES_MAX_ATTEMPTS` | no | `5` | botocore `max_attempts` (retry mode `standard`). botocore counts *retries*, so the total number of tries is this value plus one |
440
+ | `SES_CONNECT_TIMEOUT` / `SES_READ_TIMEOUT` | no | `5` / `15` | Timeouts in seconds |
441
+ | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_PROFILE`, … | no | boto3 chain | Standard AWS credentials. On EC2 prefer the instance IAM role |
442
+
443
+ Invalid numeric values are ignored (with a warning in the log) and the
444
+ default is used.
445
+
446
+ ## AWS credentials and IAM policy
447
+
448
+ Credentials come from the standard boto3 chain (instance role, environment
449
+ variables, profile). **On EC2 prefer the instance IAM role.** Credentials are
450
+ never logged.
451
+
452
+ Minimal policy, to adapt to your identity and configuration set:
453
+
454
+ ```json
455
+ {
456
+ "Version": "2012-10-17",
457
+ "Statement": [{
458
+ "Effect": "Allow",
459
+ "Action": ["ses:SendEmail", "ses:SendRawEmail"],
460
+ "Resource": [
461
+ "arn:aws:ses:<region>:<account-id>:identity/<sender-domain>",
462
+ "arn:aws:ses:<region>:<account-id>:configuration-set/<config-set>"
463
+ ],
464
+ "Condition": {"StringEquals": {"ses:FromAddress": "<sender-address>"}}
465
+ }]
466
+ }
467
+ ```
468
+
469
+ With the v2 API the evaluated action is `ses:SendEmail`; `ses:SendRawEmail`
470
+ is kept for compatibility.
471
+
472
+ ## Amazon SES notes
473
+
474
+ - A new SES account is in the **sandbox**: you can only send to verified
475
+ recipients. Request **production access** to send to anyone.
476
+ - The sender must be a **verified identity** (domain or address) in the same
477
+ region.
478
+ - Bounces and complaints are handled by SES (suppression list,
479
+ configuration set, CloudWatch), not by Plone. If you want a configuration
480
+ set applied to everything, set it as the default of the identity or use
481
+ `SES_CONFIGURATION_SET`.
482
+
483
+ ## Behavior in Plone
484
+
485
+ - *Site setup → Mail* still defines the site **sender name and address**. The
486
+ SMTP host, port, user and password are ignored while SES is active.
487
+ - "Save and send test email" works.
488
+ - `MailHost.send(..., immediate=True)` and delivery at transaction commit both
489
+ work.
490
+ - The envelope sender is the bare address of the site sender (the display
491
+ name stays in the message's `From` header). `To`/`Cc` headers are those of
492
+ the message; every envelope recipient (BCC included) is a SES destination.
493
+ - Each send logs, at INFO level, the SES `MessageId` and the recipients
494
+ (logger `redturtle.sesmailer`). The first time SES is used the log says so,
495
+ with the region.
496
+
497
+ ## How it works
498
+
499
+ `Products.MailHost` builds its mailer by calling
500
+ `Products.MailHost.MailHost.MailBase._makeMailer()` for every message (and
501
+ for the queue processor thread). This package patches that method with
502
+ `collective.monkeypatcher` (original kept as `_old__makeMailer`): without
503
+ `SES_REGION` it calls the original, otherwise it returns a `SESMailer`.
504
+
505
+ The boto3 client is cached per `(region, endpoint_url)` and shared by all
506
+ mailers and threads. Verified against `Products.MailHost` 6.0 (Plone 6.0.15);
507
+ if a future version renames the method or moves it to another class, the
508
+ patch declaration in `configure.zcml` must follow.
509
+
510
+ ## Known limitations
511
+
512
+ - SES accepts at most **50 recipients per call**: bigger recipient lists are
513
+ split in chunks of 50 with one call each. If a later chunk fails, the error
514
+ is raised and `zope.sendmail` may retry the whole message, so recipients of
515
+ the chunks already accepted can receive it twice.
516
+ - Bounces and complaints are not handled on the Plone side.
517
+ - The configuration is **process-wide**: it applies to every Plone site of
518
+ the instance, so it is not possible to have one site using SES and another
519
+ one using SMTP.
520
+ - SES API v1 is not supported.
521
+
522
+ ## Manual test
523
+
524
+ 1. Start an instance with `SES_REGION=eu-south-1` (and credentials or an
525
+ instance role) and a Plone site whose sender address belongs to a verified
526
+ identity.
527
+ 2. In *Site setup → Mail* click **Save and send test email**.
528
+ 3. In the received message check the headers `dkim=pass`, `spf=pass`,
529
+ `dmarc=pass`, and look for the `MessageId` line in the instance log.
530
+
531
+ ## Development
532
+
533
+ Prerequisites: [uv](https://docs.astral.sh/uv/), Make, Git.
534
+
535
+ ```shell
536
+ make install # create the virtualenv with Plone 6.0 constraints
537
+ make test # run the tests (no AWS access needed: botocore Stubber)
538
+ make check # format and lint
539
+ make start # start a Plone instance on localhost:8080
540
+ ```
541
+
542
+ To start the instance with SES enabled:
543
+
544
+ ```shell
545
+ SES_REGION=eu-south-1 make start
546
+ ```
547
+
548
+ ## Contribute
549
+
550
+ - [Issue tracker](https://github.com/RedTurtle/redturtle.sesmailer/issues)
551
+ - [Source code](https://github.com/RedTurtle/redturtle.sesmailer/)
552
+
553
+ Changes are recorded as [towncrier](https://towncrier.readthedocs.io/) news
554
+ fragments in the `news/` directory.
555
+
556
+ ## License
557
+
558
+ The project is licensed under GPLv2.
559
+
560
+
561
+ ---
562
+
563
+ # Changelog
564
+
565
+ <!--
566
+ You should *NOT* be adding new change log entries to this file.
567
+ You should create a file in the news directory instead.
568
+ For helpful instructions, please see:
569
+ https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst
570
+ -->
571
+
572
+ <!-- towncrier release notes start -->
573
+
574
+ ## 1.0.0a0 (2026-12-01)
575
+
576
+
577
+ ### Feature
578
+
579
+ - Send Plone MailHost emails through the Amazon SES v2 API when `SES_REGION` is set; SMTP is untouched otherwise.
@@ -0,0 +1,15 @@
1
+ redturtle/sesmailer/__init__.py,sha256=Hrj6omm2NnvqY_kZUoDUjVT3aIecR0USmA9Fgh2NgHo,225
2
+ redturtle/sesmailer/client.py,sha256=bu9bJMzpQqH6hvLVa4hqpq1sv6hZIQxtebnef4mhei0,1373
3
+ redturtle/sesmailer/config.py,sha256=ztxGI5DO5JOmcguiRT3L30PC0Gd_yl-Mc90Bz474A6I,1601
4
+ redturtle/sesmailer/configure.zcml,sha256=FPSIg_xOfyy-NtODmf2EuIZ8_O-NrRt_-NycjoudTOk,502
5
+ redturtle/sesmailer/mailer.py,sha256=cs7nz6IM445UWJoi7DGlaoxrrZJMw9ljItOKsTbyy58,3359
6
+ redturtle/sesmailer/patches.py,sha256=HAcdRpMGd0i_KExOmjdDZb2PxigKFHntc-ELc1l6bxk,881
7
+ redturtle/sesmailer/profiles.zcml,sha256=l8jMBAdG1_I4y1RLmPB6yV889f2qHzAfcFQGpTq-XbQ,641
8
+ redturtle/sesmailer/testing.py,sha256=cpOWASoaHFKKac-_eTgaJCiwVe-njDrnDOlQ4e-ierQ,919
9
+ redturtle/sesmailer/profiles/default/metadata.xml,sha256=O70TBKOUuQDno74wE4MOfNoCvFConc7szmJhDsJdP1s,88
10
+ redturtle_sesmailer-1.0.0a0.dist-info/METADATA,sha256=SPas7D8YW6e1v4_1uYRRuoISrl8Xr7M5bddpYiJq5gY,30226
11
+ redturtle_sesmailer-1.0.0a0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
12
+ redturtle_sesmailer-1.0.0a0.dist-info/entry_points.txt,sha256=b5cHz9FINNyhunUZ6BJOQMhgeAi2x9UcnAkA9l8KEC4,40
13
+ redturtle_sesmailer-1.0.0a0.dist-info/licenses/LICENSE.GPL,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
14
+ redturtle_sesmailer-1.0.0a0.dist-info/licenses/LICENSE.md,sha256=Qttjrf3tsFf49zfyNK1_0VciwBcPazclMCn-txkmbFo,659
15
+ redturtle_sesmailer-1.0.0a0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [z3c.autoinclude.plugin]
2
+ target = plone
@@ -0,0 +1,339 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
@@ -0,0 +1,15 @@
1
+ redturtle.sesmailer Copyright 2026, RedTurtle
2
+
3
+ This program is free software; you can redistribute it and/or
4
+ modify it under the terms of the GNU General Public License version 2
5
+ as published by the Free Software Foundation.
6
+
7
+ This program is distributed in the hope that it will be useful,
8
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ GNU General Public License for more details.
11
+
12
+ You should have received a copy of the GNU General Public License
13
+ along with this program; if not, write to the Free Software
14
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15
+ MA 02111-1307 USA.