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
6ad8231d
Commit
6ad8231d
authored
Aug 24, 2007
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for force_tls flag. Leaving the no_tls flag out right now.
parent
555014ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
lib/python/Products/MailHost/MailHost.py
lib/python/Products/MailHost/MailHost.py
+3
-6
lib/python/Products/MailHost/dtml/manageMailHost.dtml
lib/python/Products/MailHost/dtml/manageMailHost.dtml
+17
-0
No files found.
lib/python/Products/MailHost/MailHost.py
View file @
6ad8231d
...
@@ -97,7 +97,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -97,7 +97,7 @@ 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
,
force_tls
=
False
,
no_tls
=
False
,
force_tls
=
False
,
smtp_uid
=
''
,
smtp_pwd
=
''
,
smtp_queue
=
False
,
smtp_queue_directory
=
'/tmp'
):
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
...
@@ -107,7 +107,6 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -107,7 +107,6 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
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
.
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
...
@@ -120,7 +119,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -120,7 +119,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
,
force_tls
=
False
,
REQUEST
=
None
):
REQUEST
=
None
):
'make the changes'
'make the changes'
...
@@ -133,7 +132,6 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -133,7 +132,6 @@ 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
.
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
...
@@ -196,10 +194,9 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
...
@@ -196,10 +194,9 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
def
_makeMailer
(
self
):
def
_makeMailer
(
self
):
""" Create a SMTPMailer """
""" Create a SMTPMailer """
return
SMTPMailer
(
hostname
=
self
.
smtp_host
,
return
SMTPMailer
(
hostname
=
self
.
smtp_host
,
int
(
self
.
smtp_port
),
port
=
int
(
self
.
smtp_port
),
username
=
self
.
smtp_uid
or
None
,
username
=
self
.
smtp_uid
or
None
,
password
=
self
.
smtp_pwd
or
None
,
password
=
self
.
smtp_pwd
or
None
,
no_tls
=
self
.
no_tls
,
force_tls
=
self
.
force_tls
force_tls
=
self
.
force_tls
)
)
...
...
lib/python/Products/MailHost/dtml/manageMailHost.dtml
View file @
6ad8231d
...
@@ -76,6 +76,23 @@
...
@@ -76,6 +76,23 @@
<span class="form-help">(optional for SMTP AUTH)</span>
<span class="form-help">(optional for SMTP AUTH)</span>
</td>
</td>
</tr>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Force TLS
</div>
</td>
<td align="left" valign="top">
<input type="checkbox" name="force_tls:boolean" value="1"
<dtml-if "force_tls">checked</dtml-if>
</td>
<td>
<span class="form-help">(enforce the use of an encrypted connection
to the SMTP server. Mail delivery fails if the SMTP server
does not support encryption)
</span>
</td>
</tr>
<tr>
<tr>
<td align="left" valign="top">
<td align="left" valign="top">
<div class="form-label">
<div class="form-label">
...
...
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