⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.50
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
psa-pear
/
pear
/
View File Name :
ingo-postfix-policyd
#!/usr/bin/env php get('horde_dir', null, 'pear.horde.org') . '/ingo/lib/Application.php'; } Horde_Registry::appInit('ingo', array('cli' => true)); exit('Not updated'); // Initialize authentication manager. $auth = $injector->getInstance('Horde_Auth')->getAuth(); // Make sure output is unbuffered. ob_implicit_flush(); // Main loop. $query = array(); while (!feof(STDIN)) { $line = fgets(STDIN); if (strpos($line, '=') !== false) { list($key, $value) = explode('=', trim($line), 2); $query[$key] = $value; } elseif ($line == "\n") { if (empty($query['request']) || $query['request'] != 'smtpd_access_policy') { Horde::log('Unrecognized request: ' . substr(var_export($query, true), 0, 200), 'ERR'); exit(1); } Horde::log(var_export($query, true), 'DEBUG'); $action = smtpd_access_policy($query); Horde::log("Action: $action", 'DEBUG'); echo "action=$action\n\n"; @ob_flush(); $query = array(); } else { Horde::log('Ignoring garbage: ' . substr($line, 0, 100), 'INFO'); } } exit(0); /** * Do policy checks * * @param array $query Query parameter hash * * @return string The access policy response. */ function smtpd_access_policy($query) { static $whitelists = array(); static $blacklists = array(); if (empty($query['sender']) || empty($query['recipient'])) { return null; } // Try to determine the Horde username corresponding to the email recipient. $user = $query['recipient']; $pos = strpos($user, '@'); if ($pos !== false) { $user = substr($user, 0, $pos); } try { $user = $GLOBALS['injector']->getInstance('Horde_Core_Hooks') ->callHook('smtpd_access_policy_username', 'ingo', $query); } catch (Horde_Exception_HookNotSet $e) {} // Get $user's rules if we don't have them already. if (!isset($whitelists[$user])) { // Default empty rules. $whitelists[$user] = array(); $blacklists[$user] = array(); // Retrieve the data. $GLOBALS['auth']->setAuth($user, array()); $GLOBALS['session']->set('ingo', 'current_share', ':' . $user); $ingo_storage = $GLOBALS['injector']->getInstance('Ingo_Factory_Storage')->create(); try { $whitelists[$user] = $ingo_storage->retrieve(Ingo_Storage::ACTION_WHITELIST)->getWhitelist(); } catch (Ingo_Exception $e) {} try { $bl = $ingo_storage->retrieve(Ingo_Storage::ACTION_BLACKLIST); if (!$bl->getBlacklistFolder()) { // We will only reject email at delivery time if the user // wants blacklisted mail deleted completely, not filed // into a separate folder. $blacklists[$user] = $bl->getBlacklist(); } } catch (Ingo_Exception $e) {} } // Check whitelist rules first so that mistaken overlap doesn't // result in lost mail. if (in_array($query['sender'], $whitelists[$user])) { return 'OK'; } elseif (in_array($query['sender'], $blacklists[$user])) { return 'REJECT'; } else { return 'DUNNO'; } }