Beispiel #1
0
function installmailserver()
{
    global $app, $ehcpinstalldir, $ip, $hostname, $user_email, $user_name, $ehcpmysqlpass, $rootpass, $newrootpass, $ehcpadminpass, $installmode, $unattended;
    echo "starting mail server installation (postfix and related programs)\n\n";
    # If /etc/postfix/main.cf does not exist, it must exist before unattended install will work properly with PostFix
    # See here:
    # http://www.whatastruggle.com/postfix-non-interactive-install
    # Added by Eric Arnol-Martin <*****@*****.**>
    if ($unattended) {
        copyPostFixConfig();
    }
    # Install these packages and answer configuration questions if unattended
    # Then install the rest of the packages
    # Added by Eric Arnol-Martin <*****@*****.**>
    # Place these functions wherever you want in your switch statement... they are currently here for testing
    switch ($installmode) {
        case 'extra':
        case 'normal':
            installRoundCube();
            installPHPMYAdmin();
        case 'light':
            aptget(array('postfix', 'postfix-mysql'), False, True);
            aptget(array('courier-authdaemon', 'courier-authlib-mysql', 'courier-pop', 'courier-pop-ssl', 'courier-imap', 'courier-imap-ssl', 'libsasl2-2', 'libsasl2', 'libsasl2-modules', 'libsasl2-modules-sql', 'sasl2-bin', 'libpam-mysql', 'openssl', 'pop-before-smtp'), False, True);
            # changed libsasl2-2 to libsasl2 **
            break;
        default:
            echo "Unknown installmode parameter at " . __LINE__;
    }
    check_restart_mysql();
    passthru2("cp -rf /usr/share/phpmyadmin /var/www/new");
    # aptitude install postfix postfix-mysql postfix-doc mysql-client courier-authdaemon courier-authmysql courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl phpmyadmin pop-before-smtp
    #remove:  apt-get remove postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon courier-authmysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl phpmyadmin
    bosluk2();
    # all mail configuration should be moved into this function: ehcpdeveloper, to be able to re-configure mail later
    mailconfiguration(array('ehcppass' => $ehcpmysqlpass));
    mailNameFix();
    echo "\n\nfinished mail server,pop3,imap installation \n";
}
Beispiel #2
0
 function fixMailConfiguration()
 {
     # this re-runs function mailconfiguration,configurepamsmtp, configureauthmysql, that is, mail related functions in install_lib.php
     # purpose: in case mail/ehcp configuration is corrupted, or ehcp mysql db pass changed, update system configuration accordingly
     # this function was for mail configuration at start, became whole ehcp configuration later.. included vsftpd, net2ftp... and so on..
     include_once "install_lib.php";
     $this->write_file_if_not_exists('/etc/mailname', 'mail.myserver.com');
     # on some systems, this is deleted somehow.
     if (!file_exists('/etc/postfix/main.cf')) {
         passthru2("cp " . $this->ehcpdir . "/etc/postfix/main.cf.sample /etc/postfix/main.cf");
     }
     # on some systems, this is deleted somehow.
     $params = array('ehcppass' => $this->dbpass);
     $params2 = array_merge($params, array('ehcpinstalldir' => $this->conf['ehcpdir']));
     global $ip, $ehcpmysqlpass, $ehcpinstalldir;
     include 'config.php';
     $ip = $this->miscconfig['dnsip'];
     $ehcpmysqlpass = $dbpass;
     $ehcpinstalldir = $this->conf['ehcpdir'];
     $this->adjust_webmail_dirs();
     mailconfiguration($params);
     passthru2('newaliases');
     vsftpd_configuration($params);
     # reset vsftpd conf too, this is added later than vers 0.29.09
     net2ftp_configuration($params2);
     $this->syncDns();
     $this->syncDomains();
     passthru2("chmod a+w " . $this->ehcpdir . "/webmail/data");
     passthru2("chmod a+w " . $this->ehcpdir . "/net2ftp/temp");
     passthru2("/etc/init.d/vsftpd restart");
     passthru2("/etc/init.d/postfix restart");
     return True;
 }
Beispiel #3
0
 function fixMailConfiguration()
 {
     /*
     Şöyle birşey yapılabilir:
     arayüzden bir komut ile, sunucuda bazı kontroller yapılıp bir rapor hazırlanabilir, bu rapor, gerek soru sorarken, gerekse problemleri teşhis ederken işe yarayabilir. 
     rapor daemon tarafından hazırlanır, hazır olunca da gui'de bir ikaz görünebilir.
     Mesela, /etc/postfix/main.cf içinde "dovecot" geçiyorsa, birşeyler ters gidebilir. 
     /var/spool/postfix/  sahipliği doğru değilse, sıkıntı olabilir gibi.. 
     */
     # this re-runs function mailconfiguration,configurepamsmtp, configureauthmysql, that is, mail related functions in install_lib.php
     # purpose: in case mail/ehcp configuration is corrupted, or ehcp mysql db pass changed, update system configuration accordingly
     # this function was for mail configuration at start, became whole ehcp configuration later.. included vsftpd, net2ftp... and so on..
     include_once "install_lib.php";
     $this->write_file_if_not_exists('/etc/mailname', 'mail.myserver.com');
     # on some systems, this is deleted somehow.
     if (!file_exists('/etc/postfix/main.cf')) {
         passthru2("cp " . $this->ehcpdir . "/etc/postfix/main.cf.sample /etc/postfix/main.cf");
     }
     # on some systems, this is deleted somehow.
     $params = array('ehcppass' => $this->dbpass);
     $params2 = array_merge($params, array('ehcpinstalldir' => $this->conf['ehcpdir']));
     global $ip, $ehcpmysqlpass, $ehcpinstalldir;
     include 'config.php';
     $ip = $this->miscconfig['dnsip'];
     $ehcpmysqlpass = $dbpass;
     $ehcpinstalldir = $this->conf['ehcpdir'];
     $this->adjust_webmail_dirs();
     mailconfiguration($params);
     passthru2('newaliases');
     vsftpd_configuration($params);
     # reset vsftpd conf too, this is added later than vers 0.29.09
     net2ftp_configuration($params2);
     $this->syncDns();
     $this->syncDomains();
     passthru2("chmod a+w " . $this->ehcpdir . "/webmail/data");
     passthru2("chmod a+w " . $this->ehcpdir . "/net2ftp/temp");
     passthru2("/etc/init.d/vsftpd restart");
     passthru2("/etc/init.d/postfix restart");
     return True;
 }