Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-publish-by-email
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hugo Hörnquist
wp-publish-by-email
Commits
93a5d716
Commit
93a5d716
authored
2 years ago
by
Hugo Hörnquist
Browse files
Options
Downloads
Patches
Plain Diff
Allow multiple different destinations.
parent
8690d9ee
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+11
-1
11 additions, 1 deletion
main.py
with
11 additions
and
1 deletion
main.py
100644 → 100755
+
11
−
1
View file @
93a5d716
#!/usr/bin/env python3
import
smtpd
import
asyncore
from
email
import
message_from_bytes
...
...
@@ -17,7 +19,15 @@ class CustomSMTPServer(smtpd.SMTPServer):
print
(
"
Title missing
"
)
return
if
'
massutskick@vastgota.nation.liu.se
'
not
in
msg
.
get
(
'
To
'
):
valid_destinations
=
[
'
massutskick@vastgota.nation.liu.se
'
,
'
massutskick@vastgota.lysator.liu.se
'
,
]
for
destination
in
valid_destinations
:
if
destination
in
msg
.
get
(
'
To
'
):
break
else
:
print
(
'
Will only publish massutskick
'
)
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment