-
Notifications
You must be signed in to change notification settings - Fork 61
/
emailpost.php
52 lines (43 loc) · 1.19 KB
/
emailpost.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/php -q
<?php
/**
* Handles the replying and posting of messages by email
*
* Note the shebang (#!) needs to point to the installed location of php on your
* system. If you have shell access running "which php" should return the correct
* path to use.
*
* For example
* - Ubuntu and Debian would normally be #!/usr/bin/php -q
*
* @package ElkArte Forum
* @copyright ElkArte Forum contributors
* @license BSD http://opensource.org/licenses/BSD-3-Clause (see accompanying LICENSE.txt file)
*
* @version 2.0 dev
*
*/
use ElkArte\EventManager;
use ElkArte\Maillist\MaillistPost;
use ElkArte\User;
// Only do something for a pipe and direct calling
if (!defined('STDIN'))
{
return;
}
// Any output here is not good
error_reporting(0);
global $ssi_guest_access;
// Need to bootstrap to do much
require_once(__DIR__ . '/bootstrap.php');
$ssi_guest_access = true;
new Bootstrap(true);
// No need to ID the server if we fall on our face :)
$_SERVER['SERVER_SOFTWARE'] = '';
$_SERVER['SERVER_NAME'] = '';
// Our mail controller
$controller = new MaillistPost(new EventManager());
$controller->setUser(User::$info);
$controller->action_pbe_post();
// Always exit as successful
exit(0);