Search:  
Gentoo Wiki

Email_Service_Installation

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc
This page is a candidate for deletion 
Reason given: Entire article series:
If you disagree with its deletion, please explain why on its discussion page.
If you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
Make sure no other pages link here and check the page's history before deleting.


HOWTO The Home Network for Beginners


Installing MySQL

# emerge mysql
# mysql_install_db
# /etc/init.d/mysql start
# rc-update add mysql default
# mysqladmin -u root password *********

Installing Apache,PHP,mod_php and phpmyadmin

# emerge apache 
# ACCEPT_KEYWORDS="~x86" emerge dev-lang/php 
# emerge phpmyadmin
# nano -w /etc/conf.d/apache2
File: /etc/conf.d/apache2
APACHE2_OPTS="-D PHP5 –D SSL"
# nano -w /etc/apache2/httpd.conf
File: /etc/apache2/httpd.conf
<Directory /var/www/localhost/htdocs>
  Options -Indexes FollowSymLinks MultiViews
  AllowOverride All
  <IfModule mod_access.c>
    Order allow,deny
    Allow from all
  </IfModule>
</Directory>

<Directory /var/www/testsite2.ath.cx/htdocs>
  Options -Indexes FollowSymLinks MultiViews
  AllowOverride All
  <IfModule mod_access.c>
    Order allow,deny
    Allow from all
  </IfModule>
</Directory>
# nano -w /etc/apache2/vhosts.d/00_default_vhost.conf
File: /etc/apache2/vhosts.d/00_default_vhost.conf
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
  ServerName testsite1.ath.cx
  ServerPath /var/www/localhost
  DocumentRoot /var/www/localhost/htdocs
</VirtualHost>

<VirtualHost *:443>
  ServerName testsite1.ath.cx
  ServerPath /var/www/localhost
  DocumentRoot /var/www/localhost/htdocs
</VirtualHost>

<VirtualHost *:80>
  ServerName testsite2.ath.cx
  ServerPath /var/www/testsite2.ath.cx
  DocumentRoot /var/www/testsite2.ath.cx/htdocs
</VirtualHost>

<VirtualHost *:443>
  ServerName testsite2.ath.cx
  ServerPath /var/www/testsite2.ath.cx
  DocumentRoot /var/www/testsite2.ath.cx/htdocs
</VirtualHost>
# mkdir /var/www/testsite2.ath.cx /var/www/testsite2.ath.cx/htdocs
# webapp-config -I -h localhost -d phpmyadmin phpmyadmin  VERSION
# mysql -u root -p < /usr/share/webapps/phpmyadmin/VERSION/sqlscripts/mysql/VERSION_create.sql
# cp /var/www/localhost/htdocs/phpmyadmin/config.default.php /var/www/localhost/htdocs/phpmyadmin/config.inc.php
# nano -w /var/www/localhost/htdocs/phpmyadmin/config.inc.php
File: /var/www/localhost/htdocs/phpmyadmin/config.inc.php
$cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
. $_SERVER['HTTP_HOST']
. (!empty($_SERVER['SERVER_PORT']) ? ':' . $_SERVER['SERVER_PORT'] : '')
. substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')+1);
# /etc/init.d/mysql restart
# /etc/init.d/apache2 start
# rc-update add apache2 default

Installing Qmail

# emerge qmail
# nano -w /var/qmail/control/servercert.cnf
# ebuild /var/db/pkg/mail-mta/qmail-VERSION/qmail-VERSION.ebuild config
# cd /var/qmail/alias
# echo testuser > .qmail-root
# echo testuser > .qmail-postmaster
# echo testuser > .qmail-mailer-daemon
# rc-update add svscan default
# /etc/init.d/svscan start
# cd /service
# ln -s /var/qmail/supervise/qmail-send qmail-send

Installing vpopmail and qmailadmin

# emerge vpopmail
# nano -w /etc/vpopmail.conf 
File: /etc/vpopmail.conf
# Read-only DB
localhost|0|vpopmail|********|vpopmail
# Write DB
localhost|0|vpopmail|********|vpopmail
# mysql -p << EOF
create database vpopmail;
use mysql;
grant select, insert, update, delete, create, drop on vpopmail.* to vpopmail@localhost identified by '********';
flush privileges;
EOF
# chown root:vpopmail /etc/vpopmail.conf
# chmod 640 /etc/vpopmail.conf
# chown root:vpopmail /var/vpopmail/bin/vchkpw
# chmod 4711 /var/vpopmail/bin/vchkpw
# source /etc/profile
# vadddomain testsite.ath.cx ********
# vadddomain testsite2.ath.cx ********
# vadduser testuser@testsite.ath.cx ********
# emerge qmailadmin

Installing Courier IMAP

# emerge courier-imap
# nano -w /etc/courier/authlib/authdaemonrc
File: /etc/courier/authlib/authdaemonrc
authmodulelist="authvchkpw"
# cd /etc/courier-imap
# nano -w imapd.cnf 
# mkimapdcert
# rc-update add courier-imapd-ssl default
# /etc/init.d/courier-imapd-ssl start

Starting SMTP service

# cd /var/qmail/control/
# nano -w conf-smtpd
File: /var/qmail/control/conf-smtpd
QMAIL_SMTP_AUTHHOST=$(<${QMAIL_CONTROLDIR}/me)
[ -z "${QMAIL_SMTP_POST}" ] && QMAIL_SMTP_POST=/bin/true
QMAIL_SMTP_CHECKPASSWORD="/var/vpopmail/bin/vchkpw"
QMAIL_SMTP_POST="${QMAIL_SMTP_AUTHHOST} ${QMAIL_SMTP_CHECKPASSWORD} ${QMAIL_SMTP_POST}"
# cd /service
# ln -s /var/qmail/supervise/qmail-smtpd qmail-smtpd
# /etc/init.d/svscan restart

Installing fetchmail

see fetchmail

Installing spamassassin, clamav and qmail-scanner

# emerge spamassassin clamav qmail-scanner
# nano -w /etc/spamassassin/local.cf
File: /etc/spamassassin/local.cf
rewrite_header Subject *****SPAM*****
report_safe 1
trusted_networks 192.168.132.
required_score 5.0
use_bayes 1
bayes_auto_learn 1
ok_languages            en
ok_locales              en
skip_rbl_checks 1
# rc-update add spamd default
# /etc/init.d/spamd start
# nano /var/qmail/bin/qmail-scanner-queue.pl
File: /var/qmail/bin/qmail-scanner-queue.pl
$spamc_binary = '/usr/bin/spamc'
# nano /etc/conf.d/clamd
File: /etc/conf.d/clamd
START_CLAMD=yes
START_FRESHCLAM=yes
# rc-update add clamd default
# /etc/init.d/clamd start
# nano /var/qmail/bin/qmail-scanner-queue.pl
File: /var/qmail/bin/qmail-scanner-queue.pl
$clamscan_binary = '/usr/bin/clamscan'

Installing bayesian

# ACCEPT_KEYWORDS="~x86" emerge spambayes -av

To be continued...

--Magnetron 19:57, 7 January 2006 (GMT)

Retrieved from "http://www.gentoo-wiki.info/Email_Service_Installation"

Last modified: Sat, 09 Aug 2008 04:50:00 +0000 Hits: 14,307