equal
deleted
inserted
replaced
9 local imap_port = module:get_option_number("imap_auth_port"); |
9 local imap_port = module:get_option_number("imap_auth_port"); |
10 |
10 |
11 local imap_service_realm = module:get_option_string("imap_auth_realm", module:get_option("sasl_realm")); |
11 local imap_service_realm = module:get_option_string("imap_auth_realm", module:get_option("sasl_realm")); |
12 local imap_service_name = module:get_option_string("imap_auth_service_name"); |
12 local imap_service_name = module:get_option_string("imap_auth_service_name"); |
13 local append_host = module:get_option_boolean("auth_append_host"); |
13 local append_host = module:get_option_boolean("auth_append_host"); |
|
14 local strip_host = module:get_option_boolean("auth_strip_host"); |
14 |
15 |
15 local verify_certificate = module:get_option_boolean("auth_imap_verify_certificate", true); |
16 local verify_certificate = module:get_option_boolean("auth_imap_verify_certificate", true); |
16 local ssl_params = module:get_option("auth_imap_ssl", { |
17 local ssl_params = module:get_option("auth_imap_ssl", { |
17 mode = "client", protocol = "sslv23"; |
18 mode = "client", protocol = "sslv23"; |
18 capath = "/etc/ssl/certs"; |
19 capath = "/etc/ssl/certs"; |
26 local new_sasl = function(realm) |
27 local new_sasl = function(realm) |
27 return new_imap_sasl( |
28 return new_imap_sasl( |
28 imap_service_realm or realm, |
29 imap_service_realm or realm, |
29 imap_service_name or "xmpp", |
30 imap_service_name or "xmpp", |
30 imap_host, imap_port, |
31 imap_host, imap_port, |
31 ssl_params, append_host |
32 ssl_params, append_host, strip_host |
32 ); |
33 ); |
33 end |
34 end |
34 |
35 |
35 do |
36 do |
36 local s = new_sasl(module.host) |
37 local s = new_sasl(module.host) |