[tor-commits] [bridgedb/master] 5258 - make SMTP server configurable
arma at torproject.org
arma at torproject.org
Thu Mar 8 02:32:42 UTC 2012
commit 1b1cc25325eca7aa3095889c21f6289b39acd757
Author: aagbsn <aagbsn at extc.org>
Date: Tue Feb 28 05:57:43 2012 -0800
5258 - make SMTP server configurable
---
bridgedb.conf | 2 ++
lib/bridgedb/Main.py | 2 ++
lib/bridgedb/Server.py | 5 ++---
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bridgedb.conf b/bridgedb.conf
index e5d7314..5d5dbad 100644
--- a/bridgedb.conf
+++ b/bridgedb.conf
@@ -102,6 +102,8 @@ EMAIL_SHARE=10
# the MAIL FROM header in outgoing SMTP.
EMAIL_FROM_ADDR = "bridges at torproject.org"
EMAIL_SMTP_FROM_ADDR = "bridges at torproject.org"
+EMAIL_SMTP_HOST = "127.0.0.1"
+EMAIL_SMTP_PORT = 25
# Reject any RCPT TO lines that aren't to this user.
EMAIL_USERNAME = "bridges"
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index 55f2956..648accd 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -94,6 +94,8 @@ CONFIG = Conf(
EMAIL_PORT=6725,
EMAIL_N_BRIDGES_PER_ANSWER=2,
EMAIL_INCLUDE_FINGERPRINTS = False,
+ EMAIL_SMTP_HOST="127.0.0.1",
+ EMAIL_SMTP_PORT=25,
RESERVED_SHARE=2,
diff --git a/lib/bridgedb/Server.py b/lib/bridgedb/Server.py
index 57f49a1..a1b837a 100644
--- a/lib/bridgedb/Server.py
+++ b/lib/bridgedb/Server.py
@@ -514,9 +514,8 @@ class MailContext:
# Reject any mail longer than this.
self.maximumSize = 32*1024
# Use this server for outgoing mail.
-# self.smtpServer = "127.0.0.1" # XXX should make configurable
- self.smtpServer = "172.22.121.1"
- self.smtpPort = 25
+ self.smtpServer = (cfg.EMAIL_SMTP_HOST or "127.0.0.1")
+ self.smtpPort = (cfg.EMAIL_SMTP_PORT or 25)
# Use this address in the MAIL FROM line for outgoing mail.
self.smtpFromAddr = (cfg.EMAIL_SMTP_FROM_ADDR or
"bridges at torproject.org")
More information about the tor-commits
mailing list