From ee1343ade4a8c1900a4c9ad7d5ab4e99367b7052 Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Fri, 1 Jun 2012 11:09:29 +0300
Subject: [PATCH] add smtp.port configuration for non-standard smtp ports

---
 lib/configuration.js | 3 ++-
 lib/email.js         | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/configuration.js b/lib/configuration.js
index 4c4957e57..f7c135ad0 100644
--- a/lib/configuration.js
+++ b/lib/configuration.js
@@ -114,7 +114,8 @@ var conf = module.exports = convict({
   smtp: {
     host: 'string?',
     user: 'string?',
-    pass: 'string?'
+    pass: 'string?',
+    port: 'integer = 25'
   },
   statsd: {
     enabled: {
diff --git a/lib/email.js b/lib/email.js
index 4bb0c50d6..ee444477b 100644
--- a/lib/email.js
+++ b/lib/email.js
@@ -13,7 +13,10 @@ logger = require('./logging.js').logger;
 /* if smtp parameters are configured, use them */
 try { var smtp_params = config.get('smtp'); } catch(e) {};
 if (smtp_params && smtp_params.host) {
-  emailer.SMTP = { host: smtp_params.host };
+  emailer.SMTP = {
+    host: smtp_params.host,
+    port: smtp_params.port
+  };
   logger.info("delivering email via SMTP host: " +  emailer.SMTP.host);
   if (smtp_params.user) {
     emailer.SMTP.use_authentication = true;
-- 
GitLab