Author
|
zPlus <zplus@peers.community>
2023-03-21 21:27:47
|
Committer
|
zPlus <zplus@peers.community>
2023-03-21 21:27:47
|
Commit
|
3dfb528
(patch)
|
Tree
|
03252d7
|
Parent(s)
|
|
Check for email body length on (un-)subscription request.
commits diff:
64641d0..3dfb528
1 file changed,
4 insertions,
4 deletions
—
download
Diffstat
Diff options
+4/-4
M emails.py
136
|
136
|
|
###############################################################################
|
137
|
137
|
|
|
138
|
138
|
|
# Is this a request for subscription?
|
139
|
|
- |
request_subscribe = email_subject.upper('SUBSCRIBE')
|
140
|
|
- |
request_unsubscribe = email_subject.upper('UNSUBSCRIBE')
|
|
139
|
+ |
request_subscribe = email_subject.upper('SUBSCRIBE') and len(email_body) == 0
|
|
140
|
+ |
request_unsubscribe = email_subject.upper('UNSUBSCRIBE') and len(email_body) == 0
|
141
|
141
|
|
|
142
|
142
|
|
if request_subscribe:
|
143
|
143
|
|
# Already subscribed?
|
148
|
148
|
|
subscribers.append(email_from[1])
|
149
|
149
|
|
commit_message = 'Subscribe'
|
150
|
150
|
|
|
151
|
|
- |
if request_unsubscribe
|
|
151
|
+ |
if request_unsubscribe:
|
152
|
152
|
|
# Already unsubscribed?
|
153
|
153
|
|
if email_from[1] not in subscribers:
|
154
|
154
|
|
logging.info('{} already unsubscribed from {}'.format(email_from, repository_path))
|
192
|
192
|
|
# for the thread. Otherwise, we will create a new tree.
|
193
|
193
|
|
###############################################################################
|
194
|
194
|
|
|
195
|
|
- |
if not email_body or len(email_body) == 0:
|
|
195
|
+ |
if len(email_body) == 0:
|
196
|
196
|
|
logging.info('Refuting email without plaintext body: {}'.format(email_subject))
|
197
|
197
|
|
exit()
|
198
|
198
|
|
|