function start() { build_progress("Loading LDAP config", 15); LoadLDAPDBs(); build_progress("Loading Transport data", 20); transport_maps_search(); build_progress("Loading Transport data", 25); relais_domains_search(); build_progress("Building Transport database", 30); build_transport_maps(); build_progress("Building Transport database", 35); build_relay_domains(); build_progress("Building Transport database", 40); restrict_relay_domains(); build_progress("Building Transport database", 50); build_cyrus_lmtp_auth(); build_progress("Building Transport database", 55); relay_recipient_maps_build(); $hashT = new main_hash_table(); $hashT->mydestination(); build_progress("Building Transport database", 60); mailbox_transport_maps(); build_progress("Building Transport database", 70); relayhost(); build_progress("Building Transport database", 80); perso_settings(); build_progress("{reloading_smtp_service}", 90); shell_exec("{$GLOBALS["postfix"]} reload >/dev/null 2>&1"); build_progress("{done}", 100); }
if (!function_exists($func)) { SEND_PROGRESS($start, $func, "Error {$func} no such function..."); continue; } try { SEND_PROGRESS($start, "Action 2, {$start}% Please wait, executing {$func}() {$i}/{$tot}.."); call_user_func($func); } catch (Exception $e) { SEND_PROGRESS($start, $func, "Error on {$func} ({$e})"); } } $reste = 100 - $start; $reste++; SEND_PROGRESS($reste, "mydestination"); $hashT = new main_hash_table(); $hashT->mydestination(); SEND_PROGRESS(100, "Reload postfix"); shell_exec("{$GLOBALS["postfix"]} reload >/dev/null 2>&1"); function build_progress_smtp_generic_maps($text, $pourc) { $GLOBALS["CACHEFILE"] = "/usr/share/artica-postfix/ressources/logs/web/smtp_generic_maps"; echo "{$pourc}% {$text}\n"; $cachefile = $GLOBALS["CACHEFILE"]; $array["POURC"] = $pourc; $array["TEXT"] = $text; @file_put_contents($cachefile, serialize($array)); @chmod($cachefile, 0755); } function build_progress_sender_routing($text, $pourc) { $GLOBALS["CACHEFILE"] = "/usr/share/artica-postfix/ressources/logs/web/build_progress_sender_routing";
function OthersValues() { if (!isset($GLOBALS["CLASS_SOCKET"])) { $GLOBALS["CLASS_SOCKET"] = new sockets(); $sock = $GLOBALS["CLASS_SOCKET"]; } else { $sock = $GLOBALS["CLASS_SOCKET"]; } if ($sock->GET_INFO("EnablePostfixMultiInstance") == 1) { return; } $main = new main_cf(); $mainmulti = new maincf_multi("master", "master"); $main->FillDefaults(); echo "Starting......: Fix others settings\n"; $message_size_limit = $sock->GET_INFO("message_size_limit"); if (!is_numeric($message_size_limit)) { $message_size_limit = 0; } $main->main_array["message_size_limit"] = $sock->GET_INFO("message_size_limit"); $minimal_backoff_time = $mainmulti->GET("minimal_backoff_time"); $maximal_backoff_time = $mainmulti->GET("maximal_backoff_time"); $bounce_queue_lifetime = $mainmulti->GET("bounce_queue_lifetime"); $maximal_queue_lifetime = $mainmulti->GET("maximal_queue_lifetime"); $smtp_connection_cache_on_demand = $mainmulti->GET("smtp_connection_cache_on_demand"); $smtp_connection_cache_time_limit = $mainmulti->GET("smtp_connection_cache_time_limit"); $smtp_connection_reuse_time_limit = $mainmulti->GET("smtp_connection_reuse_time_limit"); $connection_cache_ttl_limit = $mainmulti->GET("connection_cache_ttl_limit"); $connection_cache_status_update_time = $mainmulti->GET("connection_cache_status_update_time"); $smtp_connection_cache_destinations = unserialize(base64_decode($mainmulti->GET_BIGDATA("smtp_connection_cache_destinations"))); $address_verify_map = $mainmulti->GET("address_verify_map"); $address_verify_negative_cache = $mainmulti->GET("address_verify_negative_cache"); $address_verify_poll_count = $mainmulti->GET("address_verify_poll_count"); $address_verify_poll_delay = $mainmulti->GET("address_verify_poll_delay"); $address_verify_sender = $mainmulti->GET("address_verify_sender"); $address_verify_negative_expire_time = $mainmulti->GET("address_verify_negative_expire_time"); $address_verify_negative_refresh_time = $mainmulti->GET("address_verify_negative_refresh_time"); $address_verify_positive_expire_time = $mainmulti->GET("address_verify_positive_expire_time"); $address_verify_positive_refresh_time = $mainmulti->GET("address_verify_positive_refresh_time"); if ($address_verify_map == null) { $address_verify_map = "btree:/var/lib/postfix/verify"; } $smtpd_error_sleep_time = $mainmulti->GET("smtpd_error_sleep_time"); $smtpd_soft_error_limit = $mainmulti->GET("smtpd_soft_error_limit"); $smtpd_hard_error_limit = $mainmulti->GET("smtpd_hard_error_limit"); $smtpd_client_connection_count_limit = $mainmulti->GET("smtpd_client_connection_count_limit"); $smtpd_client_connection_rate_limit = $mainmulti->GET("smtpd_client_connection_rate_limit"); $smtpd_client_message_rate_limit = $mainmulti->GET("smtpd_client_message_rate_limit"); $smtpd_client_recipient_rate_limit = $mainmulti->GET("smtpd_client_recipient_rate_limit"); $smtpd_client_new_tls_session_rate_limit = $mainmulti->GET("smtpd_client_new_tls_session_rate_limit"); $smtpd_client_event_limit_exceptions = $mainmulti->GET("smtpd_client_event_limit_exceptions"); $in_flow_delay = $mainmulti->GET("in_flow_delay"); $smtp_connect_timeout = $mainmulti->GET("smtp_connect_timeout"); $smtp_helo_timeout = $mainmulti->GET("smtp_helo_timeout"); $initial_destination_concurrency = $mainmulti->GET("initial_destination_concurrency"); $default_destination_concurrency_limit = $mainmulti->GET("default_destination_concurrency_limit"); $local_destination_concurrency_limit = $mainmulti->GET("local_destination_concurrency_limit"); $smtp_destination_concurrency_limit = $mainmulti->GET("smtp_destination_concurrency_limit"); $default_destination_recipient_limit = $mainmulti->GET("default_destination_recipient_limit"); $smtpd_recipient_limit = $mainmulti->GET("smtpd_recipient_limit"); $queue_run_delay = $mainmulti->GET("queue_run_delay"); $minimal_backoff_time = $mainmulti->GET("minimal_backoff_time"); $maximal_backoff_time = $mainmulti->GET("maximal_backoff_time"); $maximal_queue_lifetime = $mainmulti->GET("maximal_queue_lifetime"); $bounce_queue_lifetime = $mainmulti->GET("bounce_queue_lifetime"); $qmgr_message_recipient_limit = $mainmulti->GET("qmgr_message_recipient_limit"); $default_process_limit = $mainmulti->GET("default_process_limit"); $smtp_fallback_relay = $mainmulti->GET("smtp_fallback_relay"); if (!is_numeric($smtp_connection_cache_on_demand)) { $smtp_connection_cache_on_demand = 1; } if ($smtp_connection_cache_time_limit == null) { $smtp_connection_cache_time_limit = "2s"; } if ($smtp_connection_reuse_time_limit == null) { $smtp_connection_reuse_time_limit = "300s"; } if ($connection_cache_ttl_limit == null) { $connection_cache_ttl_limit = "2s"; } if ($connection_cache_status_update_time == null) { $connection_cache_status_update_time = "600s"; } if ($smtp_connection_cache_on_demand == 1) { $smtp_connection_cache_on_demand = "yes"; } else { $smtp_connection_cache_on_demand = "no"; } if (count($smtp_connection_cache_destinations) > 0) { while (list($host, $none) = each($smtp_connection_cache_destinations)) { $smtp_connection_cache_destinationsR[] = $host; } $smtp_connection_cache_destinationsF = @implode(",", $smtp_connection_cache_destinationsR); } if (!is_numeric($address_verify_negative_cache)) { $address_verify_negative_cache = 1; } if (!is_numeric($address_verify_poll_count)) { $address_verify_poll_count = 3; } if ($address_verify_poll_delay == null) { $address_verify_poll_delay = "3s"; } if ($address_verify_sender == null) { $address_verify_sender = "double-bounce"; } if ($address_verify_negative_expire_time == null) { $address_verify_negative_expire_time = "3d"; } if ($address_verify_negative_refresh_time == null) { $address_verify_negative_refresh_time = "3h"; } if ($address_verify_positive_expire_time == null) { $address_verify_positive_expire_time = "31d"; } if ($address_verify_positive_refresh_time == null) { $address_verify_positive_refresh_time = "7d"; } if ($smtpd_error_sleep_time == null) { $smtpd_error_sleep_time = "1s"; } if (!is_numeric($smtpd_soft_error_limit)) { $smtpd_soft_error_limit = 10; } if (!is_numeric($smtpd_hard_error_limit)) { $smtpd_hard_error_limit = 20; } if (!is_numeric($smtpd_client_connection_count_limit)) { $smtpd_client_connection_count_limit = 50; } if (!is_numeric($smtpd_client_connection_rate_limit)) { $smtpd_client_connection_rate_limit = 0; } if (!is_numeric($smtpd_client_message_rate_limit)) { $smtpd_client_message_rate_limit = 0; } if (!is_numeric($smtpd_client_recipient_rate_limit)) { $smtpd_client_recipient_rate_limit = 0; } if (!is_numeric($smtpd_client_new_tls_session_rate_limit)) { $smtpd_client_new_tls_session_rate_limit = 0; } if (!is_numeric($initial_destination_concurrency)) { $initial_destination_concurrency = 5; } if (!is_numeric($default_destination_concurrency_limit)) { $default_destination_concurrency_limit = 20; } if (!is_numeric($smtp_destination_concurrency_limit)) { $smtp_destination_concurrency_limit = 20; } if (!is_numeric($local_destination_concurrency_limit)) { $local_destination_concurrency_limit = 2; } if (!is_numeric($default_destination_recipient_limit)) { $default_destination_recipient_limit = 50; } if (!is_numeric($smtpd_recipient_limit)) { $smtpd_recipient_limit = 1000; } if (!is_numeric($default_process_limit)) { $default_process_limit = 100; } if (!is_numeric($qmgr_message_recipient_limit)) { $qmgr_message_recipient_limit = 20000; } if ($smtpd_client_event_limit_exceptions == null) { $smtpd_client_event_limit_exceptions = "\$mynetworks"; } if ($in_flow_delay == null) { $in_flow_delay = "1s"; } if ($smtp_connect_timeout == null) { $smtp_connect_timeout = "30s"; } if ($smtp_helo_timeout == null) { $smtp_helo_timeout = "300s"; } if ($bounce_queue_lifetime == null) { $bounce_queue_lifetime = "5d"; } if ($maximal_queue_lifetime == null) { $maximal_queue_lifetime = "5d"; } if ($maximal_backoff_time == null) { $maximal_backoff_time = "4000s"; } if ($minimal_backoff_time == null) { $minimal_backoff_time = "300s"; } if ($queue_run_delay == null) { $queue_run_delay = "300s"; } if ($address_verify_negative_cache == 1) { $address_verify_negative_cache = "yes"; } else { $address_verify_negative_cache = "no"; } $main->main_array["default_destination_recipient_limit"] = $sock->GET_INFO("default_destination_recipient_limit"); $main->main_array["smtpd_recipient_limit"] = $sock->GET_INFO("smtpd_recipient_limit"); $main->main_array["mime_nesting_limit"] = $sock->GET_INFO("mime_nesting_limit"); $main->main_array["header_address_token_limit"] = $sock->GET_INFO("header_address_token_limit"); $main->main_array["virtual_mailbox_limit"] = $sock->GET_INFO("virtual_mailbox_limit"); if ($main->main_array["message_size_limit"] == null) { $main->main_array["message_size_limit"] = 102400000; } if ($main->main_array["virtual_mailbox_limit"] == null) { $main->main_array["virtual_mailbox_limit"] = 102400000; } if ($main->main_array["default_destination_recipient_limit"] == null) { $main->main_array["default_destination_recipient_limit"] = 50; } if ($main->main_array["smtpd_recipient_limit"] == null) { $main->main_array["smtpd_recipient_limit"] = 1000; } if ($main->main_array["mime_nesting_limit"] == null) { $main->main_array["mime_nesting_limit"] = 100; } if ($main->main_array["header_address_token_limit"] == null) { $main->main_array["header_address_token_limit"] = 10240; } echo "Starting......: message_size_limit={$main->main_array["message_size_limit"]}\n"; echo "Starting......: default_destination_recipient_limit={$main->main_array["default_destination_recipient_limit"]}\n"; echo "Starting......: smtpd_recipient_limit={$main->main_array["smtpd_recipient_limit"]}\n"; echo "Starting......: mime_nesting_limit={$main->main_array["mime_nesting_limit"]}\n"; echo "Starting......: header_address_token_limit={$main->main_array["header_address_token_limit"]}\n"; echo "Starting......: minimal_backoff_time={$minimal_backoff_time}\n"; echo "Starting......: maximal_backoff_time={$maximal_backoff_time}\n"; echo "Starting......: maximal_queue_lifetime={$maximal_queue_lifetime}\n"; echo "Starting......: bounce_queue_lifetime={$bounce_queue_lifetime}\n"; if ($minimal_backoff_time == null) { $minimal_backoff_time = "300s"; } if ($maximal_backoff_time == null) { $maximal_backoff_time = "4000s"; } if ($bounce_queue_lifetime == null) { $bounce_queue_lifetime = "5d"; } if ($maximal_queue_lifetime == null) { $maximal_queue_lifetime = "5d"; } postconf("address_verify_map", "{$address_verify_map}"); postconf("address_verify_negative_cache", "{$address_verify_negative_cache}"); postconf("address_verify_poll_count", "{$address_verify_poll_count}"); postconf("address_verify_poll_delay", "{$address_verify_poll_delay}"); postconf("address_verify_sender", "{$address_verify_sender}"); postconf("address_verify_negative_expire_time", "{$address_verify_negative_expire_time}"); postconf("address_verify_negative_refresh_time", "{$address_verify_negative_refresh_time}"); postconf("address_verify_positive_expire_time", "{$address_verify_positive_expire_time}"); postconf("address_verify_positive_refresh_time", "{$address_verify_positive_refresh_time}"); postconf("message_size_limit", "{$message_size_limit}"); postconf("virtual_mailbox_limit", "{$message_size_limit}"); postconf("mailbox_size_limit", "{$message_size_limit}"); postconf("default_destination_recipient_limit", "{$main->main_array["default_destination_recipient_limit"]}"); postconf("smtpd_recipient_limit", "{$main->main_array["smtpd_recipient_limit"]}"); postconf("mime_nesting_limit", "{$main->main_array["mime_nesting_limit"]}"); postconf("minimal_backoff_time", "{$minimal_backoff_time}"); postconf("maximal_backoff_time", "{$maximal_backoff_time}"); postconf("maximal_queue_lifetime", "{$maximal_queue_lifetime}"); postconf("bounce_queue_lifetime", "{$bounce_queue_lifetime}"); postconf("smtp_connection_cache_on_demand", "{$smtp_connection_cache_on_demand}"); postconf("smtp_connection_cache_time_limit", "{$smtp_connection_cache_time_limit}"); postconf("smtp_connection_reuse_time_limit", "{$smtp_connection_reuse_time_limit}"); postconf("connection_cache_ttl_limit", "{$connection_cache_ttl_limit}"); postconf("connection_cache_status_update_time", "{$connection_cache_status_update_time}"); postconf("smtp_connection_cache_destinations", "{$smtp_connection_cache_destinationsF}"); postconf("smtpd_error_sleep_time", $smtpd_error_sleep_time); postconf("smtpd_soft_error_limit", $smtpd_soft_error_limit); postconf("smtpd_hard_error_limit", $smtpd_hard_error_limit); postconf("smtpd_client_connection_count_limit", $smtpd_client_connection_count_limit); postconf("smtpd_client_connection_rate_limit", $smtpd_client_connection_rate_limit); postconf("smtpd_client_message_rate_limit", $smtpd_client_message_rate_limit); postconf("smtpd_client_recipient_rate_limit", $smtpd_client_recipient_rate_limit); postconf("smtpd_client_new_tls_session_rate_limit", $smtpd_client_new_tls_session_rate_limit); postconf("initial_destination_concurrency", $initial_destination_concurrency); postconf("default_destination_concurrency_limit", $default_destination_concurrency_limit); postconf("smtp_destination_concurrency_limit", $smtp_destination_concurrency_limit); postconf("local_destination_concurrency_limit", $local_destination_concurrency_limit); postconf("default_destination_recipient_limit", $default_destination_recipient_limit); postconf("smtpd_recipient_limit", $smtpd_recipient_limit); postconf("default_process_limit", $default_process_limit); postconf("qmgr_message_recipient_limit", $qmgr_message_recipient_limit); postconf("smtpd_client_event_limit_exceptions", $smtpd_client_event_limit_exceptions); postconf("in_flow_delay", $in_flow_delay); postconf("smtp_connect_timeout", $smtp_connect_timeout); postconf("smtp_helo_timeout", $smtp_helo_timeout); postconf("bounce_queue_lifetime", $bounce_queue_lifetime); postconf("maximal_queue_lifetime", $maximal_queue_lifetime); postconf("maximal_backoff_time", $maximal_backoff_time); postconf("minimal_backoff_time", $minimal_backoff_time); postconf("queue_run_delay", $queue_run_delay); postconf("smtp_fallback_relay", $smtp_fallback_relay); if (!isset($GLOBALS["POSTFIX_HEADERS_CHECK_BUILDED"])) { headers_check(1); } $HashMainCf = unserialize(base64_decode($sock->GET_INFO("HashMainCf"))); if (is_array($HashMainCf)) { while (list($key, $val) = each($HashMainCf)) { system("{$GLOBALS["postconf"]} -e \"{$key} = {$val}\" >/dev/null 2>&1"); } } $hashT = new main_hash_table(); $hashT->mydestination(); perso_settings(); }
function cmdline_transport() { LoadLDAPDBs(); transport_maps_search(); relais_domains_search(); build_transport_maps(); build_relay_domains(); restrict_relay_domains(); build_cyrus_lmtp_auth(); relay_recipient_maps_build(); $hashT = new main_hash_table(); $hashT->mydestination(); mailbox_transport_maps(); relayhost(); }
function OthersValues() { if (!isset($GLOBALS["CLASS_SOCKET"])) { $GLOBALS["CLASS_SOCKET"] = new sockets(); $sock = $GLOBALS["CLASS_SOCKET"]; } else { $sock = $GLOBALS["CLASS_SOCKET"]; } if ($sock->GET_INFO("EnablePostfixMultiInstance") == 1) { return; } $main = new main_cf(); $mainmulti = new maincf_multi("master", "master"); $main->FillDefaults(); echo "Starting......: " . date("H:i:s") . " Fix others settings\n"; $message_size_limit = $sock->GET_INFO("message_size_limit"); if (!is_numeric($message_size_limit)) { $message_size_limit = 0; } $main->main_array["message_size_limit"] = $sock->GET_INFO("message_size_limit"); $minimal_backoff_time = $mainmulti->GET("minimal_backoff_time"); $maximal_backoff_time = $mainmulti->GET("maximal_backoff_time"); $bounce_queue_lifetime = $mainmulti->GET("bounce_queue_lifetime"); $maximal_queue_lifetime = $mainmulti->GET("maximal_queue_lifetime"); $smtp_connection_cache_on_demand = $mainmulti->GET("smtp_connection_cache_on_demand"); $smtp_connection_cache_time_limit = $mainmulti->GET("smtp_connection_cache_time_limit"); $smtp_connection_reuse_time_limit = $mainmulti->GET("smtp_connection_reuse_time_limit"); $connection_cache_ttl_limit = $mainmulti->GET("connection_cache_ttl_limit"); $connection_cache_status_update_time = $mainmulti->GET("connection_cache_status_update_time"); $smtp_connection_cache_destinations = unserialize(base64_decode($mainmulti->GET_BIGDATA("smtp_connection_cache_destinations"))); $address_verify_map = $mainmulti->GET("address_verify_map"); $address_verify_negative_cache = $mainmulti->GET("address_verify_negative_cache"); $address_verify_poll_count = $mainmulti->GET("address_verify_poll_count"); $address_verify_poll_delay = $mainmulti->GET("address_verify_poll_delay"); $address_verify_sender = $mainmulti->GET("address_verify_sender"); $address_verify_negative_expire_time = $mainmulti->GET("address_verify_negative_expire_time"); $address_verify_negative_refresh_time = $mainmulti->GET("address_verify_negative_refresh_time"); $address_verify_positive_expire_time = $mainmulti->GET("address_verify_positive_expire_time"); $address_verify_positive_refresh_time = $mainmulti->GET("address_verify_positive_refresh_time"); if ($address_verify_map == null) { $address_verify_map = "btree:/var/lib/postfix/verify"; } $smtpd_error_sleep_time = $mainmulti->GET("smtpd_error_sleep_time"); $smtpd_soft_error_limit = $mainmulti->GET("smtpd_soft_error_limit"); $smtpd_hard_error_limit = $mainmulti->GET("smtpd_hard_error_limit"); $smtpd_client_connection_count_limit = $mainmulti->GET("smtpd_client_connection_count_limit"); $smtpd_client_connection_rate_limit = $mainmulti->GET("smtpd_client_connection_rate_limit"); $smtpd_client_message_rate_limit = $mainmulti->GET("smtpd_client_message_rate_limit"); $smtpd_client_recipient_rate_limit = $mainmulti->GET("smtpd_client_recipient_rate_limit"); $smtpd_client_new_tls_session_rate_limit = $mainmulti->GET("smtpd_client_new_tls_session_rate_limit"); $smtpd_client_event_limit_exceptions = $mainmulti->GET("smtpd_client_event_limit_exceptions"); $in_flow_delay = $mainmulti->GET("in_flow_delay"); $smtp_connect_timeout = $mainmulti->GET("smtp_connect_timeout"); $smtp_helo_timeout = $mainmulti->GET("smtp_helo_timeout"); $initial_destination_concurrency = $mainmulti->GET("initial_destination_concurrency"); $default_destination_concurrency_limit = $mainmulti->GET("default_destination_concurrency_limit"); $local_destination_concurrency_limit = $mainmulti->GET("local_destination_concurrency_limit"); $smtp_destination_concurrency_limit = $mainmulti->GET("smtp_destination_concurrency_limit"); $default_destination_recipient_limit = $mainmulti->GET("default_destination_recipient_limit"); $smtpd_recipient_limit = $mainmulti->GET("smtpd_recipient_limit"); $queue_run_delay = $mainmulti->GET("queue_run_delay"); $minimal_backoff_time = $mainmulti->GET("minimal_backoff_time"); $maximal_backoff_time = $mainmulti->GET("maximal_backoff_time"); $maximal_queue_lifetime = $mainmulti->GET("maximal_queue_lifetime"); $bounce_queue_lifetime = $mainmulti->GET("bounce_queue_lifetime"); $qmgr_message_recipient_limit = $mainmulti->GET("qmgr_message_recipient_limit"); $default_process_limit = $mainmulti->GET("default_process_limit"); $smtp_fallback_relay = $mainmulti->GET("smtp_fallback_relay"); $smtpd_reject_unlisted_recipient = $mainmulti->GET("smtpd_reject_unlisted_recipient"); $smtpd_reject_unlisted_sender = $mainmulti->GET("smtpd_reject_unlisted_sender"); $ignore_mx_lookup_error = $mainmulti->GET("ignore_mx_lookup_error"); $disable_dns_lookups = $mainmulti->GET("disable_dns_lookups"); $smtpd_banner = $mainmulti->GET('smtpd_banner'); $enable_original_recipient = $mainmulti->GET("enable_original_recipient"); $undisclosed_recipients_header = $mainmulti->GET("undisclosed_recipients_header"); $smtpd_discard_ehlo_keywords = $mainmulti->GET("smtpd_discard_ehlo_keywords"); $detect_8bit_encoding_header = $mainmulti->GET("detect_8bit_encoding_header"); $disable_mime_input_processing = $mainmulti->GET("disable_mime_input_processing"); $disable_mime_output_conversion = $mainmulti->GET("disable_mime_output_conversion"); if (!is_numeric($detect_8bit_encoding_header)) { $detect_8bit_encoding_header = 1; } if (!is_numeric($disable_mime_input_processing)) { $disable_mime_input_processing = 0; } if (!is_numeric($disable_mime_output_conversion)) { $disable_mime_output_conversion = 0; } if (!is_numeric($ignore_mx_lookup_error)) { $ignore_mx_lookup_error = 0; } if (!is_numeric($disable_dns_lookups)) { $disable_dns_lookups = 0; } if (!is_numeric($smtpd_reject_unlisted_recipient)) { $smtpd_reject_unlisted_recipient = 1; } if (!is_numeric($smtpd_reject_unlisted_sender)) { $smtpd_reject_unlisted_sender = 0; } if (!is_numeric($smtp_connection_cache_on_demand)) { $smtp_connection_cache_on_demand = 1; } if ($smtp_connection_cache_time_limit == null) { $smtp_connection_cache_time_limit = "2s"; } if ($smtp_connection_reuse_time_limit == null) { $smtp_connection_reuse_time_limit = "300s"; } if ($connection_cache_ttl_limit == null) { $connection_cache_ttl_limit = "2s"; } if ($connection_cache_status_update_time == null) { $connection_cache_status_update_time = "600s"; } if ($smtp_connection_cache_on_demand == 1) { $smtp_connection_cache_on_demand = "yes"; } else { $smtp_connection_cache_on_demand = "no"; } if (count($smtp_connection_cache_destinations) > 0) { while (list($host, $none) = each($smtp_connection_cache_destinations)) { $smtp_connection_cache_destinationsR[] = $host; } $smtp_connection_cache_destinationsF = @implode(",", $smtp_connection_cache_destinationsR); } if (!is_numeric($address_verify_negative_cache)) { $address_verify_negative_cache = 1; } if (!is_numeric($address_verify_poll_count)) { $address_verify_poll_count = 3; } if ($address_verify_poll_delay == null) { $address_verify_poll_delay = "3s"; } if ($address_verify_sender == null) { $address_verify_sender = "double-bounce"; } if ($address_verify_negative_expire_time == null) { $address_verify_negative_expire_time = "3d"; } if ($address_verify_negative_refresh_time == null) { $address_verify_negative_refresh_time = "3h"; } if ($address_verify_positive_expire_time == null) { $address_verify_positive_expire_time = "31d"; } if ($address_verify_positive_refresh_time == null) { $address_verify_positive_refresh_time = "7d"; } if ($smtpd_error_sleep_time == null) { $smtpd_error_sleep_time = "1s"; } if (!is_numeric($smtpd_soft_error_limit)) { $smtpd_soft_error_limit = 10; } if (!is_numeric($smtpd_hard_error_limit)) { $smtpd_hard_error_limit = 20; } if (!is_numeric($smtpd_client_connection_count_limit)) { $smtpd_client_connection_count_limit = 50; } if (!is_numeric($smtpd_client_connection_rate_limit)) { $smtpd_client_connection_rate_limit = 0; } if (!is_numeric($smtpd_client_message_rate_limit)) { $smtpd_client_message_rate_limit = 0; } if (!is_numeric($smtpd_client_recipient_rate_limit)) { $smtpd_client_recipient_rate_limit = 0; } if (!is_numeric($smtpd_client_new_tls_session_rate_limit)) { $smtpd_client_new_tls_session_rate_limit = 0; } if (!is_numeric($initial_destination_concurrency)) { $initial_destination_concurrency = 5; } if (!is_numeric($default_destination_concurrency_limit)) { $default_destination_concurrency_limit = 20; } if (!is_numeric($smtp_destination_concurrency_limit)) { $smtp_destination_concurrency_limit = 20; } if (!is_numeric($local_destination_concurrency_limit)) { $local_destination_concurrency_limit = 2; } if (!is_numeric($default_destination_recipient_limit)) { $default_destination_recipient_limit = 50; } if (!is_numeric($smtpd_recipient_limit)) { $smtpd_recipient_limit = 1000; } if (!is_numeric($default_process_limit)) { $default_process_limit = 100; } if (!is_numeric($qmgr_message_recipient_limit)) { $qmgr_message_recipient_limit = 20000; } if ($smtpd_client_event_limit_exceptions == null) { $smtpd_client_event_limit_exceptions = "\$mynetworks"; } if ($in_flow_delay == null) { $in_flow_delay = "1s"; } if ($smtp_connect_timeout == null) { $smtp_connect_timeout = "30s"; } if ($smtp_helo_timeout == null) { $smtp_helo_timeout = "300s"; } if ($bounce_queue_lifetime == null) { $bounce_queue_lifetime = "5d"; } if ($maximal_queue_lifetime == null) { $maximal_queue_lifetime = "5d"; } if ($maximal_backoff_time == null) { $maximal_backoff_time = "4000s"; } if ($minimal_backoff_time == null) { $minimal_backoff_time = "300s"; } if ($queue_run_delay == null) { $queue_run_delay = "300s"; } if ($smtpd_banner == null) { $smtpd_banner = "\$myhostname ESMTP \$mail_name"; } $detect_8bit_encoding_header = $mainmulti->YesNo($detect_8bit_encoding_header); $disable_mime_input_processing = $mainmulti->YesNo($disable_mime_input_processing); $disable_mime_output_conversion = $mainmulti->YesNo($disable_mime_output_conversion); $smtpd_reject_unlisted_sender = $mainmulti->YesNo($smtpd_reject_unlisted_sender); $smtpd_reject_unlisted_recipient = $mainmulti->YesNo($smtpd_reject_unlisted_recipient); $ignore_mx_lookup_error = $mainmulti->YesNo($ignore_mx_lookup_error); $disable_dns_lookups = $mainmulti->YesNo($disable_dns_lookups); if (!is_numeric($enable_original_recipient)) { $enable_original_recipient = 1; } if ($undisclosed_recipients_header == null) { $undisclosed_recipients_header = "To: undisclosed-recipients:;"; } $enable_original_recipient = $mainmulti->YesNo($enable_original_recipient); $mime_nesting_limit = $mainmulti->GET("mime_nesting_limit"); if (!is_numeric($mime_nesting_limit)) { $mime_nesting_limit = $sock->GET_INFO("mime_nesting_limit"); } if (!is_numeric($mime_nesting_limit)) { $mime_nesting_limit = 100; } $main->main_array["default_destination_recipient_limit"] = $sock->GET_INFO("default_destination_recipient_limit"); $main->main_array["smtpd_recipient_limit"] = $sock->GET_INFO("smtpd_recipient_limit"); $main->main_array["header_address_token_limit"] = $sock->GET_INFO("header_address_token_limit"); $main->main_array["virtual_mailbox_limit"] = $sock->GET_INFO("virtual_mailbox_limit"); if ($main->main_array["message_size_limit"] == null) { $main->main_array["message_size_limit"] = 102400000; } if ($main->main_array["virtual_mailbox_limit"] == null) { $main->main_array["virtual_mailbox_limit"] = 102400000; } if ($main->main_array["default_destination_recipient_limit"] == null) { $main->main_array["default_destination_recipient_limit"] = 50; } if ($main->main_array["smtpd_recipient_limit"] == null) { $main->main_array["smtpd_recipient_limit"] = 1000; } if ($main->main_array["header_address_token_limit"] == null) { $main->main_array["header_address_token_limit"] = 10240; } echo "Starting......: " . date("H:i:s") . " message_size_limit={$main->main_array["message_size_limit"]}\n"; echo "Starting......: " . date("H:i:s") . " default_destination_recipient_limit={$main->main_array["default_destination_recipient_limit"]}\n"; echo "Starting......: " . date("H:i:s") . " smtpd_recipient_limit={$main->main_array["smtpd_recipient_limit"]}\n"; echo "Starting......: " . date("H:i:s") . " *** MIME PROCESSING ***\n"; echo "Starting......: " . date("H:i:s") . " mime_nesting_limit={$mime_nesting_limit}\n"; echo "Starting......: " . date("H:i:s") . " detect_8bit_encoding_header={$detect_8bit_encoding_header}\n"; echo "Starting......: " . date("H:i:s") . " disable_mime_input_processing={$disable_mime_input_processing}\n"; echo "Starting......: " . date("H:i:s") . " disable_mime_output_conversion={$disable_mime_output_conversion}\n"; echo "Starting......: " . date("H:i:s") . " header_address_token_limit={$main->main_array["header_address_token_limit"]}\n"; echo "Starting......: " . date("H:i:s") . " minimal_backoff_time={$minimal_backoff_time}\n"; echo "Starting......: " . date("H:i:s") . " maximal_backoff_time={$maximal_backoff_time}\n"; echo "Starting......: " . date("H:i:s") . " maximal_queue_lifetime={$maximal_queue_lifetime}\n"; echo "Starting......: " . date("H:i:s") . " bounce_queue_lifetime={$bounce_queue_lifetime}\n"; echo "Starting......: " . date("H:i:s") . " ignore_mx_lookup_error={$ignore_mx_lookup_error}\n"; echo "Starting......: " . date("H:i:s") . " disable_dns_lookups={$disable_dns_lookups}\n"; echo "Starting......: " . date("H:i:s") . " smtpd_banner={$smtpd_banner}\n"; if ($minimal_backoff_time == null) { $minimal_backoff_time = "300s"; } if ($maximal_backoff_time == null) { $maximal_backoff_time = "4000s"; } if ($bounce_queue_lifetime == null) { $bounce_queue_lifetime = "5d"; } if ($maximal_queue_lifetime == null) { $maximal_queue_lifetime = "5d"; } $postfix_ver = $mainmulti->postfix_version(); if (preg_match("#^([0-9]+)\\.([0-9]+)#", $postfix_ver, $re)) { $MAJOR = $re[1]; $MINOR = $re[2]; } if ($MAJOR > 1) { if ($MINOR > 9) { postconf("smtpd_relay_restrictions", "permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination"); } } build_progress_mime_header("{configuring}", 50); $address_verify_negative_cache = $mainmulti->YesNo($address_verify_negative_cache); echo "Starting......: " . date("H:i:s") . " Apply all settings..\n"; postconf("smtpd_reject_unlisted_sender", "{$smtpd_reject_unlisted_sender}"); postconf("smtpd_reject_unlisted_recipient", "{$smtpd_reject_unlisted_recipient}"); postconf("address_verify_map", "{$address_verify_map}"); postconf("address_verify_negative_cache", "{$address_verify_negative_cache}"); postconf("address_verify_poll_count", "{$address_verify_poll_count}"); postconf("address_verify_poll_delay", "{$address_verify_poll_delay}"); postconf("address_verify_sender", "{$address_verify_sender}"); postconf("address_verify_negative_expire_time", "{$address_verify_negative_expire_time}"); postconf("address_verify_negative_refresh_time", "{$address_verify_negative_refresh_time}"); postconf("address_verify_positive_expire_time", "{$address_verify_positive_expire_time}"); postconf("address_verify_positive_refresh_time", "{$address_verify_positive_refresh_time}"); postconf("message_size_limit", "{$message_size_limit}"); postconf("virtual_mailbox_limit", "{$message_size_limit}"); postconf("mailbox_size_limit", "{$message_size_limit}"); postconf("default_destination_recipient_limit", "{$main->main_array["default_destination_recipient_limit"]}"); postconf("smtpd_recipient_limit", "{$main->main_array["smtpd_recipient_limit"]}"); postconf("mime_nesting_limit", "{$mime_nesting_limit}"); postconf("detect_8bit_encoding_header", "{$detect_8bit_encoding_header}"); postconf("disable_mime_input_processing", "{$disable_mime_input_processing}"); postconf("disable_mime_output_conversion", "{$disable_mime_output_conversion}"); postconf("minimal_backoff_time", "{$minimal_backoff_time}"); postconf("maximal_backoff_time", "{$maximal_backoff_time}"); postconf("maximal_queue_lifetime", "{$maximal_queue_lifetime}"); postconf("bounce_queue_lifetime", "{$bounce_queue_lifetime}"); postconf("smtp_connection_cache_on_demand", "{$smtp_connection_cache_on_demand}"); postconf("smtp_connection_cache_time_limit", "{$smtp_connection_cache_time_limit}"); postconf("smtp_connection_reuse_time_limit", "{$smtp_connection_reuse_time_limit}"); postconf("connection_cache_ttl_limit", "{$connection_cache_ttl_limit}"); postconf("connection_cache_status_update_time", "{$connection_cache_status_update_time}"); postconf("smtp_connection_cache_destinations", "{$smtp_connection_cache_destinationsF}"); postconf("smtpd_error_sleep_time", $smtpd_error_sleep_time); postconf("smtpd_soft_error_limit", $smtpd_soft_error_limit); postconf("smtpd_hard_error_limit", $smtpd_hard_error_limit); postconf("smtpd_client_connection_count_limit", $smtpd_client_connection_count_limit); postconf("smtpd_client_connection_rate_limit", $smtpd_client_connection_rate_limit); postconf("smtpd_client_message_rate_limit", $smtpd_client_message_rate_limit); postconf("smtpd_client_recipient_rate_limit", $smtpd_client_recipient_rate_limit); postconf("smtpd_client_new_tls_session_rate_limit", $smtpd_client_new_tls_session_rate_limit); postconf("initial_destination_concurrency", $initial_destination_concurrency); postconf("default_destination_concurrency_limit", $default_destination_concurrency_limit); postconf("smtp_destination_concurrency_limit", $smtp_destination_concurrency_limit); postconf("local_destination_concurrency_limit", $local_destination_concurrency_limit); postconf("default_destination_recipient_limit", $default_destination_recipient_limit); postconf("smtpd_recipient_limit", $smtpd_recipient_limit); postconf("default_process_limit", $default_process_limit); postconf("qmgr_message_recipient_limit", $qmgr_message_recipient_limit); postconf("smtpd_client_event_limit_exceptions", $smtpd_client_event_limit_exceptions); postconf("in_flow_delay", $in_flow_delay); postconf("smtp_connect_timeout", $smtp_connect_timeout); postconf("smtp_helo_timeout", $smtp_helo_timeout); postconf("bounce_queue_lifetime", $bounce_queue_lifetime); postconf("maximal_queue_lifetime", $maximal_queue_lifetime); postconf("maximal_backoff_time", $maximal_backoff_time); postconf("minimal_backoff_time", $minimal_backoff_time); postconf("queue_run_delay", $queue_run_delay); postconf("smtp_fallback_relay", $smtp_fallback_relay); postconf("ignore_mx_lookup_error", $ignore_mx_lookup_error); postconf("disable_dns_lookups", $disable_dns_lookups); postconf("smtpd_banner", $smtpd_banner); postconf("undisclosed_recipients_header", "{$undisclosed_recipients_header}"); postconf("enable_original_recipient", "{$enable_original_recipient}"); postconf("smtpd_discard_ehlo_keywords", "{$smtpd_discard_ehlo_keywords}"); build_progress_mime_header("{configuring} {done}", 60); if (!isset($GLOBALS["POSTFIX_HEADERS_CHECK_BUILDED"])) { headers_check(1); } $HashMainCf = unserialize(base64_decode($sock->GET_INFO("HashMainCf"))); if (is_array($HashMainCf)) { while (list($key, $val) = each($HashMainCf)) { system("{$GLOBALS["postconf"]} -e \"{$key} = {$val}\" >/dev/null 2>&1"); } } $hashT = new main_hash_table(); echo "Starting......: " . date("H:i:s") . " Apply mydestination\n"; build_progress_mime_header("My Destination...", 65); $hashT->mydestination(); echo "Starting......: " . date("H:i:s") . " Apply perso_settings\n"; build_progress_mime_header("Perso settings...", 70); perso_settings(); build_progress_mime_header("Perso settings...", 75); }