-
Notifications
You must be signed in to change notification settings - Fork 0
/
ezmlm.php
38 lines (33 loc) · 1.04 KB
/
ezmlm.php
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
<?php
/**
* ezmlm-functions
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Stean <[email protected]>
*/
function checkMail($mailaddress) {
$addresses = getAddressList();
/*
* Allow, if something goes wrong but the fallback action is set to "allow"
* or if everything goes well and the entered address is found
*/
if (($addresses == FALSE && $this->getConf("fallback_action") == 1) ||
($addresses != FALSE && in_array($mailaddress, $addresses))) {
return TRUE;
}else{
return FALSE;
}
}
function getAddressList() {
//Initialize $output
unset($output);
$commandstr=$this->getConf("ezmlm-binary"). " ".$this->getConf("mailinglist-subdir");
exec($commandstr, $output, $retval); //TODO: Replace exec by PHP-based file parsing
if ($retval != 0) {
//Log error
dbglog("Execution of `$commandstr` failed with returnvalue $retval and output \"$output\"");
return FALSE;
}else{
return $output;
}
}