Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
555014ea
Commit
555014ea
authored
Aug 24, 2007
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for no_tls, force_tls options
parent
1c736329
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
lib/python/Products/MailHost/MailHost.py
lib/python/Products/MailHost/MailHost.py
+14
-6
No files found.
lib/python/Products/MailHost/MailHost.py
View file @
555014ea
...
@@ -96,8 +96,9 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -96,8 +96,9 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
)
)
def
__init__
(
self
,
id
=
''
,
title
=
''
,
smtp_host
=
'localhost'
,
smtp_port
=
25
,
def
__init__
(
self
,
id
=
''
,
title
=
''
,
smtp_host
=
'localhost'
,
smtp_port
=
25
,
smtp_uid
=
''
,
smtp_pwd
=
''
,
smtp_queue
=
False
,
smtp_queue_directory
=
'/tmp'
):
force_tls
=
False
,
no_tls
=
False
,
smtp_uid
=
''
,
smtp_pwd
=
''
,
smtp_queue
=
False
,
smtp_queue_directory
=
'/tmp'
):
"""Initialize a new MailHost instance """
"""Initialize a new MailHost instance """
self
.
id
=
id
self
.
id
=
id
self
.
title
=
title
self
.
title
=
title
...
@@ -105,6 +106,8 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -105,6 +106,8 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
self
.
smtp_port
=
int
(
smtp_port
)
self
.
smtp_port
=
int
(
smtp_port
)
self
.
smtp_uid
=
smtp_uid
self
.
smtp_uid
=
smtp_uid
self
.
smtp_pwd
=
smtp_pwd
self
.
smtp_pwd
=
smtp_pwd
self
.
force_tls
=
force_tls
self
.
no_tls
=
no_tls
self
.
smtp_queue
=
smtp_queue
self
.
smtp_queue
=
smtp_queue
self
.
smtp_queue_directory
=
smtp_queue_directory
self
.
smtp_queue_directory
=
smtp_queue_directory
...
@@ -117,6 +120,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -117,6 +120,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
security
.
declareProtected
(
change_configuration
,
'manage_makeChanges'
)
security
.
declareProtected
(
change_configuration
,
'manage_makeChanges'
)
def
manage_makeChanges
(
self
,
title
,
smtp_host
,
smtp_port
,
smtp_uid
=
''
,
smtp_pwd
=
''
,
def
manage_makeChanges
(
self
,
title
,
smtp_host
,
smtp_port
,
smtp_uid
=
''
,
smtp_pwd
=
''
,
smtp_queue
=
False
,
smtp_queue_directory
=
'/tmp'
,
smtp_queue
=
False
,
smtp_queue_directory
=
'/tmp'
,
force_tls
=
False
,
no_tls
=
False
,
REQUEST
=
None
):
REQUEST
=
None
):
'make the changes'
'make the changes'
...
@@ -129,6 +133,8 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -129,6 +133,8 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
self
.
smtp_port
=
smtp_port
self
.
smtp_port
=
smtp_port
self
.
smtp_uid
=
smtp_uid
self
.
smtp_uid
=
smtp_uid
self
.
smtp_pwd
=
smtp_pwd
self
.
smtp_pwd
=
smtp_pwd
self
.
no_tls
=
no_tls
self
.
force_tls
=
force_tls
self
.
smtp_queue
=
smtp_queue
self
.
smtp_queue
=
smtp_queue
self
.
smtp_queue_directory
=
smtp_queue_directory
self
.
smtp_queue_directory
=
smtp_queue_directory
...
@@ -189,10 +195,12 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -189,10 +195,12 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
def
_makeMailer
(
self
):
def
_makeMailer
(
self
):
""" Create a SMTPMailer """
""" Create a SMTPMailer """
return
SMTPMailer
(
self
.
smtp_host
,
return
SMTPMailer
(
hostname
=
self
.
smtp_host
,
int
(
self
.
smtp_port
),
int
(
self
.
smtp_port
),
self
.
smtp_uid
or
None
,
username
=
self
.
smtp_uid
or
None
,
self
.
smtp_pwd
or
None
password
=
self
.
smtp_pwd
or
None
,
no_tls
=
self
.
no_tls
,
force_tls
=
self
.
force_tls
)
)
@
synchronized
(
lock
)
@
synchronized
(
lock
)
...
@@ -205,7 +213,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -205,7 +213,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
thread
.
stop
()
thread
.
stop
()
while
thread
.
isAlive
():
while
thread
.
isAlive
():
# wait until thread is really dead
# wait until thread is really dead
time
.
sleep
(
0.
1
)
time
.
sleep
(
0.
3
)
del
queue_threads
[
path
]
del
queue_threads
[
path
]
LOG
.
info
(
'Thread for %s stopped'
%
path
)
LOG
.
info
(
'Thread for %s stopped'
%
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment