summaryrefslogtreecommitdiff
path: root/sw/source/uibase/dbui/mmconfigitem.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2018-01-18 18:49:07 +0300
committerCaolán McNamara <caolanm@redhat.com>2018-01-28 14:35:48 +0100
commit972cb3ea9949325d74b9d7d919765e22df0101d7 (patch)
treeb8f62ea76ce77560b59b4c0efe4e5b0787af724c /sw/source/uibase/dbui/mmconfigitem.cxx
parent69acbf1994a2fd8606b119e7716996fb103b75c8 (diff)
mailconfig UI: default POP port 995 and toggle with IMAP ports
SSL is now default, so change POP3's default to port 995. Also, suggest appropriate secure/insecure ports for IMAP and POP as the user switches between them. Change-Id: Ib930504956a222d0d6eb3cad969907751602c106 Reviewed-on: https://gerrit.libreoffice.org/48212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase/dbui/mmconfigitem.cxx')
-rw-r--r--sw/source/uibase/dbui/mmconfigitem.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/sw/source/uibase/dbui/mmconfigitem.cxx b/sw/source/uibase/dbui/mmconfigitem.cxx
index 92fbccf8381d..ee4645e1801d 100644
--- a/sw/source/uibase/dbui/mmconfigitem.cxx
+++ b/sw/source/uibase/dbui/mmconfigitem.cxx
@@ -62,6 +62,9 @@ const char cDataCommandType[] = "DataSource/DataCommandType";
#define SECURE_PORT 587
#define DEFAULT_PORT 25
#define POP_PORT 110
+#define POP_SECURE_PORT 995
+#define IMAP_PORT 143
+#define IMAP_SECURE_PORT 993
struct DBAddressDataAssignment
{
@@ -191,7 +194,7 @@ SwMailMergeConfigItem_Impl::SwMailMergeConfigItem_Impl() :
m_bIsGreetingLineInMail(false),
m_bIsIndividualGreetingLineInMail(false),
m_bIsSMPTAfterPOP(false),
- m_nInServerPort( POP_PORT ),
+ m_nInServerPort( POP_SECURE_PORT ),
m_bInServerPOP( true ),
m_nMailPort(0),
m_bIsMailReplyTo(false),
@@ -1479,7 +1482,21 @@ void SwMailMergeConfigItem::SetInServerName(const OUString& rServer)
sal_Int16 SwMailMergeConfigItem::GetInServerPort() const
{
- return m_pImpl->m_nInServerPort;
+ // provide appropriate TCP port as user toggles between POP/IMAP if current port is one of the defaults
+ switch (m_pImpl->m_nInServerPort)
+ {
+ case POP_SECURE_PORT:
+ case POP_PORT:
+ case IMAP_SECURE_PORT:
+ case IMAP_PORT:
+ if ( m_pImpl->m_bInServerPOP )
+ return m_pImpl->m_bIsSecureConnection ? POP_SECURE_PORT : POP_PORT;
+ else
+ return m_pImpl->m_bIsSecureConnection ? IMAP_SECURE_PORT : IMAP_PORT;
+ break;
+ default:
+ return m_pImpl->m_nInServerPort;
+ }
}
void SwMailMergeConfigItem::SetInServerPort(sal_Int16 nSet)