ace of spades
(usa Ubuntu)
Enviado em 30/08/2012 - 13:27h
fiz um script para fazer a instalação
segue....
#muito cuidado com esses.
sudo apt-get install mysql-server-5.1 -y
sudo apt-get install openssl libpam-mysql libpam-smbpass -y
#instala postfix postfix-mysql....
sudo apt-get install postfix postfix-mysql postfix-doc courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin courier-maildrop -y
sudo mysql --user root --password=senha -e "CREATE USER 'mail_admin'@'localhost' IDENTIFIED BY 'mail_admin_password';"
sudo mysqladmin -u root --password=senha create mail
sudo mysql --user root --password=senha -e "GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'mail_admin'@'localhost' IDENTIFIED BY 'mail_admin_password';"
sudo mysql --user root --password=senha -e "GRANT SELECT, INSERT, UPDATE, DELETE ON mail.* TO 'mail_admin'@'localhost.localdomain' IDENTIFIED BY 'mail_admin_password';"
sudo mysql --user root --password=senha -e "FLUSH PRIVILEGES;"
#down files for server
sudo wget
http://10.0.0.102/mailserverfiles2.tar
sudo tar xvf mailserverfiles2.tar
sudo rm -f mailserverfiles2.tar
sudo mysql -u root --password=senha < postfix.sql
sudo rm -f postfix.sql
sudo cp mysql-virtual_domains.cf /etc/postfix/mysql-virtual_domains.cf
sudo cp mysql-virtual_forwardings.cf /etc/postfix/mysql-virtual_forwardings.cf
sudo cp mysql-virtual_mailboxes.cf /etc/postfix/mysql-virtual_mailboxes.cf
sudo cp mysql-virtual_email2email.cf /etc/postfix/mysql-virtual_email2email.cf
sudo cp mysql-virtual_transports.cf /etc/postfix/mysql-virtual_transports.cf
sudo cp mysql-virtual_mailbox_limit_maps.cf /etc/postfix/mysql-virtual_mailbox_limit_maps.cf
sudo rm -f mysql-virtual_domains.cf
sudo rm -f mysql-virtual_forwardings.cf
sudo rm -f mysql-virtual_mailboxes.cf
sudo rm -f mysql-virtual_email2email.cf
sudo rm -f mysql-virtual_transports.cf
sudo rm -f mysql-virtual_mailbox_limit_maps.cf
sudo groupadd -g 5000 vmail
sudo useradd -g vmail -u 5000 vmail -d /home/vmail -m
sudo mkdir /home/vmail/cosmosti.com.br
#sudo mkdir /home/vmail/cosmosti.com.br/maverick
sudo maildirmake /home/vmail/cosmosti.com.br/maverick
sudo chown -R vmail:vmail /home/vmail/cosmosti.com.br
sudo chmod -R 770 /home/vmail/cosmosti.com.br
sudo chmod o= /etc/postfix/mysql-virtual_*.cf
sudo chgrp vmail /etc/postfix/mysql-virtual_*.cf
#
#cd /etc/postfix
sudo openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 365 -x509
sudo chmod o= /etc/postfix/smtpd.key
sudo mkdir -p /var/spool/postfix/var/run/saslauthd
sudo cp saslauthd /etc/default/saslauthd
sudo rm -f saslauthd
sudo cp smtp /etc/pam.d/smtp
sudo rm -f smtp
sudo cp smtpd.conf /etc/postfix/sasl/smtpd.conf
sudo rm -f smtpd.conf
sudo adduser postfix sasl
sudo /etc/init.d/postfix restart
sudo /etc/init.d/saslauthd restart
sudo cp authdaemonrc /etc/courier/authdaemonrc
sudo rm -f authdaemonrc
sudo cp authmysqlrc /etc/courier/authmysqlrc
sudo rm -f authmysqlrc
sudo cp main.cf /etc/postfix/main.cf
sudo rm -f main.cf
sudo mkimapdcert
sudo mkpop3dcert
sudo /etc/init.d/postfix restart
sudo postfix check
sudo /etc/init.d/saslauthd restart
sudo /etc/init.d/courier-authdaemon restart
sudo /etc/init.d/courier-imap restart
sudo /etc/init.d/courier-imap-ssl restart
sudo /etc/init.d/courier-pop restart
sudo /etc/init.d/courier-pop-ssl restart
sudo newaliases
sudo /etc/init.d/postfix restart