skip to main | skip to sidebar

Smiertx Site

Copyleft (C) 2007 smiertx-bani-ikhyar. This tutorial comes with ABSOLUTELY NO WARRANTY. This is free tutorial, and you are welcome to redistribute it under certain conditions. See the GNU General Public License for more details.

About Me

My Photo
smiertx bani ikhyar ...............
View my complete profile

Facebook Badge

Ikhyar Smiertx Subani

Create Your Badge
HOW-TO SYMBIAN Free e-book Telco
Linux Solaris HP-UX F5 BIG-IP Streaming Misc.
Howto re-install PHP support Oracle Client
Monitoring Dual Master MySQL Replication
Howto Dual Master MySQL Replication
Howto Change datadir MySQL
Howto setting proxy on Linux
Howto RedHat Cluster Manager
Howto Linux GRUB recovery
Howto adjust max. simultaneous connection on apache
Howto MySQL Replication
Howto SSH gateway with iptables
Howto nmap on Linux
Howto setting Qmail on Linux 6
Howto setting Qmail on Linux 5
Howto setting Qmail on Linux 4
Howto setting Qmail on Linux 3
Howto setting Qmail on Linux 2
Howto setting Qmail on Linux 1
Howto install Drupal on Linux
Howto customize Gnome on Linux
Howto install MPlayer and codecs on Linux
Howto compile kernel on Linux
Howto setting IP Bonding on Linux
Howto setting OpenSSH SSH Server on Linux
Howto setting Webalizer on Linux
Howto setting MRTG on Linux
Howto setting Linux as Router
Howto setting Linux as Gateway
Howto setting Camserv on Linux
Howto setting edna on Linux
Howto setting Squid Proxy Server on Linux
Howto setting BIND DNS Server on Linux
Howto setting Apache Web Server on Linux
Howto setting vsftpd FTP Server on Linux
Howto setting DHCP Server on Linux
Howto setting Samba on Linux
Howto setting ILOM
Howto configure boot device order on ILOM
Howto configure network on ILOM
Howto soft partition on Solaris
Howto Hardening system kernel on Solaris
Howto Hardening Network on Solaris
Howto mirror disk on Solaris
Setting ALOM on Solaris
Howto Logadm on Solaris
Howto User Jail on ProFTPd
General Solaris Commands
Show I/O error on Solaris
Setting File Descriptor kernel paramater on Solaris
Setting TCP kernel parameter on Solaris
Howto IPMP on Solaris - link based detection
Howto IPMP on Solaris - probe based detection
Howto Virtual host on ProFTPd
Howto adjust free memory
Default SAR commands on Solaris
Howto netstat on Solaris
Howto vmstat on Solaris
Howto iostat on Solaris
Howto SAR on Solaris
Howto Install Oracle Client on Sparc
Howto Re-Install Oracle Database on Sparc
Howto Install Oracle Database on Sparc
Howto setting ethernet parameter on Solaris
Howto detect ethernet on Solaris
Howto Routing on Solaris
Howto setting IP virtual on Solaris
Howto setting IP address on Solaris
Howto NTP Server On Solaris 2
Howto NTP Server On Solaris 1
Howto NFS Server On Solaris 2
Howto NFS Server On Solaris 1
Differences between trusted and non-trusted systems
Howto cstm on HP-UX
Monitoring LED status on HP Server
Show HP-UX kernel parameter
Show Hardware info on HP Server
Howto Storage Area Network on HP-UX
Howto mirror disk on HP-UX 2
Howto mirror disk on HP-UX 1
Howto mirror root disk on HP-UX
Howto unlocked root/user on HP-UX
Show memory info on HP-UX
Show ethernet card info on HP-UX
Show machine info on HP-UX
Howto Install depot files on HP-UX
Howto setting hostname on HP-UX
Howto setting IP address on HP-UX
Howto Persistence Profile on F5 BIG-IP LTM
Howto Rebooting SCCP F5 BIG-IP LTM 2
Howto Rebooting SCCP F5 BIG-IP LTM 1
Howto resolve failed loading license on F5 BIG-IP LTM
Howto resolve chassis fan reported as bad on F5 BIG-IP LTM
Howto iRule on F5 BIG-IP LTM
Howto tagged & untagged interface on F5 BIG-IP LTM
Howto Activate License on F5 BIG-IP LTM
Howto Live transcoding HTTP/MMS/RTSP streaming 5
Howto Live transcoding HTTP/MMS/RTSP streaming 4
Howto Live transcoding HTTP/MMS/RTSP streaming 3
Howto Live transcoding HTTP/MMS/RTSP streaming 2
Howto Live transcoding HTTP/MMS/RTSP streaming 1
Howto channel redundant on Helix Server
Howto multicast on Switch
Streaming Solution with Helix and F5 BIG-IP LTM
Howto unicast on Helix Server
Howto setting Helix Mobile Producer
Howto setting Helix Server
Howto Pull Spliting and URL aliasing on Helix
Howto physical connection EMC CLAriion, IBM Blade, SAN Switch, Cisco Switch
Howto Initialized EMC Storage CLAriion
-----
Howto setting Cisco Switch 2960 G
-----
SAN Switch Config Commands
SAN Switch Show Commands
-----
Howto prevent SMTP Open Relay
Howto setting SMTP Open Relay 4
Howto setting SMTP Open Relay 3
Howto setting SMTP Open Relay 2
Howto setting SMTP Open Relay 1
Application Games
Advanced Call Manager
Application Manager
CellTrack NetMonitor
FExplorer
Flash SMS
Gmail
IP Dump
LCG Jukebox
n70 Torch
Nimbuzz
Power MP3
Putty Mobile
Real One Mobile
SeleQ
SMS Planner
3D bigfoot racing
4Wheel Xtreme 3D
Age of Empires III
Aiolos Fighter
Airstrike 1944
Asphalt 3 - Street Rules
Asphalt 4 - Elite Racing
Assassin Creed
Batman - The dark knight
Beowulf
Call Of Duty V - World At War
Dark Knight
Death Race
Delta Corps
Die Hard 4
Guitar Hero 3
Harry Potter - Mastering Magic
Harry Potter
High Speed 5 3D
Indiana Jones And The Kingdom Of The Crystal Skull
King Kong
Lords of the Rings - Two Towers
Metal Slug X
Mission Impossible III
NBA Pro Basketball 2009
NFS Most Wanted
Pro Evolution Soccer 2009
Power Rangers - mystic force
Prince of Persia - The Sands of Time
Prince of Persia - The Two Thrones
Prince of Persia - Warrior Within
Rush Hour 3
Sim City Metropolis
Sky Force Reloaded
Splinter Cell Chaos Theory
Street Fighter II champion edition
Wall-E
Zuma
RedHat Linux [based on experience] book
HLR (Home Location Register)
Definition
--------------------
GGSN (Gateway GPRS Support Node)
Definition

Another of me

  • Facebook
  • Linkedin
  • T-SHIRT Shop
  • YouTube

Translate to your Language



Add to Technorati Favorites

 

January 10, 2008

Setting Mail Server with Qmail on Fedora 3 part5


21. Installing Squirrelmail

# tar zxvf squirrelmail-1.4.4.tar.gz

# mv squirrelmail-1.4.4 /var/www/html/webmail

# mkdir /var/sqattachements

# chown -R apache:apache /var/sqattachements

# cd /var/www/html/webmail

# chown -R apache:apache data

# cd config

# ./conf.pl

General
-------
1. Domain : 1.2.3.4 (Enter the IP of your server here. Don't be an idiot and actually use 1.2.3.4)
2. Invert Time : false
3. Sendmail or SMTP : SMTP

IMAP Settings
--------------
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : other
9. Delimiter : detect

SMTP Settings
-------------
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : login
8. Secure SMTP (TLS) : false

try to open in your browser http://www.yourdomain.com/webmail

Username: postmaster@smiert.org

Password: your_password

# cd /var/www/html/webmail/plugins

# tar zxvf change_pass-2.7-1.4.x.tar.gz

# cd /var/www/html/webmail//config

# ./conf.pl

If user can login without typing domain, we can editting file src/redirect.php like this:

/* remove redundant spaces */
$login_username = trim($login_username).'@smiert.org';

The original like this ( before edited):

/* remove redundant spaces */
$login_username = trim($login_username);

22. Installing Clam Antivirus

# cd /downloads/qmailrocks/

# rpm -Uvh clamav-0.87-1.rpm

# rpm -Uvh clamav-devel-0.87-1.rpm

# vi /etc/clamd.conf

"Example" - should already be commented out. However, if it is not, make sure that it is commented out (#)
"LogFile" - should be set to /var/log/clamav/clamd.log
"LogTime" - should be uncommmented.
"LogSyslog" - should be uncommented.
"User" - should be set to qscand
"ScanMail" - should be uncommented.

# useradd -c "Qmail-Scanner Account" -s /bin/false qscand

# /etc/init.d/clamd stop

# /etc/init.d/clamd start

# /usr/bin/freshclam -l /var/log/clamav/clam-update.log

# crontab -e
25 1 * * * /usr/bin/freshclam --quiet -l /var/log/clamav/freshclam.log

23. Installing SpamAssassin

# cd /downloads/qmailrocks/perlmods/rpms/

# rpm -Uvh perl-Mail-SpamAssassin-3.0.2-1.i386.rpm

# cd /downloads/qmailrocks/

# rpm -Uvh spamassassin-3.0.2-1.i386.rpm spamassassin-tools-3.0.2-1.i386.rpm

# rpm -Uvh --nodeps spamassassin-3.0.2-1.i386.rpm spamassassin-tools-3.0.2-1.i386.rpm

# groupadd spamd

# useradd -g spamd -s /home/spamd spamd

# vi /etc/sysconfig/spamassassin

SPAMDOPTIONS="-x -u spamd -H /home/spamd -d"

# vi /etc/mail/spamassassin/local.cf

required_hits 5

# /etc/rc.d/init.d/spamassassin start

# ps aux | grep spamd

spamd 3734 0.2 2.0 24992 20808 ? S 14:21 0:01 /usr/bin/spamd -x -u spamd -H /home/spamd -d

# setup

One in the setup menu, scroll down and select the "system services" option. From the system services menu, scroll down to "clamd". Make sure that there is an asterisk (*) next to clamd, indicating it is set to start on boot. If no asterisk is present, press the spacebar to add it. Repeat the procedure for Spamassasin.

24. Installing QmailScanner with qms-analog

# cd /downloads/qmailrocks

# tar zxvf qmail-scanner-1.25.tgz

# tar zxvf qms-analog-0.4.2.tar.gz

# cd qms-analog-0.4.2

# make all

# cp qmail-scanner-1.25-st-qms-YYYYMMDD.patch /downloads/qmailrocks/qmail-scanner-1.25/

# cd /downloads/qmailrocks/qmail-scanner-1.25

# patch -p1 < qmail-scanner-1.25-st-qms-YYYYMMDD.patch

# cd /downloads/qmailrocks/qmail-scanner-1.25

# vi qms-config

#!/bin/sh

if [ "$1" != "install" ]; then
INSTALL=
else
INSTALL="--install"
fi

./configure --domain smiert.org \
--admin postmaster \
--local-domains "smiert.org" \
--add-dscr-hdrs yes \
--dscr-hdrs-text "X-Antivirus-MYDOMAIN" \
--ignore-eol-check yes \
--sa-quarantine 0 \
--sa-delete 0 \
--sa-reject no \
--sa-subject ":SPAM:" \
--sa-delta 0 \
--sa-alt yes \
--sa-debug no \
--notify admin \
"$INSTALL"

# chmod 755 qms-config

# ./qms-config

# ./qms-config install

# setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z

# setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z

# chown -R qscand:qscand /var/spool/qmailscan

# vi /var/qmail/supervise/qmail-smtpd/run

#!/bin/sh
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" ; export QMAILQUEUE
QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi
if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
fi
exec /usr/local/bin/softlimit -m 40000000 \
/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/var/qmail/bin/qmail-smtpd smiert.org \
/home/vpopmail/bin/vchkpw /usr/bin/true 2>&1

# qmailctl stop

# qmailctl start

# qmailctl stat

# cd /downloads/qmailrocks/qmail-scanner-1.25/contrib

# chmod 755 test_installation.sh

# ./test_installation.sh -doit

25. Installing QmailAnalog w/qlogtools & qms-analog

# cd /downloads/qmailrocks/

# tar zxvf qmailanalog-0.70.tar.gz

# cd qmailanalog-0.70

# patch < /downloads/qmailrocks/patches/0.70-errno.patch

# make && make setup check

# cd /downloads/qmailrocks/

# tar zxvf qlogtools-3.1.tar.gz

# cd qlogtools-3.1

# patch < /downloads/qmailrocks/patches/qlogtools_errno.patch

# mkdir /usr/local/man (if directory already exists, you're good to go)

# make

# ./installer

# cp /downloads/qmailrocks/qms-analog-0.4.2/qmailstats /var/qmail/bin

# vi /var/qmail/bin/qmailstats


#!/bin/sh
## qms-analog and qmailanalog invocation script
##
## Note: For better readability of the nightly stats email, set your email
## client font to a fixed width font - then all the columns line up
## very nicely.
##

PATH=/usr/local/qmailanalog/bin:/var/qmail/bin:/bin:/usr/bin:/usr/local/bin
QMAILSTATS="/tmp/q.$$"
EMAILMSG="/tmp/qms.$$"
umask 077
DATE=`date +'%D'`


## prepare qmail log entries for qmailanalog routines
cat /var/log/qmail/qmail-send/* /var/log/qmail/qmail-pop3d/* /var/log/qmail/qmail-smtpd/* | tai64n2tai | awk '{$1=substr($1,1,index($1,".")+6);print}' | matchup > $QMAILSTATS 5>/dev/null


## build the email message header
echo "To: postmaster@smiert,org" > $EMAILMSG
echo "From: postmaster@smiert.org" >> $EMAILMSG
echo "Subject: Nightly Qmail Stats Report for $DATE" >> $EMAILMSG
echo "" >> $EMAILMSG
echo "" >> $EMAILMSG


## qms-analog invocation
#
# USAGE: qms-analog hours-of-history
#
# hours-of-history (0 - n) hours of history to collect
# 0 => all records
# sort-key (optional) sort key for account statistics
# msgbw (default) msg bandwidth - successful msgs
# alpha alphanumeric by account name
# virus number of viruses received
# saavg Spamassassin avg score
# sadet Spamassassin msgs detected
#
# Examples:
# "qms-analog 24" - use only records within the last 24 hours,
# sort by msg bandwidth
# "qms-analog 168" - use only records within the last 7 days,
# sort by msg bandwidth
# "qms-analog 0" - use all records, sort by msg bandwidth
# "qms-analog 0 alpha" - use all records, sort alphabetically
# "qms-analog 0 saavg" - use all records, sort by Spam average score
#
# Note: Add or remove statistical time frames to suit your preference -
# "last 24 hours" and "all records" are uncommented below by default.
##

#### Last 24 hours
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ L a s t 2 4 H o u r s ~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
cat /var/spool/qmailscan/qms-events.log | qms-analog 24 >> $EMAILMSG
####

#### Last 7 days
#echo "" >> $EMAILMSG
#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ L a s t 7 D a y s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
#cat /var/spool/qmailscan/qms-events.log | qms-analog 168 >> $EMAILMSG
####

#### Last 30 days
#echo "" >> $EMAILMSG
#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
#echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ L a s t 3 0 D a y s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
#cat /var/spool/qmailscan/qms-events.log | qms-analog 5040 >> $EMAILMSG
####

#### All records in qms-events.log
echo "" >> $EMAILMSG
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~ A l l R e c o r d s ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
cat /var/spool/qmailscan/qms-events.log | qms-analog 0 >> $EMAILMSG
####


## qmailanalog invocation
echo "" >> $EMAILMSG
echo "" >> $EMAILMSG
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
zoverall < $QMAILSTATS >> $EMAILMSG
echo "" >> $EMAILMSG
echo "" >> $EMAILMSG
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
zfailures < $QMAILSTATS >> $EMAILMSG
echo "" >> $EMAILMSG
echo "" >> $EMAILMSG
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> $EMAILMSG
zdeferrals < $QMAILSTATS >> $EMAILMSG
echo "" >> $EMAILMSG


## pipe the message into qmail-inject
cat $EMAILMSG | qmail-inject


## delete temp files
rm -f $QMAILSTATS
rm -f $EMAILMSG


# chmod 750 /var/qmail/bin/qmailstats

# /var/qmail/bin/qmailstats

# crontab -e

0 3 * * * /var/qmail/bin/qmailstats 1>/dev/null 2>/dev/null
Newer Post Older Post Home