mail_autoconfig_revived 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.standard.yml +2 -0
  4. data/.yardopts +1 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +80 -0
  7. data/LICENSE.txt +26 -0
  8. data/README.md +62 -0
  9. data/Rakefile +38 -0
  10. data/doc/MailAutoconfig/ClientConfig.html +1418 -0
  11. data/doc/MailAutoconfig/EmailAddress.html +651 -0
  12. data/doc/MailAutoconfig/IncomingServer.html +155 -0
  13. data/doc/MailAutoconfig/OutgoingServer.html +155 -0
  14. data/doc/MailAutoconfig/Server.html +972 -0
  15. data/doc/MailAutoconfig.html +428 -0
  16. data/doc/_index.html +182 -0
  17. data/doc/class_list.html +51 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +58 -0
  20. data/doc/css/style.css +497 -0
  21. data/doc/file.README.html +134 -0
  22. data/doc/file_list.html +56 -0
  23. data/doc/frames.html +17 -0
  24. data/doc/index.html +134 -0
  25. data/doc/js/app.js +314 -0
  26. data/doc/js/full_list.js +216 -0
  27. data/doc/js/jquery.js +4 -0
  28. data/doc/method_list.html +315 -0
  29. data/doc/top-level-namespace.html +110 -0
  30. data/ispdb_data/126.com.xml +21 -0
  31. data/ispdb_data/163.com.xml +21 -0
  32. data/ispdb_data/1und1.de.xml +75 -0
  33. data/ispdb_data/a1.net.xml +22 -0
  34. data/ispdb_data/active24.com.xml +36 -0
  35. data/ispdb_data/alice.it.xml +30 -0
  36. data/ispdb_data/aol.com.xml +76 -0
  37. data/ispdb_data/arcor.de.xml +68 -0
  38. data/ispdb_data/arubapec.it.xml +34 -0
  39. data/ispdb_data/att.net.xml +34 -0
  40. data/ispdb_data/bay.wind.ne.jp.xml +28 -0
  41. data/ispdb_data/bb-niigata.jp.xml +22 -0
  42. data/ispdb_data/bell.net.xml +30 -0
  43. data/ispdb_data/biglobe.ne.jp.xml +23 -0
  44. data/ispdb_data/bigpond.com.xml +35 -0
  45. data/ispdb_data/bluewin.ch.xml +34 -0
  46. data/ispdb_data/blueyonder.co.uk.xml +38 -0
  47. data/ispdb_data/bol.com.br.xml +40 -0
  48. data/ispdb_data/broba.cc.xml +25 -0
  49. data/ispdb_data/btinternet.com.xml +35 -0
  50. data/ispdb_data/cc9.ne.jp.xml +21 -0
  51. data/ispdb_data/cek.ne.jp.xml +21 -0
  52. data/ispdb_data/centurylink.net.xml +57 -0
  53. data/ispdb_data/centurytel.net.xml +55 -0
  54. data/ispdb_data/cgl.ucsf.edu.xml +22 -0
  55. data/ispdb_data/charter.net.xml +34 -0
  56. data/ispdb_data/clio.ne.jp.xml +22 -0
  57. data/ispdb_data/clustermail.de.xml +58 -0
  58. data/ispdb_data/co1.wind.ne.jp.xml +25 -0
  59. data/ispdb_data/co2.wind.ne.jp.xml +25 -0
  60. data/ispdb_data/co3.wind.ne.jp.xml +25 -0
  61. data/ispdb_data/comcast.net.xml +54 -0
  62. data/ispdb_data/cox.net.xml +36 -0
  63. data/ispdb_data/cty-net.ne.jp.xml +35 -0
  64. data/ispdb_data/dan.wind.ne.jp.xml +28 -0
  65. data/ispdb_data/dd.iij4u.or.jp.xml +33 -0
  66. data/ispdb_data/df.eu.xml +42 -0
  67. data/ispdb_data/dondominio.com.xml +32 -0
  68. data/ispdb_data/earthlink.net.xml +35 -0
  69. data/ispdb_data/educa.madrid.org.xml +48 -0
  70. data/ispdb_data/elpasotel.net.xml +53 -0
  71. data/ispdb_data/email.it.xml +33 -0
  72. data/ispdb_data/emailsrvr.com.xml +22 -0
  73. data/ispdb_data/fastwebnet.it.xml +23 -0
  74. data/ispdb_data/francetelecom.fr.xml +35 -0
  75. data/ispdb_data/free.fr.xml +48 -0
  76. data/ispdb_data/freenet.de.xml +37 -0
  77. data/ispdb_data/gandi.net.xml +58 -0
  78. data/ispdb_data/gigahost.dk.xml +32 -0
  79. data/ispdb_data/gmx.com.xml +72 -0
  80. data/ispdb_data/gmx.net.xml +66 -0
  81. data/ispdb_data/go.tvm.ne.jp.xml +22 -0
  82. data/ispdb_data/goneo.de.xml +56 -0
  83. data/ispdb_data/goo.jp.xml +22 -0
  84. data/ispdb_data/googlemail.com.xml +79 -0
  85. data/ispdb_data/gransy.com.xml +62 -0
  86. data/ispdb_data/hal.ne.jp.xml +22 -0
  87. data/ispdb_data/hana.or.jp.xml +22 -0
  88. data/ispdb_data/hotmail.com.xml +148 -0
  89. data/ispdb_data/i.softbank.jp.xml +22 -0
  90. data/ispdb_data/ic-net.or.jp.xml +22 -0
  91. data/ispdb_data/iijmio-mail.jp.xml +26 -0
  92. data/ispdb_data/iiyama-catv.ne.jp.xml +21 -0
  93. data/ispdb_data/inbox.lv.xml +57 -0
  94. data/ispdb_data/inet-shibata.or.jp.xml +22 -0
  95. data/ispdb_data/internode.on.net.xml +32 -0
  96. data/ispdb_data/ipax.at.xml +28 -0
  97. data/ispdb_data/iwafune.ne.jp.xml +22 -0
  98. data/ispdb_data/janis.or.jp.xml +23 -0
  99. data/ispdb_data/jet.ne.jp.xml +37 -0
  100. data/ispdb_data/ji.jet.ne.jp.xml +22 -0
  101. data/ispdb_data/kabelmail.de.xml +43 -0
  102. data/ispdb_data/kelcom.net.xml +21 -0
  103. data/ispdb_data/kl.wind.ne.jp.xml +32 -0
  104. data/ispdb_data/kokuyou.ne.jp.xml +21 -0
  105. data/ispdb_data/kpnmail.nl.xml +69 -0
  106. data/ispdb_data/laposte.net.xml +37 -0
  107. data/ispdb_data/libero.it.xml +34 -0
  108. data/ispdb_data/mahoroba.ne.jp.xml +22 -0
  109. data/ispdb_data/mail.com.xml +248 -0
  110. data/ispdb_data/mail.dk.xml +30 -0
  111. data/ispdb_data/mail.ee.xml +54 -0
  112. data/ispdb_data/mail.iwafune.ne.jp.xml +22 -0
  113. data/ispdb_data/mail.ru.xml +72 -0
  114. data/ispdb_data/mail.telenor.dk.xml +121 -0
  115. data/ispdb_data/mail.wind.ne.jp.xml +29 -0
  116. data/ispdb_data/me.com.xml +24 -0
  117. data/ispdb_data/messagingengine.com.xml +35 -0
  118. data/ispdb_data/ml.murakami.ne.jp.xml +22 -0
  119. data/ispdb_data/mnet.ne.jp.xml +48 -0
  120. data/ispdb_data/mopera.net.xml +50 -0
  121. data/ispdb_data/mx1.tiki.ne.jp.xml +54 -0
  122. data/ispdb_data/nifty.com.xml +22 -0
  123. data/ispdb_data/nsat.jp.xml +22 -0
  124. data/ispdb_data/ntlworld.com.xml +38 -0
  125. data/ispdb_data/o2.pl.xml +47 -0
  126. data/ispdb_data/ocn.ne.jp.xml +23 -0
  127. data/ispdb_data/office365.com.xml +55 -0
  128. data/ispdb_data/one.com.xml +22 -0
  129. data/ispdb_data/one.cz.xml +29 -0
  130. data/ispdb_data/onet.pl.xml +55 -0
  131. data/ispdb_data/outlook.com.xml +54 -0
  132. data/ispdb_data/ovh.net.xml +32 -0
  133. data/ispdb_data/pal.kijimadaira.jp.xml +21 -0
  134. data/ispdb_data/parabox.or.jp.xml +22 -0
  135. data/ispdb_data/pdx.edu.xml +41 -0
  136. data/ispdb_data/peoplepc.com.xml +29 -0
  137. data/ispdb_data/po.dcn.ne.jp.xml +21 -0
  138. data/ispdb_data/po.wind.ne.jp.xml +28 -0
  139. data/ispdb_data/pobox.com.xml +53 -0
  140. data/ispdb_data/pop.shibata.ne.jp.xml +23 -0
  141. data/ispdb_data/posteo.de.xml +25 -0
  142. data/ispdb_data/ptd.net.xml +53 -0
  143. data/ispdb_data/q.com.xml +53 -0
  144. data/ispdb_data/qq.com.xml +21 -0
  145. data/ispdb_data/rambler.ru.xml +35 -0
  146. data/ispdb_data/rr.com.xml +30 -0
  147. data/ispdb_data/runestone.net.xml +26 -0
  148. data/ispdb_data/sakunet.ne.jp.xml +21 -0
  149. data/ispdb_data/sapo.pt.xml +37 -0
  150. data/ispdb_data/schwaz.net.xml +49 -0
  151. data/ispdb_data/seznam.cz.xml +32 -0
  152. data/ispdb_data/sfr.fr.xml +33 -0
  153. data/ispdb_data/sky.com.xml +35 -0
  154. data/ispdb_data/skynet.be.xml +35 -0
  155. data/ispdb_data/so.wind.ne.jp.xml +25 -0
  156. data/ispdb_data/strato.de.xml +43 -0
  157. data/ispdb_data/studenti.univr.it.xml +37 -0
  158. data/ispdb_data/t-online.de.xml +56 -0
  159. data/ispdb_data/terra.es.xml +29 -0
  160. data/ispdb_data/thinline.cz.xml +60 -0
  161. data/ispdb_data/tiki.ne.jp.xml +24 -0
  162. data/ispdb_data/tiscali.cz.xml +25 -0
  163. data/ispdb_data/tiscali.it.xml +31 -0
  164. data/ispdb_data/umich.edu.xml +32 -0
  165. data/ispdb_data/uol.com.br.xml +42 -0
  166. data/ispdb_data/verizon.net.xml +21 -0
  167. data/ispdb_data/versatel.de.xml +43 -0
  168. data/ispdb_data/virgin.net.xml +38 -0
  169. data/ispdb_data/virginmedia.com.xml +35 -0
  170. data/ispdb_data/vm.aikis.or.jp.xml +22 -0
  171. data/ispdb_data/vp.tiki.ne.jp.xml +24 -0
  172. data/ispdb_data/web.de.xml +55 -0
  173. data/ispdb_data/webhuset.no.xml +42 -0
  174. data/ispdb_data/websupport.sk.xml +50 -0
  175. data/ispdb_data/wildwestdomains.com.xml +37 -0
  176. data/ispdb_data/wp.pl.xml +34 -0
  177. data/ispdb_data/xp.wind.jp.xml +24 -0
  178. data/ispdb_data/xtra.co.nz.xml +22 -0
  179. data/ispdb_data/yahoo.co.jp.xml +22 -0
  180. data/ispdb_data/yahoo.com.xml +84 -0
  181. data/ispdb_data/yandex.ru.xml +49 -0
  182. data/ispdb_data/ybb.ne.jp.xml +22 -0
  183. data/ispdb_data/yeah.net.xml +21 -0
  184. data/ispdb_data/zeelandnet.nl.xml +29 -0
  185. data/ispdb_data/ziggo.nl.xml +46 -0
  186. data/ispdb_data/zoho.com.xml +62 -0
  187. data/lib/mail_autoconfig/client_config.rb +113 -0
  188. data/lib/mail_autoconfig/email_address.rb +52 -0
  189. data/lib/mail_autoconfig/server.rb +72 -0
  190. data/lib/mail_autoconfig/version.rb +4 -0
  191. data/lib/mail_autoconfig.rb +33 -0
  192. data/mail_autoconfig_revived.gemspec +25 -0
  193. data/test/client_config_test.rb +45 -0
  194. data/test/email_address_test.rb +49 -0
  195. data/test/examples/client_config_yahoo.xml +40 -0
  196. data/test/server_test.rb +89 -0
  197. metadata +336 -0
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="xp.wind.jp">
4
+ <domain>xp.wind.jp</domain>
5
+ <displayName>群馬インターネット</displayName>
6
+ <displayShortName>wind</displayShortName>
7
+ <incomingServer type="pop3">
8
+ <hostname>xp.wind.jp</hostname>
9
+ <port>110</port>
10
+ <socketType>plain</socketType>
11
+ <username>%EMAILLOCALPART%</username>
12
+ <authentication>password-cleartext</authentication>
13
+ </incomingServer>
14
+ <outgoingServer type="smtp">
15
+ <hostname>xp.wind.jp</hostname>
16
+ <port>587</port>
17
+ <socketType>plain</socketType>
18
+ <username>%EMAILLOCALPART%</username>
19
+ <authentication>password-cleartext</authentication>
20
+ <addThisServer>true</addThisServer>
21
+ <useGlobalPreferredServer>false</useGlobalPreferredServer>
22
+ </outgoingServer>
23
+ </emailProvider>
24
+ </clientConfig>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="xtra.co.nz">
4
+ <domain>xtra.co.nz</domain>
5
+ <displayName>Yahoo! Mail</displayName>
6
+ <displayShortName>Yahoo</displayShortName>
7
+ <incomingServer type="pop3">
8
+ <hostname>pop3.xtra.co.nz</hostname>
9
+ <port>995</port>
10
+ <socketType>SSL</socketType>
11
+ <username>%EMAILLOCALPART%</username>
12
+ <authentication>password-cleartext</authentication>
13
+ </incomingServer>
14
+ <outgoingServer type="smtp">
15
+ <hostname>send.xtra.co.nz</hostname>
16
+ <port>465</port>
17
+ <socketType>SSL</socketType>
18
+ <username>%EMAILLOCALPART%</username>
19
+ <authentication>password-cleartext</authentication>
20
+ </outgoingServer>
21
+ </emailProvider>
22
+ </clientConfig>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="yahoo.co.jp">
4
+ <domain>yahoo.co.jp</domain>
5
+ <displayName>Yahoo! メール</displayName>
6
+ <displayShortName>Yahoo! メール</displayShortName>
7
+ <incomingServer type="pop3">
8
+ <hostname>pop.mail.yahoo.co.jp</hostname>
9
+ <port>995</port>
10
+ <socketType>SSL</socketType>
11
+ <username>%EMAILLOCALPART%</username>
12
+ <authentication>password-cleartext</authentication>
13
+ </incomingServer>
14
+ <outgoingServer type="smtp">
15
+ <hostname>smtp.mail.yahoo.co.jp</hostname>
16
+ <port>465</port>
17
+ <socketType>SSL</socketType>
18
+ <username>%EMAILLOCALPART%</username>
19
+ <authentication>password-cleartext</authentication>
20
+ </outgoingServer>
21
+ </emailProvider>
22
+ </clientConfig>
@@ -0,0 +1,84 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="yahoo.com">
4
+ <domain>yahoo.com</domain>
5
+ <domain>yahoo.de</domain>
6
+ <domain>yahoo.it</domain>
7
+ <domain>yahoo.fr</domain>
8
+ <domain>yahoo.es</domain>
9
+ <domain>yahoo.se</domain>
10
+ <domain>yahoo.co.uk</domain>
11
+ <domain>yahoo.co.nz</domain>
12
+ <domain>yahoo.com.au</domain>
13
+ <domain>yahoo.com.ar</domain>
14
+ <domain>yahoo.com.br</domain>
15
+ <domain>yahoo.com.mx</domain>
16
+ <domain>ymail.com</domain>
17
+ <domain>rocketmail.com</domain>
18
+ <!-- MX -->
19
+ <domain>mail.am0.yahoodns.net</domain>
20
+ <domain>am0.yahoodns.net</domain>
21
+ <!-- Unfortunately, also used for AOL :-( -->
22
+ <domain>yahoodns.net</domain>
23
+
24
+ <displayName>Yahoo! Mail</displayName>
25
+ <displayShortName>Yahoo</displayShortName>
26
+
27
+ <incomingServer type="imap">
28
+ <hostname>imap.mail.yahoo.com</hostname>
29
+ <port>993</port>
30
+ <socketType>SSL</socketType>
31
+ <username>%EMAILADDRESS%</username>
32
+ <authentication>OAuth2</authentication>
33
+ <authentication>password-cleartext</authentication>
34
+ </incomingServer>
35
+ <incomingServer type="imap">
36
+ <hostname>export.imap.mail.yahoo.com</hostname>
37
+ <port>993</port>
38
+ <socketType>SSL</socketType>
39
+ <username>%EMAILADDRESS%</username>
40
+ <authentication>OAuth2</authentication>
41
+ <authentication>password-cleartext</authentication>
42
+ </incomingServer>
43
+ <incomingServer type="pop3">
44
+ <hostname>pop.mail.yahoo.com</hostname>
45
+ <port>995</port>
46
+ <socketType>SSL</socketType>
47
+ <username>%EMAILADDRESS%</username>
48
+ <authentication>OAuth2</authentication>
49
+ <authentication>password-cleartext</authentication>
50
+ </incomingServer>
51
+ <outgoingServer type="smtp">
52
+ <hostname>smtp.mail.yahoo.com</hostname>
53
+ <port>465</port>
54
+ <socketType>SSL</socketType>
55
+ <username>%EMAILADDRESS%</username>
56
+ <authentication>OAuth2</authentication>
57
+ <authentication>password-cleartext</authentication>
58
+ </outgoingServer>
59
+
60
+ <documentation url="https://help.yahoo.com/kb/new-mail-for-desktop/imap-server-settings-yahoo-mail-sln4075.html">
61
+ <descr lang="en">How to setup email applications with imap to receive Yahoo! mail?</descr>
62
+ </documentation>
63
+ <documentation url="https://help.yahoo.com/kb/new-mail-for-desktop/pop-access-settings-instructions-yahoo-mail-sln4724.html">
64
+ <descr lang="en">How to setup email applications with pop to receive Yahoo! mail?</descr>
65
+ </documentation>
66
+ </emailProvider>
67
+
68
+ <oAuth2>
69
+ <issuer>login.yahoo.com</issuer>
70
+ <scope>mail-w</scope>
71
+ <authURL>https://api.login.yahoo.com/oauth2/request_auth</authURL>
72
+ <tokenURL>https://api.login.yahoo.com/oauth2/get_token</tokenURL>
73
+ </oAuth2>
74
+
75
+ <webMail>
76
+ <loginPage url="https://mail.yahoo.com" />
77
+ <loginPageInfo url="https://mail.yahoo.com/">
78
+ <username>%EMAILADDRESS%</username>
79
+ <usernameField id="login-username" />
80
+ <passwordField id="login-passwd" />
81
+ <loginButton id="login-signin" />
82
+ </loginPageInfo>
83
+ </webMail>
84
+ </clientConfig>
@@ -0,0 +1,49 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="yandex.ru">
4
+ <domain>yandex.ru</domain>
5
+ <domain>yandex.com</domain>
6
+ <domain>yandex.net</domain>
7
+ <domain>yandex.by</domain>
8
+ <domain>yandex.kz</domain>
9
+ <domain>yandex.ua</domain>
10
+ <domain>ya.ru</domain>
11
+ <domain>narod.ru</domain>
12
+
13
+ <displayName>Yandex Mail</displayName>
14
+ <displayShortName>Yandex</displayShortName>
15
+
16
+ <incomingServer type="imap">
17
+ <hostname>imap.yandex.com</hostname>
18
+ <port>993</port>
19
+ <socketType>SSL</socketType>
20
+ <username>%EMAILADDRESS%</username>
21
+ <authentication>password-cleartext</authentication>
22
+ </incomingServer>
23
+ <incomingServer type="pop3">
24
+ <hostname>pop.yandex.com</hostname>
25
+ <port>995</port>
26
+ <socketType>SSL</socketType>
27
+ <username>%EMAILADDRESS%</username>
28
+ <authentication>password-cleartext</authentication>
29
+ </incomingServer>
30
+ <outgoingServer type="smtp">
31
+ <hostname>smtp.yandex.com</hostname>
32
+ <port>465</port>
33
+ <socketType>SSL</socketType>
34
+ <username>%EMAILADDRESS%</username>
35
+ <authentication>password-cleartext</authentication>
36
+ </outgoingServer>
37
+ </emailProvider>
38
+
39
+ <oAuth2>
40
+ <issuer>oauth.yandex.com</issuer>
41
+ <scope>mail:imap_full mail:smtp</scope>
42
+ <authURL>https://oauth.yandex.com/authorize</authURL>
43
+ <tokenURL>https://oauth.yandex.com/token</tokenURL>
44
+ </oAuth2>
45
+
46
+ <enable visiturl="http://mail.yandex.ru/neo/setup_client">
47
+ <instruction>Check 'Enable IMAP' on Yandex.Mail setup page</instruction>
48
+ </enable>
49
+ </clientConfig>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="ybb.ne.jp">
4
+ <domain>ybb.ne.jp</domain>
5
+ <displayName>Yahoo! BB</displayName>
6
+ <displayShortName>Yahoo! BB</displayShortName>
7
+ <incomingServer type="pop3">
8
+ <hostname>ybbpop.mail.yahoo.co.jp</hostname>
9
+ <port>995</port>
10
+ <socketType>SSL</socketType>
11
+ <username>%EMAILLOCALPART%</username>
12
+ <authentication>password-cleartext</authentication>
13
+ </incomingServer>
14
+ <outgoingServer type="smtp">
15
+ <hostname>ybbsmtp.mail.yahoo.co.jp</hostname>
16
+ <port>465</port>
17
+ <socketType>SSL</socketType>
18
+ <username>%EMAILLOCALPART%</username>
19
+ <authentication>password-cleartext</authentication>
20
+ </outgoingServer>
21
+ </emailProvider>
22
+ </clientConfig>
@@ -0,0 +1,21 @@
1
+ <clientConfig version="1.1">
2
+ <emailProvider id="yeah.net">
3
+ <domain>yeah.net</domain>
4
+ <displayName>yeah.net</displayName>
5
+ <displayShortName>yeah.net</displayShortName>
6
+ <incomingServer type="imap">
7
+ <hostname>imap.yeah.net</hostname>
8
+ <port>993</port>
9
+ <socketType>SSL</socketType>
10
+ <username>%EMAILADDRESS%</username>
11
+ <authentication>password-cleartext</authentication>
12
+ </incomingServer>
13
+ <outgoingServer type="smtp">
14
+ <hostname>smtp.yeah.net</hostname>
15
+ <port>465</port>
16
+ <socketType>SSL</socketType>
17
+ <username>%EMAILADDRESS%</username>
18
+ <authentication>password-cleartext</authentication>
19
+ </outgoingServer>
20
+ </emailProvider>
21
+ </clientConfig>
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="zeelandnet.nl">
4
+ <domain>zeelandnet.nl</domain>
5
+ <displayName>ZeelandNet e-mail</displayName>
6
+ <displayShortName>ZeelandNet</displayShortName>
7
+ <incomingServer type="imap">
8
+ <hostname>mail.zeelandnet.nl</hostname>
9
+ <port>993</port>
10
+ <socketType>SSL</socketType>
11
+ <authentication>password-cleartext</authentication>
12
+ <username>%EMAILLOCALPART%</username>
13
+ </incomingServer>
14
+ <incomingServer type="pop3">
15
+ <hostname>mail.zeelandnet.nl</hostname>
16
+ <port>995</port>
17
+ <socketType>SSL</socketType>
18
+ <authentication>password-cleartext</authentication>
19
+ <username>%EMAILLOCALPART%</username>
20
+ </incomingServer>
21
+ <outgoingServer type="smtp">
22
+ <hostname>mail.zeelandnet.nl</hostname>
23
+ <port>465</port>
24
+ <socketType>SSL</socketType>
25
+ <authentication>password-cleartext</authentication>
26
+ <username>%EMAILLOCALPART%</username>
27
+ </outgoingServer>
28
+ </emailProvider>
29
+ </clientConfig>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="ziggo.nl">
4
+ <domain>hahah.nl</domain>
5
+ <domain>ziggomail.com</domain>
6
+ <domain>casema.nl</domain>
7
+ <domain>zinders.nl</domain>
8
+ <domain>ziggo.nl</domain>
9
+ <domain>zeggis.nl</domain>
10
+ <domain>zeggis.com</domain>
11
+ <domain>razcall.nl</domain>
12
+ <domain>razcall.com</domain>
13
+ <domain>upcmail.nl</domain>
14
+ <domain>chello.nl</domain>
15
+ <domain>multiweb.nl</domain>
16
+ <domain>home.nl</domain>
17
+ <domain>quicknet.nl</domain>
18
+ <displayName>Ziggo Mail</displayName>
19
+ <displayShortName>Ziggo</displayShortName>
20
+ <incomingServer type="imap">
21
+ <hostname>imap.ziggo.nl</hostname>
22
+ <port>993</port>
23
+ <socketType>SSL</socketType>
24
+ <username>%EMAILADDRESS%</username>
25
+ <authentication>password-cleartext</authentication>
26
+ </incomingServer>
27
+ <incomingServer type="pop3">
28
+ <hostname>pop.ziggo.nl</hostname>
29
+ <port>995</port>
30
+ <socketType>SSL</socketType>
31
+ <username>%EMAILADDRESS%</username>
32
+ <authentication>password-cleartext</authentication>
33
+ </incomingServer>
34
+ <outgoingServer type="smtp">
35
+ <hostname>smtp.ziggo.nl</hostname>
36
+ <port>587</port>
37
+ <socketType>STARTTLS</socketType>
38
+ <username>%EMAILADDRESS%</username>
39
+ <authentication>password-cleartext</authentication>
40
+ </outgoingServer>
41
+ </emailProvider>
42
+ <documentation url="https://www.ziggo.nl/klantenservice/e-mail/?src=autoconfig">
43
+ <descr lang="en">E-mail Settings</descr>
44
+ <descr lang="nl">Instellingen voor e-mail</descr>
45
+ </documentation>
46
+ </clientConfig>
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0"?>
2
+ <clientConfig version="1.1">
3
+ <emailProvider id="zoho.com">
4
+ <domain>zoho.com</domain>
5
+ <domain>zohomail.com</domain>
6
+ <displayName>Zoho Mail</displayName>
7
+ <displayShortName>Zoho</displayShortName>
8
+ <incomingServer type="imap">
9
+ <hostname>imap.zoho.com</hostname>
10
+ <port>993</port>
11
+ <socketType>SSL</socketType>
12
+ <username>%EMAILADDRESS%</username>
13
+ <authentication>password-cleartext</authentication>
14
+ </incomingServer>
15
+ <!-- You must enable IMAP Access for your account
16
+ before you begin the configuration in the email client. -->
17
+ <incomingServer type="pop3">
18
+ <hostname>pop.zoho.com</hostname>
19
+ <port>995</port>
20
+ <socketType>SSL</socketType>
21
+ <username>%EMAILADDRESS%</username>
22
+ <authentication>password-cleartext</authentication>
23
+ </incomingServer>
24
+ <!-- You must enable POP Access for your account
25
+ before you begin the configuration in the email client. -->
26
+ <outgoingServer type="smtp">
27
+ <hostname>smtp.zoho.com</hostname>
28
+ <port>465</port>
29
+ <socketType>SSL</socketType>
30
+ <username>%EMAILADDRESS%</username>
31
+ <authentication>password-cleartext</authentication>
32
+ </outgoingServer>
33
+ <outgoingServer type="smtp">
34
+ <hostname>smtp.zoho.com</hostname>
35
+ <port>587</port>
36
+ <socketType>STARTTLS</socketType>
37
+ <username>%EMAILADDRESS%</username>
38
+ <authentication>password-cleartext</authentication>
39
+ </outgoingServer>
40
+ </emailProvider>
41
+ <documentation url="https://www.zoho.com/mail/help/imap-access.html">
42
+ <descr lang="en">Zoho Mail - Access via IMAP</descr>
43
+ </documentation>
44
+ <documentation url="https://www.zoho.com/mail/help/imap-access.html">
45
+ <descr lang="en">Zoho Mail - POP configuration details</descr>
46
+ </documentation>
47
+ <documentation url="https://www.zoho.com/mail/help/zoho-smtp.html">
48
+ <descr lang="en">Zoho Mail - SMTP Server Configuration</descr>
49
+ </documentation>
50
+ <documentation url="https://www.zoho.com/mail/help/thunderbird-imap-access.html">
51
+ <descr lang="en">Configure Zoho Mail as IMAP Account in Thunderbird</descr>
52
+ </documentation>
53
+ <documentation url="https://www.zoho.com/mail/help/thunderbird-pop-access.html">
54
+ <descr lang="en">Configure your Zoho Account as POP in Thunderbird</descr>
55
+ </documentation>
56
+ <documentation url="https://www.zoho.com/mail/help/pop-access.html#EnablePOPAccess">
57
+ <descr lang="en">Enable POP Access</descr>
58
+ </documentation>
59
+ <documentation url="https://www.zoho.com/mail/help/imap-access.html#EnableIMAP">
60
+ <descr lang="en">Enable IMAP Access</descr>
61
+ </documentation>
62
+ </clientConfig>
@@ -0,0 +1,113 @@
1
+ module MailAutoconfig
2
+ # Parse the Autoconfig XML file and create a ruby representation
3
+ class ClientConfig
4
+ attr_reader :config
5
+ attr_accessor :email_address
6
+
7
+ class << self
8
+ # Build a configuration from the specified path
9
+ # @param path [String] the loction of the client configuartion file
10
+ # @return [ClientConfig] new client configuration
11
+ def from_file(path)
12
+ new(File.read(path))
13
+ end
14
+
15
+ # Try to find a configuration for the given domain, locally or remotely
16
+ # @param domain [String] the domain to lookup the configuration for
17
+ # @return [ClientConfig] client configuration for the domain
18
+ def search(domain)
19
+ search_local_files(domain) || search_autoconfig_domain(domain)
20
+ end
21
+
22
+ # Search local ISPDB for configurations matching the domain
23
+ # @param domain [String] the domain to look for
24
+ # @return [ClientConfig] client configuration for the domain
25
+ def search_local_files(domain)
26
+ last_config = false
27
+ match = Dir.glob(File.join(MailAutoconfig.local_ispdb_path, "*")).find do |config_file|
28
+ last_config = from_file(config_file)
29
+ last_config.valid_for_domain?(domain)
30
+ end
31
+ match ? last_config : false
32
+ end
33
+
34
+ # Try a remote server for the configuration for the domain.
35
+ # Search `http://autoconfig.#{domain}/mail/config-v1.1.xml` first,
36
+ # followed by `http://#{domain}/.well-known/autoconfig/mail/config-v1.1.xml`
37
+ # @param domain [String] the domain to look for
38
+ # @return [ClientConfig] the client configuration for the domain
39
+ def search_autoconfig_domain(domain)
40
+ last_config = false
41
+ match = ["http://autoconfig.#{domain}/mail/config-v1.1.xml", "http://#{domain}/.well-known/autoconfig/mail/config-v1.1.xml"].find do |url|
42
+ response = Faraday.get(url)
43
+ if response.status == 200
44
+ last_config = new(response.body)
45
+ else
46
+ false
47
+ end
48
+ rescue
49
+ false
50
+ end
51
+ match ? last_config : false
52
+ end
53
+ end
54
+
55
+ # @param client_config_xml [String] the raw XML to build the ClientConfig from.
56
+ def initialize(client_config_xml)
57
+ @config = Nokogiri::XML(client_config_xml)
58
+ end
59
+
60
+ # A list of domain aliases that this configuration applies to
61
+ # @return [Array] list of domains for this configuration
62
+ def domains
63
+ @domains ||= provider.xpath("domain").map { |domain| domain.content }
64
+ end
65
+
66
+ # Does this configuration file apply to the specified domain?
67
+ # @param domain [String] the domain to check
68
+ # @return [Boolean] Does the domain match?
69
+ def valid_for_domain?(domain)
70
+ domains.any? { |d| d == domain }
71
+ end
72
+
73
+ # @return [String] The unique string identifying this service (e.g. googlemail.com)
74
+ def provider_id
75
+ @provider_id ||= provider.attr("id").value
76
+ end
77
+
78
+ # @return [String] the full name of this service (e.g. Google Mail)
79
+ def name
80
+ @name ||= provider.xpath("displayName").first.content
81
+ end
82
+
83
+ # @return [String] the short name of this service (e.g. GMail)
84
+ def short_name
85
+ @short_name ||= provider.xpath("displayShortName").first.content
86
+ end
87
+
88
+ # The incoming servers for this configuration. There can be multiple servers per
89
+ # configuration e.g. for IMAP and POP3, ordered in list of preference.
90
+ # @return [Array] list of incoming servers
91
+ def incoming_servers
92
+ @incoming_servers ||= provider.xpath("incomingServer").map do |incoming|
93
+ MailAutoconfig::IncomingServer.new(incoming, self)
94
+ end
95
+ end
96
+
97
+ # The outgoing servers for this configuration. There can be multiple servers per
98
+ # configuration, ordered in list of preference.
99
+ # @return [Array] list of outgoing servers
100
+ def outgoing_servers
101
+ @outgoing_servers ||= provider.xpath("outgoingServer").map do |outgoing|
102
+ MailAutoconfig::OutgoingServer.new(outgoing, self)
103
+ end
104
+ end
105
+
106
+ private
107
+
108
+ # @return [Nokogiri::XML::Node] the root configuration node
109
+ def provider
110
+ @provider ||= config.xpath("//clientConfig/emailProvider")
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,52 @@
1
+ module MailAutoconfig
2
+ # Email address that we're going to investigate
3
+ class EmailAddress
4
+ attr_reader :address
5
+
6
+ # @param address [String] the email address to look up
7
+ def initialize(address)
8
+ @address = address
9
+ end
10
+
11
+ # Fetch the client configuration for this email address.
12
+ # First of all try the domain determined by {#domain}. If nothing is found there,
13
+ # check the domain specified in {#primary_mx_domain}. Returns false if none found.
14
+ # @return [MailAutoconfig::ClientConfig] the client configuration for this address
15
+ def client_config
16
+ @client_config ||= begin
17
+ config = MailAutoconfig::ClientConfig.search(domain)
18
+ config ||= MailAutoconfig::ClientConfig.search(primary_mx_domain)
19
+ config.email_address = self if config
20
+ config
21
+ end
22
+ end
23
+
24
+ # The local part of the emai address (before the @ symbol).
25
+ # Useful for usage with the %EMAILLOCALPART% substitution.
26
+ # @return [String] the local part of the email address
27
+ def local_part
28
+ @local_part ||= @address.split("@", 2).first
29
+ end
30
+
31
+ # The domain of the email address (the part after the @ symbol)
32
+ # @return [String] the domain of the email address
33
+ def domain
34
+ @domain ||= @address.split("@", 2).last
35
+ end
36
+
37
+ # Finds the primary MX domain for this address. Would change gmail-smtp-in.l.google.com to google.com
38
+ # @return [String] the domain of the pimary MX record for this address
39
+ def primary_mx_domain
40
+ # Not very nice to 2nd level domains
41
+ @primary_mx_domain ||= (mx_records.first.split(".")[-2..].join(".") unless mx_records.empty?)
42
+ end
43
+
44
+ private
45
+
46
+ # Finds MX records for the associated email address, ordered by preference.
47
+ # @return [Array] MX records for this email address
48
+ def mx_records
49
+ @mx_records ||= Resolv::DNS.open.getresources(domain, Resolv::DNS::Resource::IN::MX).sort_by(&:preference).map { |r| r.exchange.to_s }
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,72 @@
1
+ module MailAutoconfig
2
+ # Superclass for {IncomingServer} and {OutgoingServer}.
3
+ # Never used directly.
4
+ class Server
5
+ attr_reader :config
6
+ attr_reader :client_config
7
+
8
+ # @param config [Nokogiri::XML::Node] an XML representation of this server
9
+ def initialize(config, client_config)
10
+ @config = config
11
+ @client_config = client_config
12
+ end
13
+
14
+ # Returns the protocol of the mail server e.g. `smtp`, `pop3`, `imap`
15
+ # @return [String] The protocol for the server
16
+ def protocol
17
+ @protocol ||= config.attr("type")
18
+ end
19
+
20
+ # @return [String] The hostname for this server
21
+ def hostname
22
+ @hostname ||= config.xpath("hostname").first.content
23
+ end
24
+
25
+ # @return [Integer] The port to connect ot this server on
26
+ def port
27
+ @port ||= config.xpath("port").first.content.to_i
28
+ end
29
+
30
+ # The connection type for this server. `plain`, `STARTTLS`, `SSL` are acceptable
31
+ # @return [String] The connection type
32
+ def socket_type
33
+ @socket_type ||= config.xpath("socketType").first.content
34
+ end
35
+
36
+ # The username for this mailbox, combines {username_format} and [EmailAddress] details
37
+ # @return [String] The username
38
+ def username
39
+ @username ||= begin
40
+ name = username_format
41
+ name.gsub! "%EMAILADDRESS%", client_config.email_address.address
42
+ name.gsub! "%EMAILLOCALPART%", client_config.email_address.local_part
43
+ name.gsub! "%EMAILDOMAIN%", client_config.email_address.domain
44
+ name
45
+ end
46
+ end
47
+
48
+ # Return the username format for this server. There are substitutions that can be made.
49
+ #
50
+ # * `%EMAILADDRESS%` - full email address of the user, usually entered by the user
51
+ # * `%EMAILLOCALPART%` - email address, part before @
52
+ # * `%EMAILDOMAIN%` - email address, part after @
53
+ #
54
+ # @return [String] the username format
55
+ def username_format
56
+ @username_format ||= config.xpath("username").first.content
57
+ end
58
+
59
+ # The authentication type for this server. Valid responses:
60
+ # `password-cleartext`, `NTLM`, `GSSAPI`, `client-IP-address`, `TLS-client-cert`, `none`
61
+ # @return [String] the authentication method for this server
62
+ def authentication
63
+ @authentication ||= config.xpath("authentication").first.content
64
+ end
65
+ end
66
+
67
+ # Configuration details for an incoming server.
68
+ class IncomingServer < Server; end
69
+
70
+ # Configuration details for an outgoing server.
71
+ class OutgoingServer < Server; end
72
+ end
@@ -0,0 +1,4 @@
1
+ module MailAutoconfig
2
+ # The version
3
+ VERSION = "0.0.3"
4
+ end
@@ -0,0 +1,33 @@
1
+ require "nokogiri"
2
+ require "faraday"
3
+ require "resolv"
4
+
5
+ require "mail_autoconfig/version"
6
+ require "mail_autoconfig/client_config"
7
+ require "mail_autoconfig/server"
8
+ require "mail_autoconfig/email_address"
9
+
10
+ # Module to lookup mailbox autoconfiguration according to Thunderbird
11
+ # spec (https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat)
12
+ # and guidelines (https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration)
13
+ module MailAutoconfig
14
+ # The path for the locally stored Thunderbird ISPDB configurations
15
+ # @return [String] absolute path to the ispdb data directory
16
+ def self.local_ispdb_path
17
+ File.expand_path(File.join(__FILE__, "../", "../", "ispdb_data"))
18
+ end
19
+
20
+ # The URL to the canonical SVN repository containing the Thunderbird IPSDB
21
+ # @return [String] GIT repository location
22
+ def self.ispdb_github_url
23
+ "https://github.com/thunderbird/autoconfig"
24
+ end
25
+
26
+ # Fetch the client configuration for a given email address, if any.
27
+ # Returns false if none found.
28
+ # @param email [String] the email address to lookup
29
+ # @return [MailAutoconfig::ClientConfig]
30
+ def self.for_address(email)
31
+ MailAutoconfig::EmailAddress.new(email).client_config
32
+ end
33
+ end