diff --git a/helper_scripts/gentoo_setup.sh b/helper_scripts/gentoo_setup.sh index 3c736a378eb5ac53f7411ad284ab5e588f4d7479..d033122cc67f27584657591af37d2339d06d2b23 100644 --- a/helper_scripts/gentoo_setup.sh +++ b/helper_scripts/gentoo_setup.sh @@ -191,7 +191,6 @@ function enable_apache_module() function meta_mail() { local package_list="" - local add_maildrop="" local remove_ssmtp="no" local rc_scripts="" local use_courier="no" @@ -220,8 +219,6 @@ function meta_mail() is_package_installed "net-mail/courier-imap" "fam" || { package_list="$package_list net-mail/courier-imap"; rc_scripts="$rc_scripts courier-imapd courier-imapd-ssl courier-pop3d courier-pop3d-ssl"; } - is_package_installed "mail-filter/maildrop" || add_maildrop="yes" # Avoid file collision warnings from emerge - is_package_installed "dev-libs/cyrus-sasl" "mysql" || { package_list="$package_list dev-libs/cyrus-sasl"; rc_scripts="$rc_scripts saslauthd"; } useflags_postfix="$useflags_postfix sasl" @@ -281,11 +278,6 @@ function meta_mail() install_packages "$package_list" "Installing mail packages" - if [ -n "$add_maildrop" ] - then - exec_command "COLLISION_IGNORE=\"/usr\" emerge mail-filter/maildrop" "Installing maildrop" - fi - if [ "$installed_postfix" == "yes" ] && [ ! -d '/etc/mail/aliases.db' ] then postmap /etc/mail/aliases 2> /dev/null diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php index 2d31b89bbd63bd459b1721e911e979820bcb0e60..c1a31b4e7df67c328cdf2142e2c1e51a10aacfcf 100644 --- a/install/dist/lib/fedora.lib.php +++ b/install/dist/lib/fedora.lib.php @@ -252,61 +252,6 @@ class installer_dist extends installer_base { $command = 'chmod o= '.$config_dir.'/smtpd.key'; caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/spool/authdaemon'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - - //* Changing maildrop lines in posfix master.cf - if(is_file($config_dir.'/master.cf')){ - copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); - } - if(is_file($config_dir.'/master.cf~')){ - exec('chmod 400 '.$config_dir.'/master.cf~'); - } - $configfile = $config_dir.'/master.cf'; - $content = rf($configfile); - // if postfix package is from fedora or centios main repo - $content = str_replace('# flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}', - ' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - - // If postfix package is from centos plus repo - $content = str_replace('# flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', - ' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - - $content = str_replace(' flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}', - ' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - - - $content = str_replace('#maildrop unix - n n - - pipe', - 'maildrop unix - n n - - pipe', - $content); - - wf($configfile, $content); - - //* Writing the Maildrop mailfilter file - $configfile = 'mailfilter'; - if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)){ - copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); - } - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); - $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); - wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); - - //* Create the directory for the custom mailfilters - $command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Chmod and chown the .mailfilter file - $command = 'chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'chmod -R 600 '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } public function configure_saslauthd() { diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index 342a583facb64e433a8410abf136c570f7e34df2..eff44fe4986430de01a28de0f8ac8c1eb893015d 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -190,36 +190,6 @@ class installer extends installer_base caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - //* We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/lib/courier/authdaemon/'; - if (is_dir('/var/lib/courier/authdaemon')) { - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - } - - //* Changing maildrop lines in posfix master.cf - $configfile = $config_dir.'/master.cf'; - $content = rf($configfile); - - $content = preg_replace('/^#?maildrop/m', 'maildrop', $content); - $content = preg_replace('/^#?(\s+)flags=DRhu user=vmail argv=\/usr\/bin\/maildrop -d/m', - '$1flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail \${extension} \${recipient} \${user} \${nexthop} \${sender}', - $content); - - $this->write_config_file($configfile, $content); - - //* Writing the Maildrop mailfilter file - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/mailfilter.master', 'tpl/mailfilter.master'); - $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); - - $this->write_config_file($cf['vmail_mailbox_base'].'/.mailfilter', $content); - - //* Create the directory for the custom mailfilters - if (!is_dir($cf['vmail_mailbox_base'].'/mailfilters')) - { - $command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - //* postfix-dkim $filename='tag_as_originating.re'; $full_file_name=$config_dir.'/'.$filename; diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index 07dd5cc690f36cb46d6556e1a67cd9dae38c416e..d0c05a9505c300d55342a793cf8b7dd9fb388168 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -260,60 +260,9 @@ class installer_dist extends installer_base { caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/run/authdaemon.courier-imap'; - caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - - //* Check maildrop service in posfix master.cf - $regex = "/^maildrop unix.*pipe flags=DRhu user=vmail argv=\\/usr\\/bin\\/maildrop -d ".$cf['vmail_username']." \\$\{extension} \\$\{recipient} \\$\{user} \\$\{nexthop} \\$\{sender}/"; - $configfile = $config_dir.'/master.cf'; - if($this->get_postfix_service('maildrop', 'unix')) { - exec ("postconf -M maildrop.unix &> /dev/null", $out, $ret); - $change_maildrop_flags = @(preg_match($regex, $out[0]) && $out[0] !='')?false:true; - } else { - $change_maildrop_flags = @(preg_match($regex, $configfile))?false:true; - } - if ($change_maildrop_flags) { - //* Change maildrop service in posfix master.cf - if(is_file($config_dir.'/master.cf')) { - copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); - } - if(is_file($config_dir.'/master.cf~')) { - chmod($config_dir.'/master.cf~', 0400); - } - $configfile = $config_dir.'/master.cf'; - $content = rf($configfile); - $content = str_replace(' flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', - 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - $content = str_replace(' flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}', - 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - } // enable tlsmanager $content = str_replace('#tlsmgr unix - - n 1000? 1 tlsmgr', 'tlsmgr unix - - n 1000? 1 tlsmgr', $content); wf($configfile, $content); - - //* Writing the Maildrop mailfilter file - $configfile = 'mailfilter'; - if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)){ - copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); - } - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/$configfile.master"); - $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); - wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); - - //* Create the directory for the custom mailfilters - $command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - //* Chmod and chown the .mailfilter file - $command = 'chown -R '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'chmod -R 600 '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } public function configure_saslauthd() { diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 4d462e6d485e51a94ce24fddc98f6f2253242d13..efd3bff9b43e4d649882ae2e7a97f3f399fb35c1 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1239,58 +1239,6 @@ class installer_base { $command = 'chmod o= '.$config_dir.'/smtpd.key'; caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); } - - //** We have to change the permissions of the courier authdaemon directory to make it accessible for maildrop. - $command = 'chmod 755 /var/run/courier/authdaemon/'; - if(is_file('/var/run/courier/authdaemon/')) caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED: '.$command, 'Failed to execute the command '.$command); - - //* Check maildrop service in posfix master.cf - $quoted_regex = '^maildrop unix.*pipe flags=DRhu user=vmail '.preg_quote('argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', '/'); - $configfile = $config_dir.'/master.cf'; - if($this->get_postfix_service('maildrop', 'unix')) { - exec ("postconf -M maildrop.unix 2> /dev/null", $out, $ret); - $change_maildrop_flags = @(preg_match("/$quoted_regex/", $out[0]) && $out[0] !='')?false:true; - } else { - $change_maildrop_flags = @(preg_match("/$quoted_regex/", $configfile))?false:true; - } - if ($change_maildrop_flags) { - //* Change maildrop service in posfix master.cf - if(is_file($config_dir.'/master.cf')) { - copy($config_dir.'/master.cf', $config_dir.'/master.cf~'); - } - if(is_file($config_dir.'/master.cf~')) { - chmod($config_dir.'/master.cf~', 0400); - } - $configfile = $config_dir.'/master.cf'; - $content = rf($configfile); - $content = str_replace('flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}', - 'flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bin/maildrop -d '.$cf['vmail_username'].' ${extension} ${recipient} ${user} ${nexthop} ${sender}', - $content); - wf($configfile, $content); - } - - //* Writing the Maildrop mailfilter file - $configfile = 'mailfilter'; - if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)) { - copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vmail_mailbox_base'].'/.'.$configfile.'~'); - } - $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master'); - $content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['vmail_mailbox_base'], $content); - wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content); - - //* Create the directory for the custom mailfilters - if(!is_dir($cf['vmail_mailbox_base'].'/mailfilters')) { - $command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } - - //* Chmod and chown the .mailfilter file - $command = 'chown '.$cf['vmail_username'].':'.$cf['vmail_groupname'].' '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - - $command = 'chmod 600 '.$cf['vmail_mailbox_base'].'/.mailfilter'; - caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); - } public function configure_saslauthd() { diff --git a/install/tpl/debian_postfix.conf.master b/install/tpl/debian_postfix.conf.master index 07128357e4d5441addb8757927e869e6af51be47..99fb522a1eabeaf31f91e8c15aebe5b2f6fc8630 100644 --- a/install/tpl/debian_postfix.conf.master +++ b/install/tpl/debian_postfix.conf.master @@ -32,9 +32,7 @@ smtpd_client_restrictions = check_client_access proxy:mysql:{config_dir}/mysql-v smtpd_etrn_restrictions = permit_mynetworks, reject smtpd_data_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_multi_recipient_bounce, permit smtpd_client_message_rate_limit = 100 -maildrop_destination_concurrency_limit = 1 -maildrop_destination_recipient_limit = 1 -virtual_transport = maildrop +virtual_transport = dovecot header_checks = regexp:{config_dir}/header_checks mime_header_checks = regexp:{config_dir}/mime_header_checks nested_header_checks = regexp:{config_dir}/nested_header_checks diff --git a/install/tpl/fedora_postfix.conf.master b/install/tpl/fedora_postfix.conf.master index a580f6a04268fdb9698e00270e6666399bdbd495..b13415fc56af30c8d94b3e3048b76d8c0b9b7cf6 100644 --- a/install/tpl/fedora_postfix.conf.master +++ b/install/tpl/fedora_postfix.conf.master @@ -28,9 +28,7 @@ smtpd_client_restrictions = check_client_access proxy:mysql:{config_dir}/mysql-v smtpd_etrn_restrictions = permit_mynetworks, reject smtpd_data_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_multi_recipient_bounce, permit smtpd_client_message_rate_limit = 100 -maildrop_destination_concurrency_limit = 1 -maildrop_destination_recipient_limit = 1 -virtual_transport = maildrop +virtual_transport = dovecot header_checks = regexp:{config_dir}/header_checks mime_header_checks = regexp:{config_dir}/mime_header_checks nested_header_checks = regexp:{config_dir}/nested_header_checks diff --git a/install/tpl/gentoo_postfix.conf.master b/install/tpl/gentoo_postfix.conf.master index d0ed3d69f78e749a0d92656e770d6c5a5f43d3ee..8c1be4910b54d77fbe6a10a91ca854fc7fa4c954 100644 --- a/install/tpl/gentoo_postfix.conf.master +++ b/install/tpl/gentoo_postfix.conf.master @@ -27,9 +27,7 @@ smtpd_client_restrictions = check_client_access proxy:mysql:{config_dir}/mysql-v smtpd_etrn_restrictions = permit_mynetworks, reject smtpd_data_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_multi_recipient_bounce, permit smtpd_client_message_rate_limit = 100 -maildrop_destination_concurrency_limit = 1 -maildrop_destination_recipient_limit = 1 -virtual_transport = maildrop +virtual_transport = dovecot header_checks = regexp:{config_dir}/header_checks mime_header_checks = regexp:{config_dir}/mime_header_checks nested_header_checks = regexp:{config_dir}/nested_header_checks diff --git a/install/tpl/opensuse_postfix.conf.master b/install/tpl/opensuse_postfix.conf.master index 9065e9fa037036bade4f9460576e6151d9c39ab4..970314d37e92122711829fa79590dfe1683c759c 100644 --- a/install/tpl/opensuse_postfix.conf.master +++ b/install/tpl/opensuse_postfix.conf.master @@ -30,9 +30,7 @@ smtpd_client_restrictions = check_client_access proxy:mysql:{config_dir}/mysql-v smtpd_etrn_restrictions = permit_mynetworks, reject smtpd_data_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_multi_recipient_bounce, permit smtpd_client_message_rate_limit = 100 -maildrop_destination_concurrency_limit = 1 -maildrop_destination_recipient_limit = 1 -virtual_transport = maildrop +virtual_transport = dovecot header_checks = regexp:{config_dir}/header_checks mime_header_checks = regexp:{config_dir}/mime_header_checks nested_header_checks = regexp:{config_dir}/nested_header_checks diff --git a/interface/lib/plugins/mail_user_filter_plugin.inc.php b/interface/lib/plugins/mail_user_filter_plugin.inc.php index 4f24042b303bca819da67de91ec4ab6c72933b03..e70e58d7eed6fc6263f9d5666aeeec3f851d2bad 100644 --- a/interface/lib/plugins/mail_user_filter_plugin.inc.php +++ b/interface/lib/plugins/mail_user_filter_plugin.inc.php @@ -118,7 +118,7 @@ class mail_user_filter_plugin { /* - private function to create the mail filter rules in maildrop or sieve format. + Private function to create the mail filter rules in sieve format. */ private function mail_user_filter_get_rule($page_form) { diff --git a/server/plugins-available/mail_plugin.inc.php b/server/plugins-available/mail_plugin.inc.php index c584b6821592531b7f6ee3ffa11994bb74097fbb..311df59485bad048de0e9b855a0aee40e86f8773 100644 --- a/server/plugins-available/mail_plugin.inc.php +++ b/server/plugins-available/mail_plugin.inc.php @@ -389,17 +389,6 @@ class mail_plugin { $app->system->exec_safe('mv -f ? ?', $data['old']['maildir'], $data['new']['maildir']); $app->log('Moved Maildir from: '.$data['old']['maildir'].' to '.$data['new']['maildir'], LOGLEVEL_DEBUG); } - //This is to fix the maildrop quota not being rebuilt after the quota is changed. - // Courier Layout - if(is_dir($data['new']['maildir'].'/new') && $mail_config['pop3_imap_daemon'] != 'dovecot') { - if($data['new']['quota'] > 0) { - if(is_dir($data['new']['maildir'])) $app->system->exec_safe("su -c ? ?", "maildirmake -q ".$data['new']['quota']."S ".$data['new']['maildir'], $user); - $app->log('Updated Maildir quota: '."su -c 'maildirmake -q ".$data['new']['quota']."S ".$data['new']['maildir']."' ".$user, LOGLEVEL_DEBUG); - } else { - if(file_exists($data['new']['maildir'].'/maildirsize')) unlink($data['new']['maildir'].'/maildirsize'); - $app->log('Set Maildir quota to unlimited.', LOGLEVEL_DEBUG); - } - } } }