-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathhelper.php
More file actions
39 lines (32 loc) · 947 Bytes
/
helper.php
File metadata and controls
39 lines (32 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* DokuWiki Plugin smtp (Helper Component)
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <andi@splitbrain.org>
*/
// must be run within Dokuwiki
if(!defined('DOKU_INC')) die();
class helper_plugin_smtp extends DokuWiki_Plugin {
/**
* Return a string usable as EHLO message
*
* @param string $ehlo configured EHLO (ovverrides automatic detection)
* @return string
*/
static public function getEHLO($ehlo='') {
if(empty($ehlo)) {
$ip = $_SERVER["SERVER_ADDR"];
if (empty($ip))
return "localhost.localdomain";
// Indicate IPv6 address according to RFC 2821, if applicable.
$colonPos = strpos($ip, ':');
if ($colonPos !== false) {
$ip = 'IPv6:'.$ip;
}
return "[" . $ip . "]";
}
return $ehlo;
}
}
// vim:ts=4:sw=4:et: