comparison conf/Init.luan @ 42:af4632c42979

fix init conf to fix subscription emails
author Vadim Filimonov <fffilimonov@yandex.ru>
date Mon, 07 Jun 2021 09:52:13 +0300
parents 862b1ef23e75
children 4d90d48a19ec
comparison
equal deleted inserted replaced
41:f903ebdfa3b3 42:af4632c42979
5 local uri = Io.uri or error() 5 local uri = Io.uri or error()
6 local MailHome = require "java:fschmidt.util.mail.MailHome" 6 local MailHome = require "java:fschmidt.util.mail.MailHome"
7 local System = require "java:java.lang.System" 7 local System = require "java:java.lang.System"
8 local Logging = require "luan:logging/Logging.luan" 8 local Logging = require "luan:logging/Logging.luan"
9 local logger = Logging.logger "Init_default" 9 local logger = Logging.logger "Init_default"
10 10 local pairs = Luan.pairs or error()
11 11
12 local Init = {} 12 local Init = {}
13 13
14 System.setProperty("mail.smtp.host", "127.0.0.1") 14 System.setProperty("mail.smtp.host", "mail.smtp2go.com")
15 System.setProperty("mail.mime.base64.ignoreerrors", "true") 15 System.setProperty("mail.mime.base64.ignoreerrors", "true")
16 System.setProperty("mail.mime.address.strict", "false") 16 System.setProperty("mail.mime.address.strict", "false")
17 System.setProperty("mail.mime.decodetext.strict", "false") 17 System.setProperty("mail.mime.decodetext.strict", "false")
18 18
19 Init.dbUrl = "jdbc:postgresql://localhost:5432/nabble" 19 Init.dbUrl = "jdbc:postgresql://localhost:5432/nabble"
35 Init.nabbleHost = "me.nabble.com:8080" 35 Init.nabbleHost = "me.nabble.com:8080"
36 36
37 37
38 Init.defaultHost = "me.nabble.com:8080" 38 Init.defaultHost = "me.nabble.com:8080"
39 Init.domain = Init.defaultHost 39 Init.domain = Init.defaultHost
40 --Init.mailDomain = Init.defaultHost 40 Init.mailDomain = Init.defaultHost
41 Init.nabbleHost = Init.defaultHost 41 Init.nabbleHost = Init.defaultHost
42 Init.mailDomain = "me.nabble.com"
42 43
43 --[=[ 44 local popMailServer = "pop.fastmail.com"
45
44 local function getPop3Server(addr, pwd) 46 local function getPop3Server(addr, pwd)
45 local server = MailHome.getPop3Server(popMailServer, addr, pwd) 47 local server = MailHome.getPop3Server(popMailServer, addr, pwd)
46 server.useSsl() 48 server.useSsl()
47 return server 49 return server
48 end 50 end
49 51
50 local pop3 = {} -- fill in 52 local pop3 = {
53 lists = 'mailingListArchivePop3Server'
54 fwd = 'fwdPop3Server'
55 ml = 'subscriptionsPop3Server'
56 sb = 'subscriptionBouncesPop3Server'
57 }
51 58
52 local pop3Servers = { 59 local pop3Servers = {
53 lists = 'mailingListArchivePop3Server' 60 lists = 'mailingListArchivePop3Server'
54 fwd = 'fwdPop3Server' 61 fwd = 'fwdPop3Server'
55 ml = 'subscriptionsPop3Server' 62 ml = 'subscriptionsPop3Server'
56 sb = 'subscriptionBouncesPop3Server' 63 sb = 'subscriptionBouncesPop3Server'
57 } 64 }
65
58 for name, password in pairs(pop3) do 66 for name, password in pairs(pop3) do
59 Init[pop3Servers[name]] = getPop3Server( name.."@"..Init.mailDomain, password ) 67 Init[pop3Servers[name]] = getPop3Server( name.."@"..Init.mailDomain, password )
60 end 68 end
61 ]=]
62 69
63 --local HashSet = require "java:java.util.HashSet" 70 --local HashSet = require "java:java.util.HashSet"
64 --Init.sysadmins = HashSet.new {} -- list of emails 71 --Init.sysadmins = HashSet.new {} -- list of emails
65 72
66 --Init.monitor_emails = {} -- list of emails 73 --Init.monitor_emails = {} -- list of emails