dependabot-linguist 0.212.0 → 0.212.1

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 (200) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -7
  3. data/README.md +27 -0
  4. data/dependabot-linguist.gemspec +1 -1
  5. data/lib/dependabot/linguist/dependabot_file_validator.rb +40 -6
  6. data/lib/dependabot/linguist/version.rb +1 -1
  7. metadata +2 -195
  8. data/smoke-test/README.md +0 -58
  9. data/smoke-test/bundler/Gemfile +0 -9
  10. data/smoke-test/bundler/Gemfile.lock +0 -47
  11. data/smoke-test/bundler/dependabot-all-updates-test-staging.gemspec +0 -10
  12. data/smoke-test/cargo/Cargo.lock +0 -90
  13. data/smoke-test/cargo/Cargo.toml +0 -8
  14. data/smoke-test/composer/composer.json +0 -5
  15. data/smoke-test/composer/composer.lock +0 -72
  16. data/smoke-test/composer/vendor/autoload.php +0 -7
  17. data/smoke-test/composer/vendor/composer/ClassLoader.php +0 -445
  18. data/smoke-test/composer/vendor/composer/LICENSE +0 -21
  19. data/smoke-test/composer/vendor/composer/autoload_classmap.php +0 -13
  20. data/smoke-test/composer/vendor/composer/autoload_namespaces.php +0 -9
  21. data/smoke-test/composer/vendor/composer/autoload_psr4.php +0 -9
  22. data/smoke-test/composer/vendor/composer/autoload_real.php +0 -55
  23. data/smoke-test/composer/vendor/composer/autoload_static.php +0 -23
  24. data/smoke-test/composer/vendor/composer/installed.json +0 -57
  25. data/smoke-test/composer/vendor/phpmailer/phpmailer/.gitignore +0 -3
  26. data/smoke-test/composer/vendor/phpmailer/phpmailer/LICENSE +0 -504
  27. data/smoke-test/composer/vendor/phpmailer/phpmailer/README.md +0 -112
  28. data/smoke-test/composer/vendor/phpmailer/phpmailer/changelog.md +0 -530
  29. data/smoke-test/composer/vendor/phpmailer/phpmailer/class.phpmailer.php +0 -2758
  30. data/smoke-test/composer/vendor/phpmailer/phpmailer/class.pop3.php +0 -417
  31. data/smoke-test/composer/vendor/phpmailer/phpmailer/class.smtp.php +0 -1075
  32. data/smoke-test/composer/vendor/phpmailer/phpmailer/composer.json +0 -32
  33. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/Callback_function_notes.txt +0 -17
  34. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/DomainKeys_notes.txt +0 -55
  35. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/Note_for_SMTP_debugging.txt +0 -23
  36. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/extending.html +0 -148
  37. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/faq.html +0 -67
  38. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/generatedocs.sh +0 -4
  39. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/pop3_article.txt +0 -39
  40. data/smoke-test/composer/vendor/phpmailer/phpmailer/docs/use_gmail.txt +0 -44
  41. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/contents.html +0 -20
  42. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/images/phpmailer.gif +0 -0
  43. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.gif +0 -0
  44. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/index.html +0 -50
  45. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_db_smtp_basic.php +0 -58
  46. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_mail_advanced.php +0 -30
  47. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_mail_basic.php +0 -41
  48. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_pop_before_smtp_advanced.php +0 -39
  49. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_pop_before_smtp_basic.php +0 -49
  50. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_sendmail_advanced.php +0 -33
  51. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_sendmail_basic.php +0 -43
  52. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_advanced.php +0 -42
  53. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_advanced_no_auth.php +0 -36
  54. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_basic.php +0 -58
  55. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_basic_no_auth.php +0 -53
  56. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_gmail_advanced.php +0 -42
  57. data/smoke-test/composer/vendor/phpmailer/phpmailer/examples/test_smtp_gmail_basic.php +0 -59
  58. data/smoke-test/composer/vendor/phpmailer/phpmailer/extras/class.html2text.inc +0 -489
  59. data/smoke-test/composer/vendor/phpmailer/phpmailer/extras/htmlfilter.php +0 -861
  60. data/smoke-test/composer/vendor/phpmailer/phpmailer/extras/ntlm_sasl_client.php +0 -185
  61. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +0 -26
  62. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-br.php +0 -25
  63. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +0 -25
  64. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php +0 -25
  65. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-cz.php +0 -24
  66. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +0 -24
  67. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-dk.php +0 -25
  68. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +0 -25
  69. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +0 -25
  70. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +0 -26
  71. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +0 -26
  72. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +0 -24
  73. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +0 -24
  74. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +0 -26
  75. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +0 -25
  76. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +0 -24
  77. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-no.php +0 -24
  78. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +0 -24
  79. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +0 -26
  80. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +0 -24
  81. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-se.php +0 -25
  82. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +0 -25
  83. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +0 -26
  84. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +0 -25
  85. data/smoke-test/composer/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +0 -25
  86. data/smoke-test/composer/vendor/phpmailer/phpmailer/test/contents.html +0 -10
  87. data/smoke-test/composer/vendor/phpmailer/phpmailer/test/phpmailerTest.php +0 -1084
  88. data/smoke-test/composer/vendor/phpmailer/phpmailer/test/test.png +0 -0
  89. data/smoke-test/composer/vendor/phpmailer/phpmailer/test/test_callback.php +0 -84
  90. data/smoke-test/composer/vendor/phpmailer/phpmailer/test/testemail.php +0 -48
  91. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/LGPLv3.txt +0 -165
  92. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/contents.html +0 -14
  93. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/images/aikido.gif +0 -0
  94. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/images/bkgrnd.gif +0 -0
  95. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/images/phpmailer.gif +0 -0
  96. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/index.php +0 -427
  97. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/clipboard.swf +0 -0
  98. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushBash.js +0 -59
  99. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushCSharp.js +0 -64
  100. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushCpp.js +0 -99
  101. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushCss.js +0 -93
  102. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushDelphi.js +0 -57
  103. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushDiff.js +0 -43
  104. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushGroovy.js +0 -69
  105. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushJScript.js +0 -51
  106. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushJava.js +0 -55
  107. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPerl.js +0 -74
  108. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPhp.js +0 -91
  109. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPlain.js +0 -35
  110. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushPython.js +0 -56
  111. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushRuby.js +0 -57
  112. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushScala.js +0 -53
  113. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushSql.js +0 -68
  114. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushVb.js +0 -58
  115. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shBrushXml.js +0 -71
  116. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shCore.js +0 -30
  117. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/scripts/shLegacy.js +0 -30
  118. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/src/shCore.js +0 -1949
  119. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/src/shLegacy.js +0 -172
  120. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/help.png +0 -0
  121. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/magnifier.png +0 -0
  122. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/page_white_code.png +0 -0
  123. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/page_white_copy.png +0 -0
  124. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/printer.png +0 -0
  125. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shCore.css +0 -321
  126. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeDefault.css +0 -191
  127. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeDjango.css +0 -193
  128. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeEmacs.css +0 -192
  129. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeFadeToGrey.css +0 -193
  130. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeMidnight.css +0 -192
  131. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/shThemeRDark.css +0 -192
  132. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/styles/wrapping.png +0 -0
  133. data/smoke-test/composer/vendor/phpmailer/phpmailer/test_script/test.html +0 -46
  134. data/smoke-test/dependabot-file/no-config/.github/TARGET.yaml +0 -14
  135. data/smoke-test/dependabot-file/no-config/bundler/Gemfile +0 -9
  136. data/smoke-test/dependabot-file/no-config/bundler/Gemfile.lock +0 -47
  137. data/smoke-test/dependabot-file/no-config/bundler/dependabot-all-updates-test-staging.gemspec +0 -10
  138. data/smoke-test/dependabot-file/no-config/cargo/Cargo.lock +0 -90
  139. data/smoke-test/dependabot-file/no-config/cargo/Cargo.toml +0 -8
  140. data/smoke-test/dependabot-file/no-config/composer/composer.json +0 -5
  141. data/smoke-test/dependabot-file/no-config/composer/composer.lock +0 -72
  142. data/smoke-test/dependabot-file/over-config/.github/TARGET.yaml +0 -17
  143. data/smoke-test/dependabot-file/over-config/.github/dependabot.yaml +0 -12
  144. data/smoke-test/dependabot-file/over-config/bundler/Gemfile +0 -9
  145. data/smoke-test/dependabot-file/over-config/bundler/Gemfile.lock +0 -47
  146. data/smoke-test/dependabot-file/over-config/bundler/dependabot-all-updates-test-staging.gemspec +0 -10
  147. data/smoke-test/dependabot-file/over-config/cargo/Cargo.lock +0 -90
  148. data/smoke-test/dependabot-file/over-config/cargo/Cargo.toml +0 -8
  149. data/smoke-test/dependabot-file/over-config/composer/composer.json +0 -5
  150. data/smoke-test/dependabot-file/over-config/composer/composer.lock +0 -72
  151. data/smoke-test/dependabot-file/overer-config/.github/TARGET.yaml +0 -19
  152. data/smoke-test/dependabot-file/overer-config/.github/dependabot.yaml +0 -12
  153. data/smoke-test/dependabot-file/overer-config/bundler/Gemfile +0 -9
  154. data/smoke-test/dependabot-file/overer-config/bundler/Gemfile.lock +0 -47
  155. data/smoke-test/dependabot-file/overer-config/bundler/dependabot-all-updates-test-staging.gemspec +0 -10
  156. data/smoke-test/dependabot-file/overer-config/cargo/Cargo.lock +0 -90
  157. data/smoke-test/dependabot-file/overer-config/cargo/Cargo.toml +0 -8
  158. data/smoke-test/dependabot-file/overer-config/composer/composer.json +0 -5
  159. data/smoke-test/dependabot-file/overer-config/composer/composer.lock +0 -72
  160. data/smoke-test/dependabot-file/partial-config/.github/TARGET.yaml +0 -17
  161. data/smoke-test/dependabot-file/partial-config/.github/dependabot.yaml +0 -7
  162. data/smoke-test/dependabot-file/partial-config/bundler/Gemfile +0 -9
  163. data/smoke-test/dependabot-file/partial-config/bundler/Gemfile.lock +0 -47
  164. data/smoke-test/dependabot-file/partial-config/bundler/dependabot-all-updates-test-staging.gemspec +0 -10
  165. data/smoke-test/dependabot-file/partial-config/cargo/Cargo.lock +0 -90
  166. data/smoke-test/dependabot-file/partial-config/cargo/Cargo.toml +0 -8
  167. data/smoke-test/dependabot-file/partial-config/composer/composer.json +0 -5
  168. data/smoke-test/dependabot-file/partial-config/composer/composer.lock +0 -72
  169. data/smoke-test/docker/Dockerfile +0 -19
  170. data/smoke-test/elm/elm-package.json +0 -15
  171. data/smoke-test/elm/elm.json +0 -31
  172. data/smoke-test/github-actions/both/.github/workflows/this.yaml +0 -11
  173. data/smoke-test/github-actions/both/yaml/action.yml +0 -13
  174. data/smoke-test/github-actions/invalid/invalid_file.yaml +0 -0
  175. data/smoke-test/github-actions/workflow/.github/workflows/this.yaml +0 -11
  176. data/smoke-test/github-actions/yaml/action.yml +0 -13
  177. data/smoke-test/gitsubmodule/.gitmodules +0 -4
  178. data/smoke-test/gomod/go.mod +0 -16
  179. data/smoke-test/gomod/go.sum +0 -18
  180. data/smoke-test/gomod/gomain.go +0 -14
  181. data/smoke-test/gradle/.gitignore +0 -1
  182. data/smoke-test/gradle/build.gradle +0 -65
  183. data/smoke-test/maven/pom.xml +0 -65
  184. data/smoke-test/mix/mix.exs +0 -24
  185. data/smoke-test/mix/mix.lock +0 -5
  186. data/smoke-test/npm/package-lock.json +0 -166
  187. data/smoke-test/npm/package.json +0 -22
  188. data/smoke-test/npm/removed/package-lock.json +0 -44
  189. data/smoke-test/npm/removed/package.json +0 -15
  190. data/smoke-test/nuget/project.csproj +0 -14
  191. data/smoke-test/pip/pip/requirements.txt +0 -5
  192. data/smoke-test/pip/pip-compile/requirements.in +0 -2
  193. data/smoke-test/pip/pip-compile/requirements.txt +0 -16
  194. data/smoke-test/pip/pipenv/Pipfile +0 -13
  195. data/smoke-test/pip/pipenv/Pipfile.lock +0 -86
  196. data/smoke-test/pip/poetry/poetry.lock +0 -33
  197. data/smoke-test/pip/poetry/pyproject.toml +0 -18
  198. data/smoke-test/pub/pubspec.lock +0 -40
  199. data/smoke-test/pub/pubspec.yaml +0 -10
  200. data/smoke-test/terraform/main.tf +0 -143
@@ -1,417 +0,0 @@
1
- <?php
2
- /*~ class.pop3.php
3
- .---------------------------------------------------------------------------.
4
- | Software: PHPMailer - PHP email class |
5
- | Version: 5.2.2 |
6
- | Site: https://code.google.com/a/apache-extras.org/p/phpmailer/ |
7
- | ------------------------------------------------------------------------- |
8
- | Admin: Jim Jagielski (project admininistrator) |
9
- | Authors: Andy Prevost (codeworxtech) codeworxtech@users.sourceforge.net |
10
- | : Marcus Bointon (coolbru) coolbru@users.sourceforge.net |
11
- | : Jim Jagielski (jimjag) jimjag@gmail.com |
12
- | Founder: Brent R. Matzelle (original founder) |
13
- | Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved. |
14
- | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved. |
15
- | Copyright (c) 2001-2003, Brent R. Matzelle |
16
- | ------------------------------------------------------------------------- |
17
- | License: Distributed under the Lesser General Public License (LGPL) |
18
- | http://www.gnu.org/copyleft/lesser.html |
19
- | This program is distributed in the hope that it will be useful - WITHOUT |
20
- | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21
- | FITNESS FOR A PARTICULAR PURPOSE. |
22
- '---------------------------------------------------------------------------'
23
- */
24
-
25
- /**
26
- * PHPMailer - PHP POP Before SMTP Authentication Class
27
- * NOTE: Designed for use with PHP version 5 and up
28
- * @package PHPMailer
29
- * @author Andy Prevost
30
- * @author Marcus Bointon
31
- * @author Jim Jagielski
32
- * @copyright 2010 - 2012 Jim Jagielski
33
- * @copyright 2004 - 2009 Andy Prevost
34
- * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
35
- */
36
-
37
- /**
38
- * PHP POP-Before-SMTP Authentication Class
39
- *
40
- * Version 5.2.2
41
- *
42
- * @license: LGPL, see PHPMailer License
43
- *
44
- * Specifically for PHPMailer to allow POP before SMTP authentication.
45
- * Does not yet work with APOP - if you have an APOP account, contact Jim Jagielski
46
- * and we can test changes to this script.
47
- *
48
- * This class is based on the structure of the SMTP class originally authored by Chris Ryan
49
- *
50
- * This class is rfc 1939 compliant and implements all the commands
51
- * required for POP3 connection, authentication and disconnection.
52
- *
53
- * @package PHPMailer
54
- * @author Richard Davey (orig) <rich@corephp.co.uk>
55
- * @author Andy Prevost
56
- * @author Jim Jagielski
57
- */
58
-
59
- class POP3 {
60
- /**
61
- * Default POP3 port
62
- * @var int
63
- */
64
- public $POP3_PORT = 110;
65
-
66
- /**
67
- * Default Timeout
68
- * @var int
69
- */
70
- public $POP3_TIMEOUT = 30;
71
-
72
- /**
73
- * POP3 Carriage Return + Line Feed
74
- * @var string
75
- */
76
- public $CRLF = "\r\n";
77
-
78
- /**
79
- * Displaying Debug warnings? (0 = now, 1+ = yes)
80
- * @var int
81
- */
82
- public $do_debug = 2;
83
-
84
- /**
85
- * POP3 Mail Server
86
- * @var string
87
- */
88
- public $host;
89
-
90
- /**
91
- * POP3 Port
92
- * @var int
93
- */
94
- public $port;
95
-
96
- /**
97
- * POP3 Timeout Value
98
- * @var int
99
- */
100
- public $tval;
101
-
102
- /**
103
- * POP3 Username
104
- * @var string
105
- */
106
- public $username;
107
-
108
- /**
109
- * POP3 Password
110
- * @var string
111
- */
112
- public $password;
113
-
114
- /**
115
- * Sets the POP3 PHPMailer Version number
116
- * @var string
117
- */
118
- public $Version = '5.2.2';
119
-
120
- /////////////////////////////////////////////////
121
- // PROPERTIES, PRIVATE AND PROTECTED
122
- /////////////////////////////////////////////////
123
-
124
- /**
125
- * @var resource Resource handle for the POP connection socket
126
- */
127
- private $pop_conn;
128
- /**
129
- * @var boolean Are we connected?
130
- */
131
- private $connected;
132
- /**
133
- * @var array Error container
134
- */
135
- private $error; // Error log array
136
-
137
- /**
138
- * Constructor, sets the initial values
139
- * @access public
140
- * @return POP3
141
- */
142
- public function __construct() {
143
- $this->pop_conn = 0;
144
- $this->connected = false;
145
- $this->error = null;
146
- }
147
-
148
- /**
149
- * Combination of public events - connect, login, disconnect
150
- * @access public
151
- * @param string $host
152
- * @param bool|int $port
153
- * @param bool|int $tval
154
- * @param string $username
155
- * @param string $password
156
- * @param int $debug_level
157
- * @return bool
158
- */
159
- public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
160
- $this->host = $host;
161
-
162
- // If no port value is passed, retrieve it
163
- if ($port == false) {
164
- $this->port = $this->POP3_PORT;
165
- } else {
166
- $this->port = $port;
167
- }
168
-
169
- // If no port value is passed, retrieve it
170
- if ($tval == false) {
171
- $this->tval = $this->POP3_TIMEOUT;
172
- } else {
173
- $this->tval = $tval;
174
- }
175
-
176
- $this->do_debug = $debug_level;
177
- $this->username = $username;
178
- $this->password = $password;
179
-
180
- // Refresh the error log
181
- $this->error = null;
182
-
183
- // Connect
184
- $result = $this->Connect($this->host, $this->port, $this->tval);
185
-
186
- if ($result) {
187
- $login_result = $this->Login($this->username, $this->password);
188
-
189
- if ($login_result) {
190
- $this->Disconnect();
191
-
192
- return true;
193
- }
194
-
195
- }
196
-
197
- // We need to disconnect regardless if the login succeeded
198
- $this->Disconnect();
199
-
200
- return false;
201
- }
202
-
203
- /**
204
- * Connect to the POP3 server
205
- * @access public
206
- * @param string $host
207
- * @param bool|int $port
208
- * @param integer $tval
209
- * @return boolean
210
- */
211
- public function Connect ($host, $port = false, $tval = 30) {
212
- // Are we already connected?
213
- if ($this->connected) {
214
- return true;
215
- }
216
-
217
- /*
218
- On Windows this will raise a PHP Warning error if the hostname doesn't exist.
219
- Rather than supress it with @fsockopen, let's capture it cleanly instead
220
- */
221
-
222
- set_error_handler(array(&$this, 'catchWarning'));
223
-
224
- // Connect to the POP3 server
225
- $this->pop_conn = fsockopen($host, // POP3 Host
226
- $port, // Port #
227
- $errno, // Error Number
228
- $errstr, // Error Message
229
- $tval); // Timeout (seconds)
230
-
231
- // Restore the error handler
232
- restore_error_handler();
233
-
234
- // Does the Error Log now contain anything?
235
- if ($this->error && $this->do_debug >= 1) {
236
- $this->displayErrors();
237
- }
238
-
239
- // Did we connect?
240
- if ($this->pop_conn == false) {
241
- // It would appear not...
242
- $this->error = array(
243
- 'error' => "Failed to connect to server $host on port $port",
244
- 'errno' => $errno,
245
- 'errstr' => $errstr
246
- );
247
-
248
- if ($this->do_debug >= 1) {
249
- $this->displayErrors();
250
- }
251
-
252
- return false;
253
- }
254
-
255
- // Increase the stream time-out
256
-
257
- // Check for PHP 4.3.0 or later
258
- if (version_compare(phpversion(), '5.0.0', 'ge')) {
259
- stream_set_timeout($this->pop_conn, $tval, 0);
260
- } else {
261
- // Does not work on Windows
262
- if (substr(PHP_OS, 0, 3) !== 'WIN') {
263
- socket_set_timeout($this->pop_conn, $tval, 0);
264
- }
265
- }
266
-
267
- // Get the POP3 server response
268
- $pop3_response = $this->getResponse();
269
-
270
- // Check for the +OK
271
- if ($this->checkResponse($pop3_response)) {
272
- // The connection is established and the POP3 server is talking
273
- $this->connected = true;
274
- return true;
275
- }
276
- return false;
277
- }
278
-
279
- /**
280
- * Login to the POP3 server (does not support APOP yet)
281
- * @access public
282
- * @param string $username
283
- * @param string $password
284
- * @return boolean
285
- */
286
- public function Login ($username = '', $password = '') {
287
- if ($this->connected == false) {
288
- $this->error = 'Not connected to POP3 server';
289
-
290
- if ($this->do_debug >= 1) {
291
- $this->displayErrors();
292
- }
293
- }
294
-
295
- if (empty($username)) {
296
- $username = $this->username;
297
- }
298
-
299
- if (empty($password)) {
300
- $password = $this->password;
301
- }
302
-
303
- $pop_username = "USER $username" . $this->CRLF;
304
- $pop_password = "PASS $password" . $this->CRLF;
305
-
306
- // Send the Username
307
- $this->sendString($pop_username);
308
- $pop3_response = $this->getResponse();
309
-
310
- if ($this->checkResponse($pop3_response)) {
311
- // Send the Password
312
- $this->sendString($pop_password);
313
- $pop3_response = $this->getResponse();
314
-
315
- if ($this->checkResponse($pop3_response)) {
316
- return true;
317
- }
318
- }
319
- return false;
320
- }
321
-
322
- /**
323
- * Disconnect from the POP3 server
324
- * @access public
325
- */
326
- public function Disconnect () {
327
- $this->sendString('QUIT');
328
-
329
- fclose($this->pop_conn);
330
- }
331
-
332
- /////////////////////////////////////////////////
333
- // Private Methods
334
- /////////////////////////////////////////////////
335
-
336
- /**
337
- * Get the socket response back.
338
- * $size is the maximum number of bytes to retrieve
339
- * @access private
340
- * @param integer $size
341
- * @return string
342
- */
343
- private function getResponse ($size = 128) {
344
- $pop3_response = fgets($this->pop_conn, $size);
345
-
346
- return $pop3_response;
347
- }
348
-
349
- /**
350
- * Send a string down the open socket connection to the POP3 server
351
- * @access private
352
- * @param string $string
353
- * @return integer
354
- */
355
- private function sendString ($string) {
356
- $bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
357
-
358
- return $bytes_sent;
359
- }
360
-
361
- /**
362
- * Checks the POP3 server response for +OK or -ERR
363
- * @access private
364
- * @param string $string
365
- * @return boolean
366
- */
367
- private function checkResponse ($string) {
368
- if (substr($string, 0, 3) !== '+OK') {
369
- $this->error = array(
370
- 'error' => "Server reported an error: $string",
371
- 'errno' => 0,
372
- 'errstr' => ''
373
- );
374
-
375
- if ($this->do_debug >= 1) {
376
- $this->displayErrors();
377
- }
378
-
379
- return false;
380
- } else {
381
- return true;
382
- }
383
-
384
- }
385
-
386
- /**
387
- * If debug is enabled, display the error message array
388
- * @access private
389
- */
390
- private function displayErrors () {
391
- echo '<pre>';
392
-
393
- foreach ($this->error as $single_error) {
394
- print_r($single_error);
395
- }
396
-
397
- echo '</pre>';
398
- }
399
-
400
- /**
401
- * Takes over from PHP for the socket warning handler
402
- * @access private
403
- * @param integer $errno
404
- * @param string $errstr
405
- * @param string $errfile
406
- * @param integer $errline
407
- */
408
- private function catchWarning ($errno, $errstr, $errfile, $errline) {
409
- $this->error[] = array(
410
- 'error' => "Connecting to the POP3 server raised a PHP warning: ",
411
- 'errno' => $errno,
412
- 'errstr' => $errstr
413
- );
414
- }
415
-
416
- // End of class
417
- }