django-codenerix-email 4.0.34__py2.py3-none-any.whl → 4.0.36__py2.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.
- codenerix_email/__init__.py +1 -1
- codenerix_email/__pycache__/__init__.cpython-310.pyc +0 -0
- codenerix_email/__pycache__/__init__.cpython-311.pyc +0 -0
- codenerix_email/__pycache__/models.cpython-310.pyc +0 -0
- codenerix_email/__pycache__/models.cpython-311.pyc +0 -0
- codenerix_email/management/commands/__pycache__/email_test.cpython-311.pyc +0 -0
- codenerix_email/management/commands/__pycache__/emails_recv.cpython-311.pyc +0 -0
- codenerix_email/management/commands/__pycache__/emails_send.cpython-311.pyc +0 -0
- codenerix_email/management/commands/__pycache__/recv_emails.cpython-311.pyc +0 -0
- codenerix_email/management/commands/__pycache__/send_emails.cpython-311.pyc +0 -0
- codenerix_email/management/commands/__pycache__/test_email.cpython-311.pyc +0 -0
- codenerix_email/management/commands/email_test.py +174 -0
- codenerix_email/management/commands/emails_recv.py +601 -0
- codenerix_email/management/commands/emails_send.py +238 -0
- codenerix_email/management/commands/recv_emails.py +8 -598
- codenerix_email/management/commands/send_emails.py +8 -241
- codenerix_email/management/commands/test_email.py +8 -171
- codenerix_email/models.py +16 -18
- {django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/METADATA +1 -1
- {django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/RECORD +23 -16
- {django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/LICENSE +0 -0
- {django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/WHEEL +0 -0
- {django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/top_level.txt +0 -0
|
@@ -1,244 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
# django-codenerix-email
|
|
4
|
-
#
|
|
5
|
-
# Codenerix GNU
|
|
6
|
-
#
|
|
7
|
-
# Project URL : http://www.codenerix.com
|
|
8
|
-
#
|
|
9
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
# you may not use this file except in compliance with the License.
|
|
11
|
-
# You may obtain a copy of the License at
|
|
12
|
-
#
|
|
13
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
#
|
|
15
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
# See the License for the specific language governing permissions and
|
|
19
|
-
# limitations under the License.
|
|
1
|
+
import sys
|
|
20
2
|
|
|
21
|
-
|
|
3
|
+
if not sys.argv[0].startswith("email"):
|
|
4
|
+
import logging
|
|
22
5
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
logger = logging.getLogger("codenerix")
|
|
7
|
+
logger.warning(
|
|
8
|
+
"WARNING: 'send_emails' is DEPRECATED, switch to 'emails_send' instead"
|
|
9
|
+
)
|
|
26
10
|
|
|
27
|
-
from
|
|
28
|
-
from codenerix_email.models import EmailMessage
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class Command(BaseCommand, Debugger):
|
|
32
|
-
|
|
33
|
-
# Show this when the user types help
|
|
34
|
-
help = "Try to send all emails in the queue"
|
|
35
|
-
|
|
36
|
-
def add_arguments(self, parser):
|
|
37
|
-
|
|
38
|
-
# Named (optional) arguments
|
|
39
|
-
parser.add_argument(
|
|
40
|
-
"-d",
|
|
41
|
-
action="store_true",
|
|
42
|
-
dest="d",
|
|
43
|
-
default=False,
|
|
44
|
-
help="Keep the command working forever as a daemon",
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# Named (optional) arguments
|
|
48
|
-
parser.add_argument(
|
|
49
|
-
"--daemon",
|
|
50
|
-
action="store_true",
|
|
51
|
-
dest="daemon",
|
|
52
|
-
default=False,
|
|
53
|
-
help="Keep the command working forever as a daemon",
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
# Named (optional) arguments
|
|
57
|
-
parser.add_argument(
|
|
58
|
-
"-c",
|
|
59
|
-
action="store_true",
|
|
60
|
-
dest="c",
|
|
61
|
-
default=False,
|
|
62
|
-
help="Clear the sending status to all the Queue",
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
# Named (optional) arguments
|
|
66
|
-
parser.add_argument(
|
|
67
|
-
"--clear",
|
|
68
|
-
action="store_true",
|
|
69
|
-
dest="clear",
|
|
70
|
-
default=False,
|
|
71
|
-
help="Clear the sending status to all the Queue",
|
|
72
|
-
)
|
|
73
|
-
# Named (optional) arguments
|
|
74
|
-
parser.add_argument(
|
|
75
|
-
"--verbose",
|
|
76
|
-
action="store_true",
|
|
77
|
-
dest="verbose",
|
|
78
|
-
default=False,
|
|
79
|
-
help="Enable verbose mode",
|
|
80
|
-
)
|
|
81
|
-
# Named (optional) arguments
|
|
82
|
-
parser.add_argument(
|
|
83
|
-
"--now",
|
|
84
|
-
action="store_true",
|
|
85
|
-
dest="now",
|
|
86
|
-
default=False,
|
|
87
|
-
help="Send now, do not wait the retry time",
|
|
88
|
-
)
|
|
89
|
-
# Named (optional) arguments
|
|
90
|
-
parser.add_argument(
|
|
91
|
-
"--all",
|
|
92
|
-
action="store_true",
|
|
93
|
-
dest="all",
|
|
94
|
-
default=False,
|
|
95
|
-
help="Send all, do not do on buckets",
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
def handle(self, *args, **options):
|
|
99
|
-
|
|
100
|
-
# Get user configuration
|
|
101
|
-
daemon = bool(options["daemon"] or options["d"])
|
|
102
|
-
clear = bool(options["clear"] or options["c"])
|
|
103
|
-
bucket_size = getattr(settings, "CLIENT_EMAIL_BUCKETS", 10)
|
|
104
|
-
verbose = bool(options.get("verbose", False))
|
|
105
|
-
sendnow = bool(options.get("now", False))
|
|
106
|
-
doall = bool(options.get("all", False))
|
|
107
|
-
|
|
108
|
-
# Autoconfigure Debugger
|
|
109
|
-
self.set_name("CODENERIX-EMAIL")
|
|
110
|
-
self.set_debug()
|
|
111
|
-
|
|
112
|
-
# Daemon
|
|
113
|
-
if verbose:
|
|
114
|
-
if daemon:
|
|
115
|
-
self.debug(
|
|
116
|
-
"Starting command in DAEMON mode with a "
|
|
117
|
-
f"queue of {bucket_size} emails",
|
|
118
|
-
color="cyan",
|
|
119
|
-
)
|
|
120
|
-
else:
|
|
121
|
-
self.debug(
|
|
122
|
-
"Starting a queue of {} emails".format(bucket_size),
|
|
123
|
-
color="blue",
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
# In if requested set sending status for all the list to False
|
|
127
|
-
if clear:
|
|
128
|
-
EmailMessage.objects.filter(sending=True).update(sending=False)
|
|
129
|
-
|
|
130
|
-
# Get a bunch of emails in the queue
|
|
131
|
-
connection = None
|
|
132
|
-
|
|
133
|
-
# If daemon mode is requested
|
|
134
|
-
first = True
|
|
135
|
-
while first or daemon:
|
|
136
|
-
|
|
137
|
-
# Get a bucket of emails
|
|
138
|
-
emails = EmailMessage.objects.filter(
|
|
139
|
-
sent=False,
|
|
140
|
-
sending=False,
|
|
141
|
-
error=False,
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
# If we do not have to send now we have to wait for the next retry
|
|
145
|
-
if not sendnow:
|
|
146
|
-
emails = emails.filter(
|
|
147
|
-
next_retry__lte=timezone.now(),
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
# Order emails by priority and next retry
|
|
151
|
-
emails = emails.order_by("priority", "next_retry")
|
|
152
|
-
|
|
153
|
-
# Send in buckets if we are not doing them all
|
|
154
|
-
if not doall:
|
|
155
|
-
emails = emails[0 : bucket_size + 1]
|
|
156
|
-
|
|
157
|
-
# Check if there are emails to process
|
|
158
|
-
if emails:
|
|
159
|
-
|
|
160
|
-
# Convert to list
|
|
161
|
-
list_emails = [x.pk for x in emails]
|
|
162
|
-
|
|
163
|
-
# Set sending status for all the list
|
|
164
|
-
EmailMessage.objects.filter(pk__in=list_emails).update(
|
|
165
|
-
sending=True
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
# For each email
|
|
169
|
-
for email in emails:
|
|
170
|
-
if verbose:
|
|
171
|
-
self.debug(
|
|
172
|
-
"Sending to {}".format(email.eto),
|
|
173
|
-
color="white",
|
|
174
|
-
tail=False,
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
# Check if we have connection
|
|
178
|
-
if not connection:
|
|
179
|
-
if verbose:
|
|
180
|
-
self.debug(
|
|
181
|
-
" - Connecting",
|
|
182
|
-
color="yellow",
|
|
183
|
-
head=False,
|
|
184
|
-
tail=False,
|
|
185
|
-
)
|
|
186
|
-
connection = email.connect()
|
|
187
|
-
|
|
188
|
-
# Send the email
|
|
189
|
-
try:
|
|
190
|
-
email.send(connection, debug=False)
|
|
191
|
-
except Exception as e:
|
|
192
|
-
email.sending = False
|
|
193
|
-
error = "Exception: {}\n".format(e)
|
|
194
|
-
if email.log:
|
|
195
|
-
email.log += error
|
|
196
|
-
else:
|
|
197
|
-
email.log = error
|
|
198
|
-
email.save()
|
|
199
|
-
self.error(error)
|
|
200
|
-
if verbose:
|
|
201
|
-
if email.sent:
|
|
202
|
-
self.debug(" -> SENT", color="green", head=False)
|
|
203
|
-
else:
|
|
204
|
-
self.debug(
|
|
205
|
-
" -> ERROR",
|
|
206
|
-
color="red",
|
|
207
|
-
head=False,
|
|
208
|
-
tail=False,
|
|
209
|
-
)
|
|
210
|
-
self.debug(
|
|
211
|
-
" ({} retries left)".format(
|
|
212
|
-
getattr(
|
|
213
|
-
settings, "CLIENT_EMAIL_RETRIES", 10
|
|
214
|
-
)
|
|
215
|
-
- email.retries
|
|
216
|
-
),
|
|
217
|
-
color="cyan",
|
|
218
|
-
head=False,
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
# Delete all that have been sent
|
|
222
|
-
if not getattr(settings, "CLIENT_EMAIL_HISTORY", True):
|
|
223
|
-
EmailMessage.objects.filter(
|
|
224
|
-
pk__in=list_emails, sent=True
|
|
225
|
-
).delete()
|
|
226
|
-
|
|
227
|
-
elif daemon:
|
|
228
|
-
|
|
229
|
-
# Sleep for a while
|
|
230
|
-
try:
|
|
231
|
-
time.sleep(10)
|
|
232
|
-
except KeyboardInterrupt:
|
|
233
|
-
self.debug("Exited by user request!", color="green")
|
|
234
|
-
break
|
|
235
|
-
|
|
236
|
-
elif verbose:
|
|
237
|
-
# No emails to send
|
|
238
|
-
self.debug(
|
|
239
|
-
"No emails to be sent at this moment in the queue!",
|
|
240
|
-
color="green",
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
# This was the first time
|
|
244
|
-
first = False
|
|
11
|
+
from .emails_send import * # type: ignore # noqa
|
|
@@ -1,174 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
#
|
|
3
|
-
# django-codenerix-email
|
|
4
|
-
#
|
|
5
|
-
# Codenerix GNU
|
|
6
|
-
#
|
|
7
|
-
# Project URL : http://www.codenerix.com
|
|
8
|
-
#
|
|
9
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
# you may not use this file except in compliance with the License.
|
|
11
|
-
# You may obtain a copy of the License at
|
|
12
|
-
#
|
|
13
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
#
|
|
15
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
# See the License for the specific language governing permissions and
|
|
19
|
-
# limitations under the License.
|
|
1
|
+
import sys
|
|
20
2
|
|
|
21
|
-
|
|
3
|
+
if not sys.argv[0].startswith("email"):
|
|
4
|
+
import logging
|
|
22
5
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
logger = logging.getLogger("codenerix")
|
|
7
|
+
logger.warning(
|
|
8
|
+
"WARNING: 'test_email' is DEPRECATED, switch to 'email_test' instead"
|
|
9
|
+
)
|
|
26
10
|
|
|
27
|
-
from
|
|
28
|
-
from codenerix_email.models import EmailMessage, EmailTemplate
|
|
29
|
-
from codenerix_email import __version__
|
|
30
|
-
from django.core.management import CommandError
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class Command(BaseCommand, Debugger):
|
|
34
|
-
# Show this when the user types help
|
|
35
|
-
help = "Test"
|
|
36
|
-
|
|
37
|
-
def add_arguments(self, parser):
|
|
38
|
-
parser.add_argument(
|
|
39
|
-
"--email",
|
|
40
|
-
type=str,
|
|
41
|
-
help="Email",
|
|
42
|
-
default=None,
|
|
43
|
-
)
|
|
44
|
-
parser.add_argument(
|
|
45
|
-
"--template",
|
|
46
|
-
type=str,
|
|
47
|
-
help="Template CID",
|
|
48
|
-
default=None,
|
|
49
|
-
)
|
|
50
|
-
parser.add_argument(
|
|
51
|
-
"--context",
|
|
52
|
-
type=str,
|
|
53
|
-
help="Context as JSON",
|
|
54
|
-
default="{}",
|
|
55
|
-
)
|
|
56
|
-
parser.add_argument(
|
|
57
|
-
"--language",
|
|
58
|
-
type=str,
|
|
59
|
-
help="Language",
|
|
60
|
-
default=None,
|
|
61
|
-
)
|
|
62
|
-
parser.add_argument(
|
|
63
|
-
"--stdout",
|
|
64
|
-
action="store_true",
|
|
65
|
-
help="Print to stdout",
|
|
66
|
-
default=False,
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
def handle(self, *args, **options):
|
|
70
|
-
# Autoconfigure Debugger
|
|
71
|
-
self.set_name("CODENERIX-EMAIL")
|
|
72
|
-
self.set_debug()
|
|
73
|
-
|
|
74
|
-
# Get arguments
|
|
75
|
-
email = options["email"]
|
|
76
|
-
template = options["template"]
|
|
77
|
-
context_str = options["context"]
|
|
78
|
-
language = options["language"]
|
|
79
|
-
stdout = options["stdout"]
|
|
80
|
-
|
|
81
|
-
# Read context
|
|
82
|
-
try:
|
|
83
|
-
context = json.loads(context_str)
|
|
84
|
-
except json.JSONDecodeError:
|
|
85
|
-
raise CommandError(
|
|
86
|
-
"Context is not a valid JSON string: {}".format(context_str)
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
# If no template is provided, use the default one
|
|
90
|
-
if template is None:
|
|
91
|
-
# Get the default template
|
|
92
|
-
message = """Hello,
|
|
93
|
-
|
|
94
|
-
This email has been sent using Django Codenerix Email.
|
|
95
|
-
|
|
96
|
-
Best regards, Codenerix Team
|
|
97
|
-
|
|
98
|
-
--
|
|
99
|
-
Django Codenerix Email v{}
|
|
100
|
-
""".format(
|
|
101
|
-
__version__
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
def email_message_factory(context, language):
|
|
105
|
-
email_message = EmailMessage()
|
|
106
|
-
email_message.subject = "[Codenerix Email] Test"
|
|
107
|
-
email_message.body = message
|
|
108
|
-
return email_message
|
|
109
|
-
|
|
110
|
-
else:
|
|
111
|
-
# Get the template
|
|
112
|
-
try:
|
|
113
|
-
template = EmailTemplate.objects.get(cid=template)
|
|
114
|
-
except EmailTemplate.DoesNotExist:
|
|
115
|
-
raise CommandError(
|
|
116
|
-
"Template with CID {} does not exist.".format(template)
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
# Render the template
|
|
120
|
-
def email_message_factory(context, language):
|
|
121
|
-
return template.get_email(context, language)
|
|
122
|
-
|
|
123
|
-
# If no email is provided, send to all admins
|
|
124
|
-
if email is None:
|
|
125
|
-
# Send email to all admins
|
|
126
|
-
for name, email in settings.ADMINS:
|
|
127
|
-
email_message = email_message_factory(context, language)
|
|
128
|
-
email_message.efrom = settings.DEFAULT_FROM_EMAIL
|
|
129
|
-
email_message.eto = email
|
|
130
|
-
|
|
131
|
-
# Prepare message ID info
|
|
132
|
-
ecid = email_message.uuid.hex
|
|
133
|
-
edomain = settings.EMAIL_FROM.split("@")[-1]
|
|
134
|
-
ets = int(timezone.now().timestamp())
|
|
135
|
-
email_message.headers = {
|
|
136
|
-
"Message-ID": f"<{ecid}-{ets}@{edomain}>",
|
|
137
|
-
"X-Codenerix-Email": "Test",
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if stdout:
|
|
141
|
-
self.debug(
|
|
142
|
-
f"Sending email to {name} <{email}> "
|
|
143
|
-
f"with subject: {email_message.subject}:\n"
|
|
144
|
-
f"{email_message.body}",
|
|
145
|
-
color="white",
|
|
146
|
-
)
|
|
147
|
-
else:
|
|
148
|
-
email_message.save()
|
|
149
|
-
email_message.send(legacy=False, silent=False)
|
|
150
|
-
else:
|
|
151
|
-
# Send email to the specified address
|
|
152
|
-
email_message = email_message_factory(context, language)
|
|
153
|
-
email_message.efrom = settings.DEFAULT_FROM_EMAIL
|
|
154
|
-
email_message.eto = email
|
|
155
|
-
|
|
156
|
-
# Prepare message ID info
|
|
157
|
-
ecid = email_message.uuid.hex
|
|
158
|
-
edomain = settings.EMAIL_FROM.split("@")[-1]
|
|
159
|
-
ets = int(timezone.now().timestamp())
|
|
160
|
-
email_message.headers = {
|
|
161
|
-
"Message-ID": f"<{ecid}-{ets}@{edomain}>",
|
|
162
|
-
"X-Codenerix-Email": "Test",
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if stdout:
|
|
166
|
-
self.debug(
|
|
167
|
-
f"Sending email to {name} <{email}> "
|
|
168
|
-
f"with subject: {email_message.subject}:\n"
|
|
169
|
-
f"{email_message.body}",
|
|
170
|
-
color="white",
|
|
171
|
-
)
|
|
172
|
-
else:
|
|
173
|
-
email_message.save()
|
|
174
|
-
email_message.send(legacy=False, silent=False)
|
|
11
|
+
from .email_test import * # type: ignore # noqa
|
codenerix_email/models.py
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import re
|
|
22
22
|
import ssl
|
|
23
23
|
import smtplib
|
|
24
|
+
import logging
|
|
24
25
|
from uuid import uuid4
|
|
25
26
|
from typing import Optional
|
|
26
27
|
|
|
@@ -55,6 +56,8 @@ BOUNCE_TYPES = (
|
|
|
55
56
|
(BOUNCE_HARD, _("Hard")),
|
|
56
57
|
)
|
|
57
58
|
|
|
59
|
+
logger = logging.getLogger("CodenerixEmail:EmailMessage")
|
|
60
|
+
|
|
58
61
|
|
|
59
62
|
def ensure_header(headers, key, value, headers_keys=None):
|
|
60
63
|
if headers_keys is None:
|
|
@@ -371,13 +374,10 @@ class EmailMessage(CodenerixModel):
|
|
|
371
374
|
content_subtype=None,
|
|
372
375
|
):
|
|
373
376
|
# Autoconfigure Debugger
|
|
374
|
-
if debug:
|
|
375
|
-
self.set_name("EmailMessage")
|
|
376
|
-
self.set_debug()
|
|
377
377
|
|
|
378
378
|
# Warn about subtype
|
|
379
379
|
if content_subtype:
|
|
380
|
-
|
|
380
|
+
logger.warning(
|
|
381
381
|
_(
|
|
382
382
|
"Programming ERROR: You are using content_subtype, this "
|
|
383
383
|
"value has been DEPRECATED and will be remove in future "
|
|
@@ -389,13 +389,10 @@ class EmailMessage(CodenerixModel):
|
|
|
389
389
|
if connection is None:
|
|
390
390
|
# Connect
|
|
391
391
|
if not silent or debug:
|
|
392
|
-
|
|
392
|
+
logger.warning("Not connected, connecting...")
|
|
393
393
|
connection = self.connect(legacy)
|
|
394
394
|
|
|
395
395
|
if self.eto:
|
|
396
|
-
if debug:
|
|
397
|
-
self.set_name("EmailMessage->{}".format(self.eto))
|
|
398
|
-
|
|
399
396
|
# Manually open the connection
|
|
400
397
|
error = None
|
|
401
398
|
try:
|
|
@@ -408,7 +405,8 @@ class EmailMessage(CodenerixModel):
|
|
|
408
405
|
connection = None
|
|
409
406
|
exceptiontxt = str(type(e)).split(".")[-1].split("'")[0]
|
|
410
407
|
ci = getattr(self, "__connect_info", {})
|
|
411
|
-
error = "{}: {} [HOST={}:{} TLS={}]\n".format(
|
|
408
|
+
error = "{}-> {}: {} [HOST={}:{} TLS={}]\n".format(
|
|
409
|
+
self.eto,
|
|
412
410
|
exceptiontxt,
|
|
413
411
|
e,
|
|
414
412
|
ci.get("host", "-"),
|
|
@@ -416,7 +414,7 @@ class EmailMessage(CodenerixModel):
|
|
|
416
414
|
ci.get("use_tls", "-"),
|
|
417
415
|
)
|
|
418
416
|
if not silent or debug:
|
|
419
|
-
|
|
417
|
+
logger.warning(error)
|
|
420
418
|
if self.log is None:
|
|
421
419
|
self.log = ""
|
|
422
420
|
self.log += f"{error}\n"
|
|
@@ -465,16 +463,16 @@ class EmailMessage(CodenerixModel):
|
|
|
465
463
|
self.sending = False
|
|
466
464
|
break
|
|
467
465
|
except ssl.SSLError as e:
|
|
468
|
-
error = f"SSLError: {e}\n"
|
|
466
|
+
error = f"{self.eto}: SSLError: {e}\n"
|
|
469
467
|
if not silent or debug:
|
|
470
|
-
|
|
468
|
+
logger.warning(error)
|
|
471
469
|
if self.log is None:
|
|
472
470
|
self.log = ""
|
|
473
471
|
self.log += f"{error}\n"
|
|
474
472
|
except smtplib.SMTPServerDisconnected as e:
|
|
475
|
-
error = f"SMTPServerDisconnected: {e}\n"
|
|
473
|
+
error = f"{self.eto}: SMTPServerDisconnected: {e}\n"
|
|
476
474
|
if not silent or debug:
|
|
477
|
-
|
|
475
|
+
logger.warning(error)
|
|
478
476
|
if self.log is None:
|
|
479
477
|
self.log = ""
|
|
480
478
|
self.log += f"{error}\n"
|
|
@@ -486,16 +484,16 @@ class EmailMessage(CodenerixModel):
|
|
|
486
484
|
OSError,
|
|
487
485
|
TimeoutError,
|
|
488
486
|
) as e:
|
|
489
|
-
error = f"SMTPServerReconnect: {e}\n"
|
|
487
|
+
error = f"{self.eto}: SMTPServerReconnect: {e}\n"
|
|
490
488
|
if not silent or debug:
|
|
491
|
-
|
|
489
|
+
logger.warning(error)
|
|
492
490
|
if self.log is None:
|
|
493
491
|
self.log = ""
|
|
494
492
|
self.log += f"{error}\n"
|
|
495
493
|
except smtplib.SMTPException as e:
|
|
496
|
-
error = f"SMTPException: {e}\n"
|
|
494
|
+
error = f"{self.eto}: SMTPException: {e}\n"
|
|
497
495
|
if not silent or debug:
|
|
498
|
-
|
|
496
|
+
logger.warning(error)
|
|
499
497
|
if self.log is None:
|
|
500
498
|
self.log = ""
|
|
501
499
|
self.log += f"{error}\n"
|
{django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-codenerix-email
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.36
|
|
4
4
|
Summary: Codenerix Email is a module that enables CODENERIX to set send emails in a general manner.
|
|
5
5
|
Home-page: https://github.com/codenerix/django-codenerix-email
|
|
6
6
|
Author: Juan Miguel Taboada Godoy <juanmi@juanmitaboada.com>, Juan Soler Ruiz <soleronline@gmail.com>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
codenerix_email/__init__.py,sha256=
|
|
1
|
+
codenerix_email/__init__.py,sha256=jSnbkwb7yLhUUQ_5XYdtPahUTqy4qyDhY4I89pNo1P0,149
|
|
2
2
|
codenerix_email/admin.py,sha256=w259UKFk_opGEl6PJjYHXWAHQ_8emgqmiixKT5Rid4A,1180
|
|
3
3
|
codenerix_email/apps.py,sha256=WXqu1XQibDDyCvvQYt2JbTK4GIpW8BNv5DCbRJS2mmk,149
|
|
4
4
|
codenerix_email/forms.py,sha256=38byLGxg1MOLAY1kAYChxYZj64tSgyfRvDcSbIOdV0I,5521
|
|
5
|
-
codenerix_email/models.py,sha256=
|
|
5
|
+
codenerix_email/models.py,sha256=SwjybHsg919OPgltvv6M9AHGxoql5sboluHRyv4WRjk,25700
|
|
6
6
|
codenerix_email/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
codenerix_email/test_settings.py,sha256=A9WT-2MMuqvW5Mrd3lkmjrf0xJZmJl3McOEeyJug1Xc,633
|
|
8
8
|
codenerix_email/urls.py,sha256=M760qDSVV3EoY9aIPdnk8DtUv5tyWO-FQWdody4KTeM,3996
|
|
@@ -827,8 +827,8 @@ codenerix_email/.mypy_cache/3.10/zoneinfo/_common.data.json,sha256=e4xbNKL_yQ5h5
|
|
|
827
827
|
codenerix_email/.mypy_cache/3.10/zoneinfo/_common.meta.json,sha256=5K19XWobpSjKwiv7bZFZRcxsEfoh7b-FhYcmqB-2Iic,1737
|
|
828
828
|
codenerix_email/.mypy_cache/3.10/zoneinfo/_tzpath.data.json,sha256=CFx7Q1XfUhhuNX69prkxyirG8rfvEDCNgEHWQigKC_A,5632
|
|
829
829
|
codenerix_email/.mypy_cache/3.10/zoneinfo/_tzpath.meta.json,sha256=d1HJ_xFBI1orlZSVhH0gHWLI-dJG3zY-ZOlctOl62yU,1765
|
|
830
|
-
codenerix_email/__pycache__/__init__.cpython-310.pyc,sha256=
|
|
831
|
-
codenerix_email/__pycache__/__init__.cpython-311.pyc,sha256=
|
|
830
|
+
codenerix_email/__pycache__/__init__.cpython-310.pyc,sha256=_4f3J5XdU0j52LgeGDjFTjpk0xy205v8xQ-OXamh4Uw,313
|
|
831
|
+
codenerix_email/__pycache__/__init__.cpython-311.pyc,sha256=VJN7jdoI4Q1zVQ_yQG9k1SqUHuDaT8RrsDbwJD1-iaI,337
|
|
832
832
|
codenerix_email/__pycache__/__init__.cpython-35.pyc,sha256=dl9lYAgrokJptUj3JAhiqTlX7d_CbncOxZeTc1USc88,308
|
|
833
833
|
codenerix_email/__pycache__/__init__.cpython-37.pyc,sha256=5d1CeFU5DrfnwrRpvSw1bHvLN9hoHXjUA3ln3rXCDo8,306
|
|
834
834
|
codenerix_email/__pycache__/__init__.cpython-39.pyc,sha256=0c6KWU_eOTlF5l9fNWv8l41b0LcfVQNUsqDvJTv2YyU,300
|
|
@@ -843,8 +843,8 @@ codenerix_email/__pycache__/forms.cpython-310.pyc,sha256=-oq5NlQGH7VkMUUMB4lXmBo
|
|
|
843
843
|
codenerix_email/__pycache__/forms.cpython-311.pyc,sha256=zNvq_Xc_bdUsG59tq9OWUiy5hoyZ035z4E5fEovr4NE,5854
|
|
844
844
|
codenerix_email/__pycache__/forms.cpython-35.pyc,sha256=z1aCJ2d8yyKJMuf5aVz0mGE6Nqi9bjU7HyDZPKxpUWc,3233
|
|
845
845
|
codenerix_email/__pycache__/forms.cpython-39.pyc,sha256=NORLA0i3bmWx-mUn3wh3JtObuR7UYKZemSU6Cl5gHM8,2988
|
|
846
|
-
codenerix_email/__pycache__/models.cpython-310.pyc,sha256=
|
|
847
|
-
codenerix_email/__pycache__/models.cpython-311.pyc,sha256=
|
|
846
|
+
codenerix_email/__pycache__/models.cpython-310.pyc,sha256=mGqvUrM4y9R0Rj_zCjrVQPLAs67eIjktc7LDslTJrMo,18271
|
|
847
|
+
codenerix_email/__pycache__/models.cpython-311.pyc,sha256=82FmyGqoonmz3JH91BClUvlTjIn43F3HB53lzq2-T38,37135
|
|
848
848
|
codenerix_email/__pycache__/models.cpython-35.pyc,sha256=oGheSKlh8Ttc6bB-qZ1JY5_6RySM9M6GY5-GCATxfes,9481
|
|
849
849
|
codenerix_email/__pycache__/models.cpython-39.pyc,sha256=ugyNNDG3k6rqsunwlcUIWADaLNvJ8snCgQwMZu9Ahac,8849
|
|
850
850
|
codenerix_email/__pycache__/test_settings.cpython-310.pyc,sha256=HH5CsPxLlq7_jW4ZCGBc1KzcV4HNQcI6YTh0wcz_F0w,715
|
|
@@ -867,9 +867,12 @@ codenerix_email/management/__pycache__/__init__.cpython-311.pyc,sha256=OtPcxwWjt
|
|
|
867
867
|
codenerix_email/management/__pycache__/__init__.cpython-35.pyc,sha256=sBoEWs6zdI0al-7t1deW9SE_Ln2RNDl2LyIiOO9gfRA,160
|
|
868
868
|
codenerix_email/management/__pycache__/__init__.cpython-39.pyc,sha256=uPXklfliVd3b8pLOJQT9ZeKcqmJMrGychvt68BsPulY,168
|
|
869
869
|
codenerix_email/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
870
|
-
codenerix_email/management/commands/
|
|
871
|
-
codenerix_email/management/commands/
|
|
872
|
-
codenerix_email/management/commands/
|
|
870
|
+
codenerix_email/management/commands/email_test.py,sha256=SPsiq0s48sEX_G3piNHq-c1gDOH800H2zTvM19ei2LY,5605
|
|
871
|
+
codenerix_email/management/commands/emails_recv.py,sha256=RsUfv5s0XMReQ1Y0LjfLp-LJ4F7nFX2z_T1-QAAWcYY,24897
|
|
872
|
+
codenerix_email/management/commands/emails_send.py,sha256=scCFklro4WVMYm-1ataSjUMsPT-Ie5u_DdA55CQcTCQ,7944
|
|
873
|
+
codenerix_email/management/commands/recv_emails.py,sha256=aXmhdXlamiNxRpMIDSKBXUBhkOcwi5l_Pme7jSQUCME,273
|
|
874
|
+
codenerix_email/management/commands/send_emails.py,sha256=a1MnpvZKAEFdXNfmI5oFUkVxy4PZ1AjaJS6GH90zeD0,273
|
|
875
|
+
codenerix_email/management/commands/test_email.py,sha256=ZRAQ7vlPVAtrulaDC7yWeY_IZlgACIdgSiZdhiwCcn0,270
|
|
873
876
|
codenerix_email/management/commands/.mypy_cache/.gitignore,sha256=amnaZw0RUw038PDP3HvtMLeOpkNOJPenMgi5guKdMiw,34
|
|
874
877
|
codenerix_email/management/commands/.mypy_cache/CACHEDIR.TAG,sha256=8cE6_FVTWMkDOw8fMKqhd_6IvaQPS4okWYQA1UeHatw,190
|
|
875
878
|
codenerix_email/management/commands/.mypy_cache/3.10/@plugins_snapshot.json,sha256=RBNvo1WzZ4oRRq0W9-hknpT7T8If536DEMBg9hyq_4o,2
|
|
@@ -1609,10 +1612,14 @@ codenerix_email/management/commands/.mypy_cache/3.10/zoneinfo/_tzpath.data.json,
|
|
|
1609
1612
|
codenerix_email/management/commands/.mypy_cache/3.10/zoneinfo/_tzpath.meta.json,sha256=OYk8PQ7lBy8EhzEZ-wVPBdLbz4UN_aH6SEappc-kQnI,1765
|
|
1610
1613
|
codenerix_email/management/commands/__pycache__/__init__.cpython-310.pyc,sha256=3-VfdLuaiBIg4KTIy7GETYTt2-AbfCU0vlH6fFZx7_M,189
|
|
1611
1614
|
codenerix_email/management/commands/__pycache__/__init__.cpython-311.pyc,sha256=yiqmtIhQMYXWx7g7XT-mvQNgGu_X2ymasWvVxIqPsBE,211
|
|
1615
|
+
codenerix_email/management/commands/__pycache__/email_test.cpython-311.pyc,sha256=ql-fe6qem8jGQCu-7Wm3ZCEvzOiVMsCdy0IxOyGnJbo,5946
|
|
1616
|
+
codenerix_email/management/commands/__pycache__/emails_recv.cpython-311.pyc,sha256=yhLzihKfS8KIBdf_WKNYaRuCpP5Lhv57Ui5eue0_hnk,20952
|
|
1617
|
+
codenerix_email/management/commands/__pycache__/emails_send.cpython-311.pyc,sha256=XSOhv92hH9G4Z9juLmXFTOLCS-oggZBA2TFyKIsxmd8,6868
|
|
1612
1618
|
codenerix_email/management/commands/__pycache__/recv_emails.cpython-310.pyc,sha256=qzj8puxw6pRAz_ptltybySs2mybOwdoZ8LB7Fw8YMGc,9897
|
|
1613
|
-
codenerix_email/management/commands/__pycache__/recv_emails.cpython-311.pyc,sha256=
|
|
1614
|
-
codenerix_email/management/commands/__pycache__/send_emails.cpython-311.pyc,sha256=
|
|
1619
|
+
codenerix_email/management/commands/__pycache__/recv_emails.cpython-311.pyc,sha256=YJoyWZ8Ax_ej7u9_YKjtru8BN8bKlMuvqNiTsLoWYUw,643
|
|
1620
|
+
codenerix_email/management/commands/__pycache__/send_emails.cpython-311.pyc,sha256=lqi8IebQlAUlOkceIp7QSYs1FyNYPG0znfxkPZm5guE,643
|
|
1615
1621
|
codenerix_email/management/commands/__pycache__/test_email.cpython-310.pyc,sha256=5X7qBWFWs7AsNgTo1DyQE0zi5gtLxiFIcwdnboZIUSg,3154
|
|
1622
|
+
codenerix_email/management/commands/__pycache__/test_email.cpython-311.pyc,sha256=pfqrykd9U6f9Droyne64rkSfGIqQauTADCEKsYXgsiQ,639
|
|
1616
1623
|
codenerix_email/migrations/0001_initial.py,sha256=bu1RU_FLeGKBjAXvOPHLUj2Ej9Ibns9PvE1CTVJf6qU,5816
|
|
1617
1624
|
codenerix_email/migrations/0002_auto_20170502_1043.py,sha256=-zoc4RuZFXJA1Fw8ECCVqAg-PYfku3yxdtYNyXPI3LM,2369
|
|
1618
1625
|
codenerix_email/migrations/0003_auto_20170921_1206.py,sha256=ncVdyZJ616vQpllGdaPbFS0n9qKfDP-TuVA5HkbPf4I,656
|
|
@@ -1680,8 +1687,8 @@ codenerix_email/migrations/__pycache__/__init__.cpython-35.pyc,sha256=2g70xiMW6o
|
|
|
1680
1687
|
codenerix_email/migrations/__pycache__/__init__.cpython-39.pyc,sha256=qNj2NH0YvoWPnCKxkVZPsEFsbM05y7t1njMskNISdVQ,168
|
|
1681
1688
|
codenerix_email/static/codenerix_email/emailmessages_rows.html,sha256=NyZpKPSHAAIywJX2ncS0H2bkqOVtMUwAdbYmkC4dKmk,2202
|
|
1682
1689
|
codenerix_email/static/codenerix_email/emailreceiveds_rows.html,sha256=k7-Qe7Y9mrKRJXl69aVe5hHUvGdyrLbMoh9gkpyCG2U,1976
|
|
1683
|
-
django_codenerix_email-4.0.
|
|
1684
|
-
django_codenerix_email-4.0.
|
|
1685
|
-
django_codenerix_email-4.0.
|
|
1686
|
-
django_codenerix_email-4.0.
|
|
1687
|
-
django_codenerix_email-4.0.
|
|
1690
|
+
django_codenerix_email-4.0.36.dist-info/LICENSE,sha256=IXMIpi75XsrJt1Sznt4EftT9c_4X0C9eqK4tHhH8H48,11339
|
|
1691
|
+
django_codenerix_email-4.0.36.dist-info/METADATA,sha256=BKIq8MArguzQgECY3LS2lyBk6jWzRfdy1OcEKhqBKVE,2676
|
|
1692
|
+
django_codenerix_email-4.0.36.dist-info/WHEEL,sha256=z9j0xAa_JmUKMpmz72K0ZGALSM_n-wQVmGbleXx2VHg,110
|
|
1693
|
+
django_codenerix_email-4.0.36.dist-info/top_level.txt,sha256=lljSA0iKE_UBEM5gIrGQwioC_i8Jjnp-aR1LFElENgw,16
|
|
1694
|
+
django_codenerix_email-4.0.36.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{django_codenerix_email-4.0.34.dist-info → django_codenerix_email-4.0.36.dist-info}/top_level.txt
RENAMED
|
File without changes
|