<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://cooker.wbitt.com/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>WBITT's Cooker! - User contributions [en]</title>
		<link>http://cooker.wbitt.com/index.php/Special:Contributions/WikiChaudhry</link>
		<description>From WBITT's Cooker!</description>
		<language>en</language>
		<generator>MediaWiki 1.15.1</generator>
		<lastBuildDate>Sat, 20 Jun 2026 08:13:29 GMT</lastBuildDate>
		<item>
			<title>Virtualization</title>
			<link>http://cooker.wbitt.com/index.php/Virtualization</link>
			<description>&lt;p&gt;WikiChaudhry:&amp;#32;/* Processor capability identification tips: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A little about the Author: &lt;br /&gt;
&lt;br /&gt;
Muhammad Kamran Azeem&lt;br /&gt;
[ CISSP, RHCE, OCP (DBA) ].&lt;br /&gt;
Working on High Performance Computing Clusters at Saudi Aramco.&lt;br /&gt;
More at [http://wbitt.com, http://wbitt.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; This document is broken into smaller chunks. Virtualization with XEN is here: [[Virtualization-XEN]] &lt;br /&gt;
&lt;br /&gt;
== Why this document ? ==&lt;br /&gt;
I have been planning to create a CBT on Xen, for a long time. (More than a year actually!). The objective of the CBT was to help everyone understand Virtualization, and particularly develop a training material to pass RedHat Virtualization exam (RH184). Later, I though that this will be too limited a scope. So I decided to include KVM with it too. (I actually plan to include Citrix XenServer and VMware ESX/Vspehere too, at a later stage!). Last week, I decided to go ahead with this idea of making the CBT. I thought that explaining all these basics, in the beginning of the CBT, with no real action happening on the screen, would be too boring for the viewers/students. So I thought of making some sort of presentation in the OpenOffice Presenter software. Soon enough I had another problem at my hands. It became difficult for me to add points in a slides. Because each point added in some random slide, would cause a ripple-effect. That is I had to manually cut and move text from one slide to another, then another, and so on. That became too laborious. So I decided to use cooker, which in-fact, I setup earlier for these types of tasks, earlier. And that is my friends, the reason of this document, which you see here! (It is part of training material for the CBT).&lt;br /&gt;
&lt;br /&gt;
== Virtualization ==&lt;br /&gt;
* What is Virtualization?&lt;br /&gt;
* Commonly known  virtualization technologies? &lt;br /&gt;
* Advantages and  Disadvantages of Virtualization?&lt;br /&gt;
* Types of Virtualization (Para / Full, etc)&lt;br /&gt;
* Types of Hyper-visors&lt;br /&gt;
* Technologies we will cover: XEN, KVM&lt;br /&gt;
* Note: Most of the material was obtained from Wikipedia http://en.wikipedia.org/wiki/&lt;br /&gt;
&lt;br /&gt;
== What is Virtualization? ==&lt;br /&gt;
Virtualization is a term that refers to the abstraction of computer resources. In simpler words, the mechanism to run multiple instances/copies of various operating systems inside a base operating system, mainly to utilize under-used resources on the physical host, where base operating system is running.&lt;br /&gt;
&lt;br /&gt;
== History of Virtualization ==&lt;br /&gt;
* The IBM System/360 Model 67 (S/360-67) was a mainframe, and first shipped in July 1966. It included features to facilitate time-sharing applications, notably virtual memory hardware and 32-bit addressing. &lt;br /&gt;
* CP/CMS was the first fully-virtualized virtual machine operating system, running on IBM System/360 Model 67,  and evolved from the ground-breaking research system CP-40.&lt;br /&gt;
* The S/360-67 included various hardware and microcode features that enabled full virtualization of the raw S/360 hardware. The full-virtualization concept was pioneered with CP-40 on custom hardware; its implementation on the S/360-67 made CP-67 possible.&lt;br /&gt;
* It is important to note that full hardware virtualization was not an original design goal for the S/360-67.&lt;br /&gt;
* Thus, in many respects, it can be said, that IBM's CP-67 and CP/CMS products anticipated (and heavily influenced) contemporary virtualization software, such as VMware Workstation, Xen, and Microsoft Virtual PC.&lt;br /&gt;
* The IBM System/370 (S/370) was a model range of IBM mainframes announced on June 30, 1970 as the successors to the System/360 family.&lt;br /&gt;
* Full virtualization was not quite possible with the x86 platform until the 2005-2006 addition of the AMD-V and Intel VT extensions.&lt;br /&gt;
* Many platform virtual machines for the x86 platform came very close, and claimed full virtualization even prior to the AMD-V and Intel VT additions. e.g. Parallels Workstation, VMware Workstation, VMware Server (formerly GSX Server), VirtualBox, etc.&lt;br /&gt;
&lt;br /&gt;
=== VMware ===&lt;br /&gt;
* VMware was founded in 1998 and delivered its first product, VMware Workstation, in 1999.&lt;br /&gt;
* VMware and similar virtualization software for the x86 processor family must employ binary translation techniques to trap and virtualize the execution of certain instructions. These techniques incur some performance overhead as compared to a VM running on a natively virtualizable architecture.&lt;br /&gt;
* VMware is closed source.&lt;br /&gt;
&lt;br /&gt;
=== XEN ===&lt;br /&gt;
* ne&amp;lt;b&amp;gt;X&amp;lt;/b&amp;gt;t g&amp;lt;b&amp;gt;EN&amp;lt;/b&amp;gt;eration virtualization&lt;br /&gt;
* Xen originated as a research project (XenoServer) at the University of Cambridge, led by Ian Pratt, who later founded XenSource, Inc.&lt;br /&gt;
* XenSource supports the development of the open source project and also sells enterprise versions of the software. &lt;br /&gt;
* Details about Xen's design are in the 2003 research paper: [http://www.google.com.pk/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=1&amp;amp;ved=0CAcQFjAA&amp;amp;url=http%3A%2F%2Fwww.cl.cam.ac.uk%2Fresearch%2Fsrg%2Fnetos%2Fpapers%2F2003-xensosp.pdf&amp;amp;rct=j&amp;amp;q=xen+and+the+art+of+virtualization&amp;amp;ei=MBauS6K9O4bctgOusumTDA&amp;amp;usg=AFQjCNFjaK1cyYsVEijrkXuRyIYAs3Wx4Q, Xen and the Art of Virtualization]&lt;br /&gt;
* Xen is open source software. &lt;br /&gt;
* The first public release of Xen occurred in 2003.&lt;br /&gt;
* Citrix Systems acquired XenSource, Inc in October 2007 and subsequently renamed Xensource's products under the Citrix brand.&lt;br /&gt;
* Xen Management Consoles&lt;br /&gt;
** Xen Tools&lt;br /&gt;
** Ganeti&lt;br /&gt;
** Perl-based MLN&lt;br /&gt;
** Web-based HyperVM and FluidVM, Cloudmin&lt;br /&gt;
** GUI applications Convirture (formerly XenMan) and Red Hat's Virtual Machine Manager, virt-manager.&lt;br /&gt;
** Novell's PlateSpin Orchestrate also manages Xen VMs in SUSE Linux Enterprise Server.&lt;br /&gt;
* Xen supported architectures are:&lt;br /&gt;
** 32-bit x86 with PAE support&lt;br /&gt;
** Intel 64/AMD64&lt;br /&gt;
** Intel Itanium 2&lt;br /&gt;
** Xen's Full-Virtualization additionally requires availability of Intel VT-x or AMD-V technology within the processor.&lt;br /&gt;
** Note1: Xen does not support committing more RAM to VMs (in total) than the total physical RAM you have on the physical host. Means you cannot over-commit RAM.&lt;br /&gt;
** Note2: Xen allows/supports committing more CPUs to VMs (in total) than the total physical CPUs you have on the physical host. That will, however have a negative effect on the performance.&lt;br /&gt;
&lt;br /&gt;
=== QEMU ===&lt;br /&gt;
QEMU was presented in USENIX 2005 Annual Technical Conference. QEMU was written by Fabrice Bellard and is free software. Specifically, the QEMU virtual CPU core library is released under the GNU Lesser General Public License (GNU LGPL). Many hardware device emulation sources are released under the BSD license. Here is the link to his paper on QEMU: http://www.usenix.org/publications/library/proceedings/usenix05/tech/freenix/full_papers/bellard/bellard_html/index.html&lt;br /&gt;
&lt;br /&gt;
QEMU is a machine emulator: it can run an unmodified target operating system (such as Windows or Linux) and all its applications in a virtual machine. QEMU itself runs on several host operating systems such as Linux, Windows and Mac OS X. The host and target CPUs can be different.&lt;br /&gt;
&lt;br /&gt;
The primary usage of QEMU is to run one operating system on another, such as Windows on Linux or Linux on Windows. Another usage is debugging because the virtual machine can be easily stopped, and its state can be inspected, saved and restored. Moreover, specific embedded devices can be simulated by adding new machine descriptions and new emulated devices.&lt;br /&gt;
&lt;br /&gt;
QEMU also integrates a Linux specific user mode emulator. It is a subset of the machine emulator which runs Linux processes for one target CPU on another CPU. It is mainly used to test the result of cross compilers or to test the CPU emulator without having to start a complete virtual machine.&lt;br /&gt;
&lt;br /&gt;
QEMU is made of several subsystems:&lt;br /&gt;
&lt;br /&gt;
* CPU emulator (currently x86, PowerPC, ARM and Sparc)&lt;br /&gt;
* Emulated devices (e.g. VGA display, 16450 serial port, PS/2 mouse and keyboard, IDE hard disk, NE2000 network card, ...)&lt;br /&gt;
* Generic devices (e.g. block devices, character devices, network devices) used to connect the emulated devices to the corresponding host devices&lt;br /&gt;
* Machine descriptions (e.g. PC, PowerMac, Sun4m) instantiating the emulated devices&lt;br /&gt;
* Debugger&lt;br /&gt;
* User interface&lt;br /&gt;
&lt;br /&gt;
QEMU will be discussed at a proper time in this document.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QEMU is a generic and open source machine emulator and virtualizer.&lt;br /&gt;
&lt;br /&gt;
When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performances.&lt;br /&gt;
&lt;br /&gt;
When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.&lt;br /&gt;
&lt;br /&gt;
In conjunction with CPU emulation, it also provides a set of device models, allowing it to run a variety of unmodified guest operating systems; it can thus be viewed as a hosted virtual machine monitor. It also provides an accelerated mode for supporting a mixture of binary translation (for kernel code) and native execution (for user code), in the same fashion as VMware Workstation and Microsoft Virtual PC.&lt;br /&gt;
&lt;br /&gt;
One feature exclusive to QEMU is that of portability: the virtual machines can be run on any PC, even those where the user has only limited rights with no administrator access, making the 'PC-on-a-USB-stick' concept very real.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
QEMU has two operating modes:&lt;br /&gt;
&lt;br /&gt;
==== User mode emulation : ====&lt;br /&gt;
QEMU can launch Linux or Darwin/Mac OS X processes compiled for one CPU on another CPU. Target OS system calls are thunked for endianness and 32/64 bit mismatches. WINE Windows API reimplementation and DOSEMU are the main targets for QEMU in user mode emulation. This mode also eases cross-compilation and cross-debugging.&lt;br /&gt;
&lt;br /&gt;
==== Complete Computer System mode emulation ====&lt;br /&gt;
QEMU emulates a full computer system, including a processor and various peripherals. It can be used to provide virtual hosting of several virtual computers on a single computer. QEMU can boot many guest operating systems, including Linux, Solaris, Microsoft Windows, DOS, and BSD ; it supports emulating several hardware platforms, including x86, AMD64, ARM, Alpha, ETRAX CRIS, MIPS, MicroBlaze and SPARC.&lt;br /&gt;
&lt;br /&gt;
=== KVM ===&lt;br /&gt;
* KVM is open source software.&lt;br /&gt;
* KVM ( Kernel-based Virtual Machine) was developed by Qumranet, Inc. &lt;br /&gt;
* On September 4, 2008, Qumranet was acquired by Red Hat, Inc.&lt;br /&gt;
* KVM is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). &lt;br /&gt;
* Using KVM, one can run multiple VMs running unmodified Linux or Windows images. &lt;br /&gt;
* Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc. &lt;br /&gt;
* The kernel component of KVM is included in mainline Linux, as of 2.6.20.&lt;br /&gt;
* KVM management tools: ovirt, Virtual Machine Manager, etc.&lt;br /&gt;
&lt;br /&gt;
=== Parallels ===&lt;br /&gt;
* Parallels uses Intel Core's virtualization technology to allow the virtual machine direct access to the host computer's processor. Much of Parallels' software is based on a lightweight hyper-visor architecture, which provides the guest operating system direct access to the computer's hardware. Each Parallels virtual machine functions like a real computer with its own processor, RAM, floppy, CD drives, hard drive and tools.&lt;br /&gt;
* First released December 8, 2005, Parallels Workstation enables users to create multiple, independent virtual machines on one PC. Workstation consists of a virtual machine suite for Intel x86-compatible computers (running Microsoft Windows or Linux), which allows the simultaneous creation and execution of multiple x86 virtual machines. Workstation supports hardware x86 virtualization technologies such as Intel VT.&lt;br /&gt;
* Parallels Virtuozzo Containers is an operating system-level virtualization product designed for large-scale homegenous server environments and data centers. Parallels Virtuozzo Containers is compatible with x86, x86-64 and IA-64 platforms. Parallels Virtuozzo Containers was first released under Parallels' former parent company SWsoft. The Linux version was released in 2001 while the Windows version was released in 2005.&lt;br /&gt;
* Recently released Parallels Workstation 4.0 Extreme delivers a powerful, next-generation virtualization platform that enables end-users to experience dedicated host graphic and networking resources in a virtualized environment. Consolidate the workflow of several machines on a single, high-performance workstation — without sacrificing performance and flexibility.&lt;br /&gt;
* Parallels Workstation 4.0 Extreme is the first software for workstations to support Intel Virtualization Technology for Direct I/O (Intel VT-d) for full GPU acceleration. Virtualize 3-D modeling, visualization and Hi-Definition (HD) video programs in a Windows and Linux virtual environment at full speeds.&lt;br /&gt;
&lt;br /&gt;
=== OpenVZ ===&lt;br /&gt;
* OpenVZ is an operating system-level virtualization technology based on the Linux kernel and operating system. OpenVZ allows a physical server to run multiple isolated operating system instances, known as containers, Virtual Private Servers (VPSs), or Virtual Environments (VEs). It is similar to FreeBSD Jails and Solaris Zones.&lt;br /&gt;
* As compared to virtual machines such as VMware and paravirtualization technologies like Xen, OpenVZ is limited in that it requires both the host and guest OS to be Linux (although Linux distributions can be different in different containers). However, OpenVZ claims a performance advantage; according to its website, there is only a 1–3% performance penalty for OpenVZ as compared to using a standalone server. One independent performance evaluation confirms this. Another shows more significant performance penalties depending on the metric used.&lt;br /&gt;
* OpenVZ is the basis of Virtuozzo Containers, a proprietary software product provided by Parallels, Inc. OpenVZ is licensed under the GPL version 2 and is supported and sponsored by Parallels whereas the company does not offer commercial end-user support for OpenVZ.&lt;br /&gt;
* OpenVZ is divided into a custom kernel and user-level tools.&lt;br /&gt;
&lt;br /&gt;
=== VirtualBox ===&lt;br /&gt;
* Oracle VM VirtualBox is an x86 virtualization software package, originally created by German software company Innotek, now developed by Oracle Corporation as part of its family of virtualization products. It is installed on an existing host operating system; within this application, additional guest operating systems, each known as a Guest OS, can be loaded and run, each with its own virtual environment.&lt;br /&gt;
* Supported host operating systems include Linux, Mac OS X, OS/2 Warp, Windows XP, Windows Vista, Windows 7 and Solaris; there is also an experimental port to FreeBSD. Supported guest operating systems include a small number of versions of NetBSD and various versions of DragonFlyBSD, FreeBSD, Linux, OpenBSD, OS/2 Warp, Windows, Solaris, Haiku, Syllable, ReactOS and SkyOS.&lt;br /&gt;
* According to a 2007 survey by DesktopLinux.com, VirtualBox was the third most popular software package for running Windows programs on Linux desktops.&lt;br /&gt;
* In January 2007, VirtualBox Open Source Edition (OSE) was released as free software, subject to the requirements of the GNU General Public License (GPL), version 2.&lt;br /&gt;
* Sun Microsystems acquired Innotek, the original developers of VirtualBox, in February 2008.&lt;br /&gt;
* Oracle Corporation acquired Sun in January 2010, at which point the product was re-branded as Oracle VM VirtualBox.&lt;br /&gt;
&lt;br /&gt;
=== Other examples of x86 virtualization software ===&lt;br /&gt;
* Microsoft's Virtual PC, Hyper-V, and Microsoft Virtual Server. &lt;br /&gt;
* Open-source solutions: QEMU, Kernel-based Virtual Machine (KVM) and VirtualBox.&lt;br /&gt;
* Research systems: Denali, L4, and Xen.&lt;br /&gt;
* The following software conditionally makes use of the support offered by AMD-V and/or Intel VT:&lt;br /&gt;
** KVM, VirtualBox, Xen, VMware ESX Server (also known as vSphere). Microsoft Hyper-V,  Microsoft Virtual Server (also branded as Microsoft Virtual PC or Windows Virtual PC), Oracle VM (uses Xen). Parallels Workstation,  Parallels Server, Sun xVM, Virtual Iron, VMware Workstation, VMware Fusion, VMware Server.&lt;br /&gt;
&lt;br /&gt;
== Virtualization terminology ==&lt;br /&gt;
* Virtualization: Virtualization is a term that refers to the abstraction of computer resources. In simpler words, the mechanism to run multiple instances/copies of various operating systems inside a base operating system, mainly to utilize under-used resources on the physical host, where base operating system is running. &lt;br /&gt;
* Hyper-Visor or Virtual Machine Monitor (VMM) : It is the software which manages and supports the virtualization environment. It runs the virtual machines and isolates them from real hardware. There are three types of Hyper-Visors.&lt;br /&gt;
** Type 1 Hyper-visor: A hyper-visor running on bare metal hardware, e.g. Linux KVM, IBM z/VM, VMware ESX, etc&lt;br /&gt;
** Type 2 Hyper-visor: Virtualization software that runs on the host OS. e.g. VMware workstation, VMware server (formerly known as GSX server), Parallels Desktop, Microsoft Virtual Server, etc.&lt;br /&gt;
** Hybrid Hyper-visor: Runs directly on bare metal like Type 1, but depends heavily on drivers and support from one of its (privileged) virtual machines to function properly. e.g. Xen. Dom-0 is the special VM, which is needed by kernel-xen.&lt;br /&gt;
&lt;br /&gt;
* Emulator: Emulator is a software which emulates all pieces of hardware for it's VM. e.g. VMware, Qemu, etc.&lt;br /&gt;
&lt;br /&gt;
* Shared Kernel: Used in chrooted / jailed virtual environments. All machines share the same kernel, and most of the libraries. Only some parts of the OS are (so called) &amp;quot;virtualized&amp;quot;, or made available to the VM through separate directories.&lt;br /&gt;
&lt;br /&gt;
* Domain: Any virtual machine running on hyper-visor.&lt;br /&gt;
&lt;br /&gt;
* Domain-0 / Privileged Domain: A virtual machine having privileged access to the hyper-visor. It manages the hypervisor and the other VMs. This domain is always started first by the hyper-visor, on system boot. Also referred to as Management Domain or Management Console. Dom-0 can be used in &amp;quot;Thick&amp;quot; or &amp;quot;Thin&amp;quot; model. Thick model means that a lot of software is present to assist virtual machine management. Such as laptops, desktops, etc, used for development and testing. Thin model means that Dom-0 is kept as thin as possible by providing just the bare minimum software components to the hyper-visor to run the virtual machines properly. This results in lesser resource utilization by the Dom-0, and providing more resources to the guest domains. Used in production environments, on production servers, etc.&lt;br /&gt;
&lt;br /&gt;
* Domain-U / Guest Domains / User Domains: VM created by Dom-0. Sometimes simply known as Guest, or Dom-U.&lt;br /&gt;
&lt;br /&gt;
* PAE: Physical Address Extension, is a feature first implemented in the Intel Pentium Pro to allow x86 processors to access more than 4 gigabytes of random access memory if the operating system supports it. It was extended by AMD to add a level to the page table hierarchy, to allow it to handle up to 52-bit physical addresses, add NX bit functionality, and make it the mandatory memory paging model in long mode. &lt;br /&gt;
** PAE is provided by Intel Pentium Pro (and above) CPUs - including all later Pentium-series processors except the 400 MHz bus versions of the Pentium M, as well as by other processors such as the AMD Athlon and later AMD processor models with similar or more advanced versions of the same architecture.&lt;br /&gt;
** Required to be present on 32-bit x86 CPU, if para-virtualization is to be used. (This means that you can most certainly use Xen for-para-virtualization on almost any hardware lying around in your office / home.)&lt;br /&gt;
&lt;br /&gt;
* Intel VT-x (sometimes Intel VT)&lt;br /&gt;
** Intel VT-x (Virtualization Technology) is the Intel's hardware assistance for processors running virtualization platforms.&lt;br /&gt;
** Intel VT includes a series of extensions for hardware virtualization. The Intel VT-x extensions, adds migration, priority and memory handling capabilities to a wide range of Intel processors. By comparison, the VT-d extensions add virtualization support to Intel chipsets that can assign specific I/O devices to specific virtual machines (VM)s, while the VT-c extensions bring better virtualization support to I/O devices such as network switches.&lt;br /&gt;
&lt;br /&gt;
* AMD-V&lt;br /&gt;
** AMD-V (AMD Virtualization) is a set of hardware extensions for the x86 processor architecture. AMD designed the extensions to perform repetitive tasks normally performed by software and improve resource use and virtual machine (VM) performance.&lt;br /&gt;
** AMD-V technology was first announced in 2004 and added to AMD's Pacifica 64-bit x86 processor designs. &lt;br /&gt;
** By 2006, AMD's Athlon 64 X2 and Athlon 64 FX processors appeared with AMD-V technology, and today, the technology is available on Turion 64 X2, second- and third-generation Opteron, Phenom and Phenom II processors. &lt;br /&gt;
&lt;br /&gt;
=== Processor capability identification tips: ===&lt;br /&gt;
On linux, you can check the /proc/cpuinfo file and see if the flags line has &amp;quot;vmx&amp;quot; (for Intel) or svm (for AMD) in it. If the following line results in some text, then your CPU (irrespective of being Intel or AMD), has Hardware-Assisted Full Virtualization support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
egrep ‘(vmx|svm)’ /proc/cpuinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the command above, does not return any results, or just returns to the command prompt silently, then your processor does not support Hardware-Assisted Full Virtualization. However, it should be noted that sometimes, this feature is turned off in the BIOS. Therefore you should check your BIOS settings first, to verify that.&lt;br /&gt;
&lt;br /&gt;
* svm = secure virtual machine (AMD)&lt;br /&gt;
* vmx = virtual machine extensions (Intel) &lt;br /&gt;
&lt;br /&gt;
Also, if your CPU is an older model, and does not have Intel VT-x or AMD-V technologies, all hope is not lost. Check if your CPU provides PAE feature. If that is there, you can still use/create Para-Virtual virtual machines on this machine, using Xen. You can also use the emulation based full virtualization products such as Qemu, Bochs, Virtual Box, VMware workstation, etc. Here is how you can check for PAE for your CPU in Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grep pae /proc/cpuinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional tip to check if your processor is 64 bit or not is to check for a flag &amp;quot;lm&amp;quot; (meaning &amp;quot;long mode&amp;quot;) in the cpu flags. If the command below returns some text, you have a 64 bit processor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
grep -w lm /proc/cpuinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, just for convenience, another tip being placed here is, how to know if you are running a 32 bit Linux OS or a 64 bit Linux OS? This is important to know because sometimes, someone has physical machine with 64 bit processor, but out of ignorance, or need, he installed a 32 bit Linux OS on it. In such a case, he cannot use the full power/features of the CPU with the installed 32 bit OS. If you see x86_64 in the command output of &amp;quot;uname -a&amp;quot;, (just before the words GNU/Linux), you are running 64-bit version of Linux. Seeing i386, or i686 in the output, would mean that you are running a 32-bit Linux OS. The &amp;quot;lm&amp;quot; mode described above tells you if your processor itself is 64-bit capable or not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[kamran@test ~]$ uname -a&lt;br /&gt;
Linux lnxlan215 2.6.30.8-64.fc11.x86_64 #1 SMP Fri Sep 25 04:43:32 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;
[kamran@test ~]$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* PVM: Para-Virtual Machine .  A virtual machine created using Xen's para-virtualization technology.&lt;br /&gt;
* HVM: Hardware-assisted Virtual Machine. A virtual machine created using Xen's or KMV's hardware-assisted full virtualization technology, on a physical host which supports Intel VT-x/AMD-V extensions in the processor.&lt;br /&gt;
&lt;br /&gt;
== Why use Virtualization? ==&lt;br /&gt;
* Consolidation &lt;br /&gt;
** Power, Rack/Desk/Floor Space, Hardware, HVAC, Wiring/cabling, etc.&lt;br /&gt;
&lt;br /&gt;
* Efficient utilization of under-utilized resources&lt;br /&gt;
** CPU / memory, disks, bandwidth, etc.&lt;br /&gt;
&lt;br /&gt;
* Support for applications only supporting older versions of some OS.&lt;br /&gt;
&lt;br /&gt;
* Service / domain / role based compartmentalization&lt;br /&gt;
** e.g. mail server and web server on separate VMs.&lt;br /&gt;
&lt;br /&gt;
* Fail-over and Load Balancing features.&lt;br /&gt;
&lt;br /&gt;
* Development and Testing &lt;br /&gt;
** Developers can test code on test servers.&lt;br /&gt;
** Easy roll-backs. &lt;br /&gt;
** Replica of production server can be created as a VM, so patches, etc can be tested.&lt;br /&gt;
** Programs/Applications targeted to run on different OS / platforms can be tested. e.g a web application in need to be tested on firefox running on Linux and on Windows.&lt;br /&gt;
** Virus testing, Spam testing, password cracking, sniffing, DOS, etc can all be tested safely.&lt;br /&gt;
&lt;br /&gt;
* Training&lt;br /&gt;
** Virtual labs can be setup with less resources&lt;br /&gt;
** Security training can be delivered without concerns of busting out in the production network.&lt;br /&gt;
** Each student can have his own (virtual) lab in his own PC/Laptop, in addition to the lab provided by the instructor.&lt;br /&gt;
&lt;br /&gt;
* Virtual Appliances&lt;br /&gt;
** Appliances, such a a hardened mail server, can be created, which simply would need to be started as a VM in your host OS, etc. Same can be done to create fully functional web hosting servers. (I have deployed few web hosting servers, using this method! )&lt;br /&gt;
** Ease of machine migration in case of hardware failure. (e.g. No need to re-install / reconfigure your favourite mail server from scratch!)&lt;br /&gt;
&lt;br /&gt;
* Legacy application support&lt;br /&gt;
** Legacy applications / programs , which do not support latest hardware or OS, etc, can be made to run on the OS they support, in a virtualized environment.&lt;br /&gt;
** Such applications benefit from the newer hardware, such as speed , and thus run faster. &lt;br /&gt;
** And someone said, less screw-drivers!&lt;br /&gt;
&lt;br /&gt;
== Why “not” Virtualization? ==&lt;br /&gt;
* Administration of VMs, when more than a few, is more complicated, and sensitive than more than a few physical servers. The different VM interfaces, such as VMware's  Virtual Infrastructure Center, and KVM's ovirt,  try to address this. &lt;br /&gt;
* For live migrations involving movement of a VM from one physical host to another, involves extra IPs, etc. Plus the shared storage, sometimes cluster file systems, etc.&lt;br /&gt;
* Various networking problems arise, such as firewalls, routing, switching, bridging etc.&lt;br /&gt;
* Some service providers (such as ServerBeach), does not support “bridged connections” from the rented server. This adds extra complexity in managing the physical host's firewall, routing tables, etc.&lt;br /&gt;
* Hardware needs to be more fault-tolerant, and relatively powerful, compared to single server/service requirements. &lt;br /&gt;
* Console access, block device access, recovery, system trouble-shooting, etc, are complex areas to handle.&lt;br /&gt;
&lt;br /&gt;
== Virtualization Technologies ==&lt;br /&gt;
===Emulation-based Full Virtualization ===&lt;br /&gt;
** Slower than hardware-based full virtualization.&lt;br /&gt;
** Hyper-visor simulates the virtual machine in software, by analyzing all instructions and converting each one appropriately before it gets to the CPU.&lt;br /&gt;
** Dynamic translation is a technique used to improve performance. Which is, the hypervisor analyses the binary instructions just before they are run, allowing safe instructions to run unmodified, but converting sensitive instructions just before they execute. The converted code is also cached in memory, to speed up future (sensitive) instructions coming in for execution.&lt;br /&gt;
** Dynamic recompilation optimizes frequently reused sequences on the fly.&lt;br /&gt;
** Full vitualization with Dynamic Recompilation is the basic technique used by VMware, for it's initial / basic products, VMware Workstation, VMware Server , etc.&lt;br /&gt;
** Full emulation can also be used to simulate non-standard processor architectures, needed by different OS / applications, by converting all instructions.&lt;br /&gt;
** This method of simulating/emulating results in very slow VMs. &lt;br /&gt;
** QEMU, Bochs are example of non-native / non-standard processor emulators for/on Linux.&lt;br /&gt;
&lt;br /&gt;
=== Native / Hardware-based / Hardware-assisted Full Virtualization ===&lt;br /&gt;
** Requires CPU based hardware acceleration. (Intel VT-x, AMD-V)&lt;br /&gt;
** Bare-metal look and feel. Access to HW is controlled through hyper-visor.&lt;br /&gt;
** Almost all code coming in from VM is run directly by the CPU of the physical host, without any changes, for efficiency.&lt;br /&gt;
** The hyper-visor only steps in when the code coming in from the VM uses sensitive instructions, that would interfere with the state of the hyper-visor itself, or the environment it is supported by.&lt;br /&gt;
** Such sensitive instructions must be intercepted by the hyper-visor and translated/replaced with safe equivalents before they are actually executed on the CPU of the physical host.&lt;br /&gt;
** To do this, all sensitive instructions in the CPU's Instruction Set Architecture (ISA), must be defined as privileged.&lt;br /&gt;
** Traditional x86 architecture's instruction set has about 17 instructions which are sensitive, but they are not defined as privileged, which are unable to trap such instructions coming from VM. The latest Intel Itanium-2 has three instructions which are sensitive, but are still not defined as privileged.&lt;br /&gt;
** Intel VT-x and AMD-V technologies were developed to overcome this problem on modern 32-bit and 64 bit x86 processors. &lt;br /&gt;
** In Linux, Xen hyper-visor &amp;quot;can use&amp;quot; these new CPU features. Whereas, KVM &amp;quot;needs/requires&amp;quot; these features in the CPU, for it (KVM hyper-visor) to work.&lt;br /&gt;
** Examples are: KVM, VMware ESX&lt;br /&gt;
** Un-modified Guest OS can be used as VM. e.g. Windows.&lt;br /&gt;
&lt;br /&gt;
=== Para Virtualization / Cooperative Virtualization===&lt;br /&gt;
** Works without the newly available CPU based hardware acceleration technologies, such as Intel VT-x and AMD-V. &lt;br /&gt;
** e.g. Xen. &lt;br /&gt;
** The &amp;quot;hyper-visor aware&amp;quot; code is integrated into the kernel of the operating systems running on the virtual machines. This results in a &amp;quot;modified kernel&amp;quot;, commonly known as &amp;quot;kernel-xen&amp;quot; instead of simply &amp;quot;kernel&amp;quot;. That is why you will see &amp;quot;kernel-xen-x.y&amp;quot; booting up when you power up your virtual machine OS. The base OS / Domain-0 already runs under kernel-xen. Generally, no other changes are required on the rest of the software on the virtual machines. Xen is the actual hyper-visor, which runs directly on the CPU of the physical host, with &amp;quot;full speed&amp;quot;. In other words, the (modified) kernel of each virtual machine's OS actually runs on the hyper-visor, assuming the hyper-visor to be CPU itself. This happens to all the VMs. This eliminates the need to have a separate trapping / translation mechanism to be present in the hyper-visor. &lt;br /&gt;
** The above description implies that only modified Guest OS can be used as VM, which understand the hyper-visor. That means windows and family products cannot be run in Para-Virtualization environment. (One of the excellent books on Xen: &amp;quot;The book of Xen&amp;quot;, mentions that, though Xen team did port Windows to Xen during the development process, no &amp;quot;released&amp;quot; version of Windoes can run under Xen in para-virtualized mode.)&lt;br /&gt;
** This also means that all versions / derivatives of Linux, which have &amp;quot;kernel-xen&amp;quot; included in their package list can be used as Dom-U / Guests.&lt;br /&gt;
** Only the hyper-visor has privileged access to the CPU, and is designed to be as small and limited as possible.&lt;br /&gt;
** The Xen hyper-visor interacts with the OS running under it's control, using very few well-defined interfaces, called hyper-calls. Xen has about 50 hyper-calls compared to about 300 for Linux! &lt;br /&gt;
** Hyper-calls are &amp;quot;asynchronous&amp;quot;,so that the hyper-calls themselves don't block other processes or other OSes.&lt;br /&gt;
** The Xen paper, mentioned earlier (Xen and the art of virtualization), indicates performance degradation of less than 2 percent for standard work-load scenarios. And a degradation of between 10 and 20 percent for worst case scenarios! &lt;br /&gt;
** The base OS, which actually installs Xen hyper-visor on the physical host, is also referred to as &amp;quot;Privileged Domain&amp;quot; or &amp;quot;Domain-0&amp;quot; or &amp;quot;Dom-0&amp;quot;. This privileged domain is in-turn used to manage the hypervisor. This privileged domain manages all other virtual machines created under Xen hyper-visor. These other virtual machines are referred to as &amp;quot;Guest Domains&amp;quot; or &amp;quot;User Domains&amp;quot; or &amp;quot;Dom-U&amp;quot;. That means the OS of the privileged domain, also runs as a VM, under Xen hyper-visor, just like other virtual machines on the same physical host, &amp;quot;but&amp;quot;,  &amp;quot;with more privileges&amp;quot;. Dom-0 has direct access to the hardware resources of the physical host.&lt;br /&gt;
** Para-Virtualization never allows emulation. That means that any guest OS will see the same processor, as seen by the Dom-0 / physical host / base-OS.&lt;br /&gt;
** Para-Virtualization should always be the selected, because of speed and performance, if there is a choice.&lt;br /&gt;
&lt;br /&gt;
** Advantages are :&lt;br /&gt;
*** Works on older hardware, or on the hardware which does not have hardware-assisted full virtualization.&lt;br /&gt;
*** Works much faster than Emulated or Hardware based virtualization technologies. Sometimes outperforming the actual bare metal performance!&lt;br /&gt;
** Performance can further be enhanced by presenting virtual block devices to the virtual machines, instead of real block devices. This means that special para-virtualized drivers need to be present in the OS running on the VM. The co-operation between the kernel and the hyper-visor can allow para-virtualized drivers to have much lower overhead than native drivers.&lt;br /&gt;
&lt;br /&gt;
===OS Virtualization===&lt;br /&gt;
** OS Chroot environments.&lt;br /&gt;
** OpenVZ, Solaris Containers, FreeBSD jails, etc.&lt;br /&gt;
** Shared kernel is the single point of failure. &lt;br /&gt;
&lt;br /&gt;
=== Application Virtualization ===&lt;br /&gt;
** Application creates a sandbox environment in browser, etc. e.g. JRE . &lt;br /&gt;
&lt;br /&gt;
=== API-level Virtualization===&lt;br /&gt;
** Virtualization provided to support single application. &lt;br /&gt;
** e.g. WINE is used to run Windows programs in Linux environment.&lt;br /&gt;
==[[Virtualization-XEN]] (Moved to separate page of it's own)==&lt;/div&gt;</description>
			<pubDate>Mon, 22 Nov 2010 05:36:53 GMT</pubDate>			<dc:creator>WikiChaudhry</dc:creator>			<comments>http://cooker.wbitt.com/index.php/Talk:Virtualization</comments>		</item>
		<item>
			<title>File:Datacenter-in-a-box-blade-design-2.png</title>
			<link>http://cooker.wbitt.com/index.php/File:Datacenter-in-a-box-blade-design-2.png</link>
			<description>&lt;p&gt;WikiChaudhry:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</description>
			<pubDate>Tue, 15 Jun 2010 18:46:43 GMT</pubDate>			<dc:creator>WikiChaudhry</dc:creator>			<comments>http://cooker.wbitt.com/index.php/File_talk:Datacenter-in-a-box-blade-design-2.png</comments>		</item>
		<item>
			<title>Qmail</title>
			<link>http://cooker.wbitt.com/index.php/Qmail</link>
			<description>&lt;p&gt;WikiChaudhry:&amp;#32;/* = The qmailctl script: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Title: Qmail-Using John Simpson method&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Created: 08/07/2009&lt;br /&gt;
&lt;br /&gt;
Last Modified: 08/21/2009 &lt;br /&gt;
&lt;br /&gt;
Note: This is a highly volatile document at the moment. It is a research/development work, with VERY SHARP EDGES, and you should not use it in your production servers UNLESS you know what you are doing. With that said, the details are being used on at least two production internet mail server, which I know. :)&lt;br /&gt;
&lt;br /&gt;
Important sites:-&lt;br /&gt;
&lt;br /&gt;
* Life with Qmail [LWQ] : lifewithqmail.org&lt;br /&gt;
* John Simpson's Qmail website [JMS] : http://qmail.jms1.net/&lt;br /&gt;
* Qmail Rocks website [QMR]: qmailrocks.org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of this installation is to install qmail the way DJB intended, but bring along those, who are used to installing QMR only. That is the method followed in LifeWithQmail. QMR has made a mix of many of these and other qmail installations and created QMR. John Simpson and others have some serious objections on the way QMR is setup. My objective in this document is to provide an easy to follow approach (as easy as QMR), yet confirming to the suggestions and standards of JMS and LWQ and others.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Basic Information ===&lt;br /&gt;
* OS: CENTOS 5.3 32 bit on a KVM virtual machine&lt;br /&gt;
* Hostname: qmail.example.com &lt;br /&gt;
* IP: 192.168.122.90&lt;br /&gt;
&lt;br /&gt;
=== Step: Preparations ===&lt;br /&gt;
* Disable SELINUX&lt;br /&gt;
* Disable Default Firewall&lt;br /&gt;
&lt;br /&gt;
Install nmap and disable unnecessary services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
yum -y install nmap&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# for i in avahi-daemon autofs cups exim sendmail gpm ip6tables iptables lvm2-monitor mdmonitor netfs nfslock pcscd portmap restorecond rpcgssd rpcidmapd xfs yum-updatesd ; do chkconfig --level 35 $i off; service $i stop ; done&lt;br /&gt;
&lt;br /&gt;
Shutting down Avahi daemon:                                [  OK  ]&lt;br /&gt;
Stopping automount:                                        [  OK  ]&lt;br /&gt;
Stopping cups:                                             [  OK  ]&lt;br /&gt;
Shutting down exim:                                        [  OK  ]&lt;br /&gt;
error reading information on service sendmail: No such file or directory&lt;br /&gt;
sendmail: unrecognized service&lt;br /&gt;
Shutting down console mouse services:                      [  OK  ]&lt;br /&gt;
Not stopping monitoring, this is a dangerous operation. Please use force-stop to override.&lt;br /&gt;
Stopping NFS statd:                                        [  OK  ]&lt;br /&gt;
Stopping PC/SC smart card daemon (pcscd):                  [  OK  ]&lt;br /&gt;
Stopping portmap:                                          [  OK  ]&lt;br /&gt;
Stopping RPC idmapd:                                       [  OK  ]&lt;br /&gt;
Shutting down xfs:                                         [  OK  ]&lt;br /&gt;
Stopping yum-updatesd:                                     [  OK  ]&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the open ports:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# nmap localhost&lt;br /&gt;
... &lt;br /&gt;
Not shown: 1679 closed ports&lt;br /&gt;
PORT   STATE SERVICE&lt;br /&gt;
22/tcp open  ssh&lt;br /&gt;
&lt;br /&gt;
Nmap finished: 1 IP address (1 host up) scanned in 0.091 seconds&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step: Local CENTOS repository (Optional) ===&lt;br /&gt;
Setup the local CentOS repository on the server and update the Yum repository configuration on qmail server. This step is not necessary on servers, which have direct high speed connection to the internet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# vi /etc/yum.repos.d/CentOS-Local.repo&lt;br /&gt;
&lt;br /&gt;
# CentOS-Local.repo&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
[local]&lt;br /&gt;
name=CentOS-$releasever - Local&lt;br /&gt;
baseurl=http://192.168.122.1/centos53-32/&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step: Kernel update ===&lt;br /&gt;
It is also right time to update your kernel.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Current:&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# uname -r&lt;br /&gt;
2.6.18-128.el5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# yum list | grep kernel&lt;br /&gt;
kernel.i686                              2.6.18-128.el5                installed&lt;br /&gt;
kernel-devel.i686                        2.6.18-128.el5                installed&lt;br /&gt;
kernel-headers.i386                      2.6.18-128.el5                installed&lt;br /&gt;
kernel.i686                              2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-PAE.i686                          2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-PAE-devel.i686                    2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-debug.i686                        2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-debug-devel.i686                  2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-devel.i686                        2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-doc.noarch                        2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-headers.i386                      2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-xen.i686                          2.6.18-128.4.1.el5            updates&lt;br /&gt;
kernel-xen-devel.i686                    2.6.18-128.4.1.el5            updates&lt;br /&gt;
yum-kernel-module.noarch                 1.1.16-13.el5.centos          base&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# yum -y update kernel kernel-devel kernel-headers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# cat /etc/grub.conf&lt;br /&gt;
default=0&lt;br /&gt;
timeout=5&lt;br /&gt;
title CentOS (2.6.18-128.4.1.el5)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.6.18-128.4.1.el5 ro root=LABEL=/&lt;br /&gt;
        initrd /boot/initrd-2.6.18-128.4.1.el5.img&lt;br /&gt;
title CentOS (2.6.18-128.el5)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.6.18-128.el5 ro root=LABEL=/&lt;br /&gt;
        initrd /boot/initrd-2.6.18-128.el5.img&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
System reboot needed after kernel update.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step [optional]: SSH key based authentication ===&lt;br /&gt;
[Details]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step: Required software components, including basic PERL modules ===&lt;br /&gt;
&lt;br /&gt;
# httpd, httpd-devel, apr&lt;br /&gt;
# php, php-imap, php-mysql, php-gd, php-pear, php-zlib, php-mbstring, php-xml,&lt;br /&gt;
# perl, perl-libwww-perl, perl-Digest-SHA1, perl-Digest-HMAC, perl-Net-DNS, perl-HTML-Tagset, perl-HTML-Parser&lt;br /&gt;
perl-Time-HiRes, perl-TimeDate, perl-suidperl, perl-DateManip&lt;br /&gt;
# gcc, gcc-c++, libtool-ltdl, libtool-ltdl-devel&lt;br /&gt;
# mysql-server, mysql-devel, postgresql-devel&lt;br /&gt;
# openssl, openssl-devel, openldap-servers&lt;br /&gt;
# wget&lt;br /&gt;
# patch, patchutils&lt;br /&gt;
# pcre-devel&lt;br /&gt;
# gdbm-devel&lt;br /&gt;
# db4, db4-devel&lt;br /&gt;
# fam fam-devel gamin-devel&lt;br /&gt;
# net-snmp + net-snmp-utils + net-snmp-libs&lt;br /&gt;
# mrtg&lt;br /&gt;
# spamassassin, expect, zlib-devel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
yum -y install net-snmp net-snmp-utils net-snmp-libs mrtg \&lt;br /&gt;
httpd httpd-devel php php-imap php-mysql php-gd php-pear php-zlib php-mbstring php-xml \&lt;br /&gt;
gcc gcc-c++ gdbm-devel pcre-devel libtool-ltdl libtool-ltdl-devel \&lt;br /&gt;
mysql-server mysql-devel db4 db4-devel postgresql-devel \&lt;br /&gt;
openssl openssl-devel openldap-servers \&lt;br /&gt;
perl perl-libwww-perl perl-Digest-SHA1 perl-Digest-HMAC perl-Net-DNS perl-HTML-Tagset perl-HTML-Parser perl-Time-HiRes perl-TimeDate perl-suidperl perl-DateManip \&lt;br /&gt;
spamassassin expect zlib-devel \&lt;br /&gt;
fam fam-devel gamin-devel patch patchutils&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Basic PERL modules required are as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Digest::SHA1&lt;br /&gt;
Digest::HMAC&lt;br /&gt;
Net::DNS&lt;br /&gt;
Time::HiRes&lt;br /&gt;
HTML::Tagset&lt;br /&gt;
HTML::Parser&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the yum install command above, you can see that all of these listed PERL modules are installed. However, Time::HiRes will not be installed. It needs to be installed manually. You can use the following command to install it through perl -MCPAN option:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Time::HiRes&amp;quot; &lt;br /&gt;
... &lt;br /&gt;
All tests successful.&lt;br /&gt;
Files=1, Tests=40, 25 wallclock secs (11.49 cusr +  1.32 csys = 12.81 CPU)&lt;br /&gt;
  /usr/bin/make test -- OK&lt;br /&gt;
Running make install&lt;br /&gt;
Installing /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Time/HiRes/HiRes.so&lt;br /&gt;
Installing /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Time/HiRes/HiRes.bs&lt;br /&gt;
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree&lt;br /&gt;
Installing /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Time/HiRes.pm&lt;br /&gt;
Installing /usr/share/man/man3/Time::HiRes.3pm&lt;br /&gt;
Writing /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Time/HiRes/.packlist&lt;br /&gt;
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod&lt;br /&gt;
  /usr/bin/make install  -- OK&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to check if these modules are installed?&lt;br /&gt;
&lt;br /&gt;
Use the perldoc -l command for each PERL module you want to check. You should see a “.pm” line for each module that is installed on the system:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# perldoc -l Time::HiRes Digest::SHA1 Digest::HMAC Net::DNS Time::HiRes HTML::Tagset HTML::Parser&lt;br /&gt;
&lt;br /&gt;
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/Time/HiRes.pm&lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Digest/SHA1.pm&lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/Digest/HMAC.pm&lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Net/DNS.pm&lt;br /&gt;
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/Time/HiRes.pm&lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/HTML/Tagset.pm&lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/Parser.pm&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is a long list of PERL modules, required for the enhanced functionality of SpamAssassin, Razor, DCC, etc. You can install them after you are done with your base qmail installation . Or you may want to install them before (now). It doesn't matter.  There is also an option to update your perl CPAN system module. If you want to, you can execute the following two commands to update. This is an optional step though&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Bundle::CPAN&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;reload&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is the list of PERL modules, as discussed above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Digest::SHA1&lt;br /&gt;
Digest::HMAC&lt;br /&gt;
HTML::Tagset&lt;br /&gt;
HTML::Parser&lt;br /&gt;
Parse::Syslog&lt;br /&gt;
Statistics::Distributions&lt;br /&gt;
ClamAV::Client&lt;br /&gt;
Mail::SpamAssassin&lt;br /&gt;
Mail::SPF::Query&lt;br /&gt;
IP::Country::Fast&lt;br /&gt;
MIME::Base64&lt;br /&gt;
Getopt::Long&lt;br /&gt;
URI::Escape&lt;br /&gt;
Mail::SPF&lt;br /&gt;
IO::Zlib&lt;br /&gt;
Test::Harness&lt;br /&gt;
Test::Simple&lt;br /&gt;
Mail::DKIM&lt;br /&gt;
Mail::DomainKeys&lt;br /&gt;
Crypt::OpenSSL::Bignum&lt;br /&gt;
IO::Socket::INET6&lt;br /&gt;
IO::Socket::SSL&lt;br /&gt;
Mail::SpamAssassin::Plugin::DCC&lt;br /&gt;
Mail::SpamAssassin::Plugin::Razor2&lt;br /&gt;
Socket6&lt;br /&gt;
Date::Manip&lt;br /&gt;
DB_File&lt;br /&gt;
Archive::Tar&lt;br /&gt;
Net::Ident&lt;br /&gt;
Time::HiRes&lt;br /&gt;
Archive::Tar&lt;br /&gt;
File::Copy&lt;br /&gt;
Encode::Detect&lt;br /&gt;
Razor2::Client::Agent  (This will get installed with the Razor software, later)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a tip for checking this whole list:&lt;br /&gt;
Save this list in a text file, say /tmp/perl-list.txt on the server. Then run a loop to check existence of each module, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# for i in `cat /tmp/perl-list.txt`; do perldoc -l $i ; done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will get the output such as:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# for i in `cat /tmp/perl-list.txt`; do perldoc -l $i ; done&lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/Digest/SHA1.pm   &lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/Digest/HMAC.pm                           &lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/HTML/Tagset.pm                           &lt;br /&gt;
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/Parser.pm   &lt;br /&gt;
No documentation found for &amp;quot;Parse::Syslog&amp;quot;.                               &lt;br /&gt;
No documentation found for &amp;quot;Statistics::Distributions&amp;quot;.&lt;br /&gt;
... . &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I will use a grep filter to just see which modules are not installed:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# for i in `cat /tmp/perl-list.txt`; do perldoc -l $i ; done | grep &amp;quot;No documentation&amp;quot;&lt;br /&gt;
No documentation found for &amp;quot;Parse::Syslog&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Statistics::Distributions&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;ClamAV::Client&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Mail::SPF::Query&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;IP::Country::Fast&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Mail::SPF&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Mail::DKIM&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Mail::DomainKeys&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Crypt::OpenSSL::Bignum&amp;quot;.&lt;br /&gt;
No documentation found for &amp;quot;Net::Ident&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see above, I now have a list of modules I will need to install manually.  I will utilize the opportunity now and install them. Again, you can install them before you start with Anti-Spam software.&lt;br /&gt;
&lt;br /&gt;
The following will install without a problem:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Parse::Syslog&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Statistics::Distributions&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install IP::Country::Fast&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Crypt::OpenSSL::Bignum&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following will not install easily with “perl -MCPAN ....” command. But when you do, it will save you from actually downloading the software. When you issue the “perl -MCPAN -e install ........”  command, the module will get downloaded and will be saved in the .cpan/build directory of current user's home directory. Since you will be performing these steps as root, you will find them downloaded under /root/.cpan/build directory. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install ClamAV::Client&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Mail::SPF::Query&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Mail::SPF&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Mail::DKIM&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Mail::DomainKeys&amp;quot;&lt;br /&gt;
perl -MCPAN -e &amp;quot;install Net::Ident&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, you just need to change into each directory of the module and install it using the actual manual compilation technique.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail build]# cd /root/.cpan/build/Net-Ident-1.20/&lt;br /&gt;
&lt;br /&gt;
[root@qmail Net-Ident-1.20]# perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Installing /usr/lib/perl5/site_perl/5.8.8/Net/Ident.pm&lt;br /&gt;
Installing /usr/share/man/man3/Net::Ident.3pm&lt;br /&gt;
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Net/Ident/.packlist&lt;br /&gt;
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod&lt;br /&gt;
[root@qmail Net-Ident-1.20]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# cd /root/.cpan/build/Mail-DKIM-0.36/&lt;br /&gt;
&lt;br /&gt;
[root@qmail Mail-DKIM-0.36]# perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Installing /usr/share/man/man3/Mail::DKIM::SignerPolicy.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::DKIM::DkPolicy.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::DKIM::Canonicalization::DkimCommon.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::DKIM::Policy.3pm&lt;br /&gt;
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Mail/DKIM/.packlist&lt;br /&gt;
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail build]# cd /root/.cpan/build/Mail-SPF-v2.006/&lt;br /&gt;
[root@qmail Mail-SPF-v2.006]# perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install &lt;br /&gt;
This module requires Module::Build to install itself.                  &lt;br /&gt;
  Install Module::Build now from CPAN? [y] y &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Installing /usr/share/man/man3/Mail::SPF::Mod::Exp.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::SPF::Result.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::SPF::Term.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::SPF::v1::Record.3pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::SPF::Server.3pm&lt;br /&gt;
Installing /usr/sbin/spfd&lt;br /&gt;
Installing /usr/bin/spfquery&lt;br /&gt;
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Mail/SPF/.packlist&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail Mail-SPF-v2.006]# cd /root/.cpan/build/Mail-SPF-Query-1.999.1/&lt;br /&gt;
&lt;br /&gt;
Mail-SPF-Query module expects two more modules. Let's install them too:&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# perl -MCPAN -e &amp;quot;install Net::CIDR::Lite&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# perl -MCPAN -e &amp;quot;install Sys::Hostname::Long&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@qmail Mail-SPF-Query-1.999.1]# perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
Installing /usr/bin/spfd&lt;br /&gt;
Installing /usr/bin/spfquery&lt;br /&gt;
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Mail/SPF/Query/.packlist&lt;br /&gt;
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod&lt;br /&gt;
[root@qmail Mail-SPF-Query-1.999.1]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail Mail-DomainKeys-1.0]# perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
&lt;br /&gt;
You appear to be directly connected to the Internet.  I have some tests&lt;br /&gt;
that try to query live nameservers.&lt;br /&gt;
&lt;br /&gt;
Do you want to enable these tests? [y] y&lt;br /&gt;
Warning: prerequisite Crypt::OpenSSL::RSA 0 not found.&lt;br /&gt;
Writing Makefile for Mail::DomainKeys&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Installing /usr/lib/perl5/site_perl/5.8.8/Mail/DomainKeys/Key/Private.pm&lt;br /&gt;
Installing /usr/share/man/man3/Mail::DomainKeys.3pm&lt;br /&gt;
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Mail/DomainKeys/.packlist&lt;br /&gt;
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod&lt;br /&gt;
[root@qmail Mail-DomainKeys-1.0]#&lt;br /&gt;
&lt;br /&gt;
Install the additional module:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail Mail-DomainKeys-1.0]# cd ../Crypt-OpenSSL-RSA-0.25/&lt;br /&gt;
&lt;br /&gt;
[root@qmail Crypt-OpenSSL-RSA-0.25]# perl Makefile.PL &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Writing Makefile for Crypt::OpenSSL::RSA                                      &lt;br /&gt;
Writing /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/Crypt/OpenSSL/RSA/.packlist&lt;br /&gt;
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod&lt;br /&gt;
[root@qmail Crypt-OpenSSL-RSA-0.25]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pit-stop! ===&lt;br /&gt;
From here onwards Qmail installation steps will start. So if you want to take a snapshot of your virtual machine, now is the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Downloading and installing Qmail ==&lt;br /&gt;
&lt;br /&gt;
* LWQ:-&lt;br /&gt;
** [Net-]qmail[-1.06], http://www.qmail.org/netqmail-1.06.tar.gz &lt;br /&gt;
** ucspi-tcp, http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz &lt;br /&gt;
** daemontools, http://cr.yp.to/daemontools/daemontools-0.76.tar.gz&lt;br /&gt;
&lt;br /&gt;
We will not use NetQmail-1.06, because it is basically qmail-1.03 + “Some patches already applied”. This is what we don't want. We will patch qmail-1.03 with John Simpson's patches.&lt;br /&gt;
&lt;br /&gt;
* QMR, JMS? :-&lt;br /&gt;
** [Original-]qmail[-1.03], http://cr.yp.to/software/qmail-1.03.tar.gz&lt;br /&gt;
** ucspi-tcp, http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz &lt;br /&gt;
** daemontools, http://cr.yp.to/daemontools/daemontools-0.76.tar.gz&lt;br /&gt;
&lt;br /&gt;
QMR guide asks us to download the packages in /usr/src/qmail. Whereas LWQ asks us to download it in /usr/local/src . Both guides ultimately place daemontools in /package and the first two (qmail and ucspi-tcp)  in /var/qmail/*. I will try to be as close to LWQ recommendations. I will also make a directory named /downloads , and will download all the software I will be downloading during this installation, in this location.&lt;br /&gt;
&lt;br /&gt;
=== Download Software ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /downloads&lt;br /&gt;
cd /downloads&lt;br /&gt;
&lt;br /&gt;
[root@qmail downloads]# wget http://cr.yp.to/software/qmail-1.03.tar.gz&lt;br /&gt;
[root@qmail downloads]# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz&lt;br /&gt;
[root@qmail downloads]# wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz&lt;br /&gt;
&lt;br /&gt;
cp  /downloads/*.tar.gz   /usr/local/src/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack qmail-1.03.tar.gz and ucspi-tcp-0.88.tar.gz in /usr/local/src/ .&lt;br /&gt;
&lt;br /&gt;
cd /usr/local/src/&lt;br /&gt;
tar xzf qmail-1.03.tar.gz &lt;br /&gt;
tar xzf tar xzf ucspi-tcp-0.88.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy and unpack the daemontools package to the /package directory.&lt;br /&gt;
&lt;br /&gt;
mkdir /package&lt;br /&gt;
chmod 1755  /package&lt;br /&gt;
&lt;br /&gt;
cp /downloads/daemontools-0.76.tar.gz    /package/&lt;br /&gt;
cd /package&lt;br /&gt;
tar xzf  daemontools-0.76.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There should now be directories called /usr/local/src/netqmail-1.06, /usr/local/src/ucspi-tcp-0.88, and /package/admin/daemontools-0.76.&lt;br /&gt;
&lt;br /&gt;
=== Create users and groups ===&lt;br /&gt;
Since qmail's installation program creates the sub-directories as they're needed, you only need to create the qmail &amp;quot;home&amp;quot; directory:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/qmail&lt;br /&gt;
&lt;br /&gt;
# Create users and groups:&lt;br /&gt;
&lt;br /&gt;
groupadd -g 700 nofiles&lt;br /&gt;
useradd -u 701 -g nofiles -d /var/qmail/alias -s /sbin/nologin -p '*'  -c 'QMail alias user' alias&lt;br /&gt;
useradd -u 702 -g nofiles -d /var/qmail -s /sbin/nologin -p '*'  -c 'QMail daemon user' qmaild&lt;br /&gt;
useradd -u 703 -g nofiles -d /var/qmail -s /sbin/nologin -p '*'  -c 'QMail log user' qmaill&lt;br /&gt;
useradd -u 704 -g nofiles -d /var/qmail -s /sbin/nologin -p '*'  -c 'QMail password user' qmailp&lt;br /&gt;
&lt;br /&gt;
groupadd -g 701 qmail&lt;br /&gt;
useradd -u 705 -g qmail -d /var/qmail -s /sbin/nologin -p '*'  -c 'QMail queue user' qmailq&lt;br /&gt;
useradd -u 706 -g qmail -d /var/qmail -s /sbin/nologin -p '*'  -c 'QMail remote user' qmailr&lt;br /&gt;
useradd -u 707 -g qmail -d /var/qmail -s /sbin/nologin -p '*'  -c 'QMail send user' qmails&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Basically, at this time, we are ready to do the build. Remember we have Qmail-1.03, which we need to patch, ideally with the latest combined patch from John Simpson.&lt;br /&gt;
&lt;br /&gt;
QMR, at this stage creates a lot of directories and sets ownerships, which we are not going to do now. We will be careful, and will try to follow LWQ steps. There are, in particular, two files in Qmail source tree, in which QMR pushes some values. Refer to the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo 211 &amp;gt; /usr/src/qmail/qmail-1.03/conf-split&lt;br /&gt;
echo 255 &amp;gt; /usr/src/qmail/qmail-1.03/conf-spawn&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the example we are following, these files are actually located in /usr/local/src/qmail-1.03  directory. Let's see these files contents from the default source:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail package]# cat /usr/local/src/qmail-1.03/conf-split&lt;br /&gt;
23&lt;br /&gt;
&lt;br /&gt;
This is the queue subdirectory split.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail package]# cat /usr/local/src/qmail-1.03/conf-spawn&lt;br /&gt;
120&lt;br /&gt;
This is a silent concurrency limit. You can't set it above 255. On some  systems you can't set it above 125. qmail will refuse to compile if the limit is too high. &lt;br /&gt;
[root@qmail package]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The details gathered on these two files from internet :-&lt;br /&gt;
&lt;br /&gt;
===conf-split:===&lt;br /&gt;
The conf-split file specifies the number of subdirectories that the qmail directories for mail-queuing: info, local, mess and remote, are divided into. The default value for this parameter is 23.&lt;br /&gt;
This is the number of split subdirectories for those queue directories which are hashed. The default for qmail is 23. Appropriate values depend on the volume of mail handled, OS filesystem efficiency, and other factors, but this should always be a prime number. &lt;br /&gt;
(Ref: http://pyropus.ca/software/queue-repair/docs.html )&lt;br /&gt;
Research has shown that you get a more even distribution of hash values, and thus fewer collisions, if you choose your table size to be a prime number.&lt;br /&gt;
Question: Are there any negative sideeffects of setting conf-split too high?&lt;br /&gt;
Answer: Yes there are . Scanning todo/ takes longer, if you are using the big-todo patch, because every subdir has to be scanned, instead of just one dir.&lt;br /&gt;
&lt;br /&gt;
Reference: http://www.mail-archive.com/qmail@id.wustl.edu/msg46322.html &lt;br /&gt;
The default, 23, is prime, and in his only message to the list on the topic of conf-split, DJB suggested a value of 401, also prime, for a queue with 100000 entries. Reference:&lt;br /&gt;
http://www.ornl.gov/its/archives/mailing-lists/qmail/1997/07/msg00295.html&lt;br /&gt;
&lt;br /&gt;
Bottom-line: For smaller sites / mail-servers/ mail-queues, use the default. For larger sites, you can use larger prime numbers, going all the way to 401.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== conf-spawn: ===&lt;br /&gt;
The conf-spawn file specifies the maximum number of simultaneous qmail-local and qmail-remote sessions that can be running on the system. The default value for this parameter is 120. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Conclusion: ===&lt;br /&gt;
We will use the default values in these files, unless John Simpson's combined patch makes changes in them.&lt;br /&gt;
&lt;br /&gt;
=== Patch qmail source with John Simpson's patch ===&lt;br /&gt;
Time to apply the combined patch to qmail-1.03 . &lt;br /&gt;
Download John Simpson's latest combined patch from his site: &lt;br /&gt;
http://qmail.jms1.net/patches/combined-details.shtml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /downloads&lt;br /&gt;
wget http://qmail.jms1.net/patches/qmail-1.03-jms1.7.08.patch&lt;br /&gt;
&lt;br /&gt;
cd /usr/local/src/qmail-1.03&lt;br /&gt;
patch &amp;lt; /downloads/qmail-1.03-jms1.7.08.patch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see below, not a “single” hunk / patch failed!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# patch &amp;lt; /downloads/qmail-1.03-jms1.7.08.patch                                   &lt;br /&gt;
patching file EXTTODO                                                                                    &lt;br /&gt;
patching file EXTTODO-INFO                                                                               &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
patching file tcp-env.c&lt;br /&gt;
patching file timeoutconn.c&lt;br /&gt;
patching file timeoutconn.h&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just for the sake of verification, lets see what the patch has done to the two files: conf-split and conf-spawn. Here they are after patching:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# cat conf-split&lt;br /&gt;
23&lt;br /&gt;
&lt;br /&gt;
This is the queue subdirectory split.&lt;br /&gt;
&lt;br /&gt;
[root@qmail qmail-1.03]# cat conf-spawn&lt;br /&gt;
120&lt;br /&gt;
&lt;br /&gt;
This is a silent concurrency limit. You can't set it above 65000. Many systems have a &amp;quot;hidden limit&amp;quot; of 509, because a single process cannot have more than 1023 handles open at once, and each concurrent delivery uses two handles. If you set it any higher than your system's &amp;quot;hidden limit&amp;quot;, qmail will refuse to compile. &lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, there is just a more detailed comment added in the conf-spawn. Rest no values are changed. Good!&lt;br /&gt;
&lt;br /&gt;
=== Compile qmail ===&lt;br /&gt;
&lt;br /&gt;
Once the patching is done, you are in line with the step of LWQ. You can go ahead and compile qmail. As shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make clean&lt;br /&gt;
make man&lt;br /&gt;
make setup check&lt;br /&gt;
&lt;br /&gt;
[root@qmail qmail-1.03]# make setup check&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
chmod 755 binm3+df&lt;br /&gt;
./compile spfquery.c&lt;br /&gt;
spfquery.c: In function ‘main’:&lt;br /&gt;
spfquery.c:30: warning: incompatible implicit declaration of built-in function ‘strdup’&lt;br /&gt;
spfquery.c:24: warning: return type of ‘main’ is not ‘int’&lt;br /&gt;
./load spfquery spf.o ip.o ipme.o ipalloc.o strsalloc.o \&lt;br /&gt;
        now.o dns.o env.o datetime.a stralloc.a alloc.a str.a substdio.a \&lt;br /&gt;
        case.a error.a fs.a `cat dns.lib` `cat socket.lib` envread.o qregex.o&lt;br /&gt;
./compile -DEXTERNAL_TODO  qmail-todo.c&lt;br /&gt;
qmail-todo.c: In function ‘main’:&lt;br /&gt;
qmail-todo.c:620: warning: return type of ‘main’ is not ‘int’&lt;br /&gt;
./load qmail-todo control.o constmap.o trigger.o fmtqfn.o now.o \&lt;br /&gt;
        readsubdir.o case.a ndelay.a getln.a sig.a open.a stralloc.a \&lt;br /&gt;
        alloc.a substdio.a error.a str.a fs.a auto_qmail.o auto_split.o&lt;br /&gt;
./install&lt;br /&gt;
./instcheck&lt;br /&gt;
[root@qmail qmail-1.03]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure basic qmail structures ===&lt;br /&gt;
Alhumdulillah. The compilation is done without a problem. According to LWQ, you can go ahead with using either “./config” or “./config-fast server.domain.com” method. QMR asks you to run “./config-fast server.domain.com” directly.&lt;br /&gt;
&lt;br /&gt;
According to LWQ:&lt;br /&gt;
If your DNS is configured properly, this script should be all you need at this point:&lt;br /&gt;
    ./config&lt;br /&gt;
If, for some reason, config can't find your hostname in DNS, you'll have to run the config-fast script:&lt;br /&gt;
    ./config-fast the.full.hostname&lt;br /&gt;
For example, if your domain is example.com and the hostname of your computer is dolphin, your config-fast line would look like this:&lt;br /&gt;
    ./config-fast dolphin.example.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First, I will try “./config” only :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# ./config&lt;br /&gt;
Your hostname is qmail.example.com.&lt;br /&gt;
hard error&lt;br /&gt;
Sorry, I couldn't find your host's canonical name in DNS.&lt;br /&gt;
You will have to set up control/me yourself.&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see clearly, above, my DNS was not set properly, so qmail told me to do things manually. Instead of doing things manually, I will just run the “./config-fast ... ” script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# ./config-fast qmail.example.com&lt;br /&gt;
Your fully qualified host name is qmail.example.com.&lt;br /&gt;
Putting qmail.example.com into control/me...&lt;br /&gt;
Putting example.com into control/defaultdomain...&lt;br /&gt;
Putting example.com into control/plusdomain...&lt;br /&gt;
Putting qmail.example.com into control/locals...&lt;br /&gt;
Putting qmail.example.com into control/rcpthosts...&lt;br /&gt;
Now qmail will refuse to accept SMTP messages except to qmail.example.com.&lt;br /&gt;
Make sure to change rcpthosts if you add hosts to locals or virtualdomains!&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's it. qmail is now installed on your system and is ready to be run!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
################################################################################ &lt;br /&gt;
Important from: http://www.antagonism.org/qmr-faq.shtml&lt;br /&gt;
&lt;br /&gt;
7.11 What is the difference between the locals and rcpthosts files in /var/qmail/control?&lt;br /&gt;
&lt;br /&gt;
The locals file contains domains which reside locally on the machine. This means accounts listed in locals should have shell accounts on the machine. If you use vpopmail, your locals file should be empty but exist. This problem is prevalent in many qmailrocks installs as the instruction set wrongly instructs users to configure qmail using the &amp;quot;config-fast&amp;quot; shell script. Unless the user desires email accounts for his shell accounts the is not the correct method. The following commands correct this error.&lt;br /&gt;
&lt;br /&gt;
If /var/qmail/control/locals exists, run the first command. If not, you may skip to the second command.&lt;br /&gt;
# rm -f /var/qmail/control/locals&lt;br /&gt;
# touch /var/qmail/control/locals&lt;br /&gt;
# chmod 644 /var/qmail/control/locals&lt;br /&gt;
# chown root.root /var/qmail/control/locals&lt;br /&gt;
&lt;br /&gt;
The rcpthosts file contains the domains for which qmail-smtpd will accept email. The rcpthosts file should contain the domain names only. Do not put in email addresses, hostnames or IP addresses into this file.&lt;br /&gt;
################################################################################## &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Though I have read the note above and implemented on a few live servers. I do not agree with it. The reason is that if I do as advised above, in this note, then mails destined for root, postmaster, etc do not get delivered to the mailbox of postmaster. So we won't act upon this advice. I have only copied this text/note here, for your information.&lt;br /&gt;
&lt;br /&gt;
There is another thing to this note. The config-fast shell script is not provided by QMR. It is mentioned in LWQ. So it had to be from DJB. And at the moment, I consider him (DJB) the authority on Qmail. He put this script for a purpose. And the purpose is being served. Lets move on.&lt;br /&gt;
By the way, by the time of this writing, the note has apparently moved to another location or changed name. I couldn't find it and I did not spent much time on it either.&lt;br /&gt;
&lt;br /&gt;
QMR suggests to “make cert” at this point. There is no fun in doing so, as there are couple of things we still need to do. More-over, the “make cert” method suggested by QMR is wrong and is seriously questioned by JMS. We will deal with certificates at a later stage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ucspi-tcp: ===&lt;br /&gt;
ucspi-tcp is DJB's original implementation of UCSPI, the Unix Client-Server Program Interface, using the TCP protocol.&lt;br /&gt;
In other words, it's a set of programs which make it easy to write and run service programs which accept connections on TCP sockets, as well as client programs which connect to services on TCP sockets. The programs in the ucspi-tcp package take care of the messy networking details, and allow the programmer or system administrator to concentrate on making their service or client work correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ucspi-tcp [LWQ]: ===&lt;br /&gt;
Earlier, you unpacked the qmail, ucspi-tcp, and daemontools tarballs. Now change to the ucspi-tcp directory:&lt;br /&gt;
    cd /usr/local/src/ucspi-tcp-0.88&lt;br /&gt;
In the Do the build section, if you modified conf-cc and conf-ld, you'll need to make the same changes in this directory.&lt;br /&gt;
(We did not do any changes to conf-cc and conf-ld while compiling / building qmail-1.03 !)&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    patch &amp;lt; /usr/local/src/netqmail-1.06/other-patches/ucspi-tcp-0.88.errno.patch&lt;br /&gt;
    make&lt;br /&gt;
    make setup check&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's it. ucspi-tcp is installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ucspi-tcp [JMS]: ===&lt;br /&gt;
From JMS site (http://qmail.jms1.net/ucspi-tcp/ ):-&lt;br /&gt;
&lt;br /&gt;
ucspi-tcp is DJB's original implementation of UCSPI, the Unix Client-Server Program Interface, using the TCP protocol.&lt;br /&gt;
In english, it's a set of programs which make it easy to write and run service programs which accept connections on TCP sockets, as well as client programs which connect to services on TCP sockets. The programs in the ucspi-tcp package take care of the messy networking details, and allow the programmer or system administrator to concentrate on making their service or client work correctly.&lt;br /&gt;
&lt;br /&gt;
It's mentioned on this web site because the normal method of running an SMTP or POP3 service is to use the &amp;quot;tcpserver&amp;quot; program, which is part of the ucspi-tcp package. It's also possible to use tcpserver to run other TCP-based services, such as IMAP services.&lt;br /&gt;
If you're running a qmail server, you should definitely understand how tcpserver works.&lt;br /&gt;
&lt;br /&gt;
==== The patch: ====&lt;br /&gt;
Like qmail, the programs in the ucspi-tcp package are lacking in some features which many people, myself included, need on their servers. Below is a list of the ucspi-tcp patches I use on my own systems:&lt;br /&gt;
&lt;br /&gt;
ucspi-tcp-0.88.errno.patch The ucspi-tcp package, like all of DJB's other packages, has an issue with the errno variable when compiled using glibc version 2.3 or higher. (CENTOS 5.3 has glibc 2.5 ). The solution is the same as for DJB's other packages as well.&lt;br /&gt;
Edit the file error.h in the source code. Find this line, near the top of the file:&lt;br /&gt;
extern int errno; &lt;br /&gt;
Comment this line out, and add the following line below it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* extern int errno; */&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would rather not edit the file by hand, the patch file can be used to make the change as well.&lt;br /&gt;
&lt;br /&gt;
ucspi-rss.diff is a patch by Alan Curry which makes the rblsmtpd program work with A records. This is necessary because the owners of &amp;quot;rss&amp;quot; (one of the first anti-spam &amp;quot;blacklists&amp;quot;) removed the TXT records from their zone files, because the DNS server they were using to serve the zone (BIND, which they also wrote) had trouble with large zone files, a problem which the &amp;quot;rbldns&amp;quot; program (from DJB's djbdns package) does not share.&lt;br /&gt;
I have updated the patch. With the original patch, when rblsmtpd retrieves a TXT record, it scans the value for the string &amp;quot;%IP%&amp;quot; and replaces it with the value of TCPREMOTEIP (i.e. the IP address of the client.) My updated version does the same substitution on the value of the RBLSMTPD environment variable when it starts.&lt;br /&gt;
You can download the original patch from qmail.org, or from my server. You can download the updated patch here: http://qmail.jms1.net/ucspi-tcp/ucspi-rss2.patch &lt;br /&gt;
&lt;br /&gt;
The tcpserver limits patch, by Matija Nalis, gives tcpserver the ability to reject connections when the server's load average is above a certain number, when more than a certain number of connections are received from the same IP address, or when more than a certain number of connections are received from machines in the same class-C block (i.e. the &amp;quot;first three numbers&amp;quot; in their IP addresses are the same. &amp;quot;1.2.3.4&amp;quot; and &amp;quot;1.2.3.100&amp;quot; are in the same class-C block.)&lt;br /&gt;
The limits are configured by setting the MAXLOAD, MAXCONNIP, and MAXCONNC environment variables before tcpserver runs. If you want tcpserver to send a message to the client before dropping their connection, you can configure this by setting a DIEMSG environment variable.&lt;br /&gt;
The patch I was using, dated 2006-01-26, does work as advertised, and has saved my own server and several of my clients' servers from being overloaded by over-zealous attackers (i.e. spammers) over the past few months. However, I did notice a few minor cosmetic issues which I thought needed to be fixed, so I updated the patch.&lt;br /&gt;
My updates are:&lt;br /&gt;
When MAXCONNIP or MAXCONNC cause a connection to be rejected, tcpserver adds &amp;quot;MAXCONNIP:&amp;quot; or &amp;quot;MAXCONNC:&amp;quot; with the limit at the end of the &amp;quot;deny line in the logs. This makes it easy to debug- the error message tells you which environment variable caused the connection to be rejected.&lt;br /&gt;
However, when MAXLOAD causes a connection to be rejected, it adds &amp;quot;LOAD:&amp;quot; and the current load average to the log. This doesn't match the environment variable, which &amp;quot;feels funny&amp;quot; to me. (I told you it was a minor cosmetic issue.)&lt;br /&gt;
For the sake of consistency, I changed the &amp;quot;LOAD:&amp;quot; label to say &amp;quot;MAXLOAD:&amp;quot;, so it matches the environment variable name, like the other two messages do.&lt;br /&gt;
The older patch only has a provision for a single DIEMSG variable, whose value is sent to a client whose connection is being rejected, regardless of which of the three limits the client triggered. I thought it would be nice to be able to set one message which says something like &amp;quot;Server too busy, try again later&amp;quot; and another message which says &amp;quot;Too many connections from your IP address&amp;quot;.&lt;br /&gt;
I added three new environment variables: DIEMSG_MAXLOAD, DIEMSG_MAXCONNIP, and DIEMSG_MAXCONNC, whose values are used instead of the generic DIEMSG message. However, to avoid breaking older scripts, if one of these new variables is not set, the DIEMSG value will be used instead.&lt;br /&gt;
The original author's web page has a link where you can download the previous versions of the patch. As of the time I'm writing this (2007-12-22) the most recent version of his patch is dated 2006-01-26, and is what I used as the starting point for my own changes.&lt;br /&gt;
Below is the link to download the patch. I also have the CHANGES.tcpserver-limits-patch and README.tcpserver-limits-patch files available, if you want to read them before downloading the patch. &lt;br /&gt;
&lt;br /&gt;
(I highly recommend you to read the README.tcpserver-limits-patch file.)&lt;br /&gt;
http://qmail.jms1.net/ucspi-tcp/tcpserver-limits-2007-12-22.patch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Conclusion and actual installation of UCSPI: ===&lt;br /&gt;
&lt;br /&gt;
We did not do any changes to conf-cc and conf-ld while compiling / building qmail-1.03 . So we don't need to change anything in the ucspi-tcp directory.&lt;br /&gt;
&lt;br /&gt;
I cannot use the patch suggested by LWQ, as I am not using netqmail-1.06 . So I will use JMS method and manually edit the error.h  file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vi error.h &lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Replace :&lt;br /&gt;
extern int errno;&lt;br /&gt;
&lt;br /&gt;
With :&lt;br /&gt;
/* extern int errno; */&lt;br /&gt;
&lt;br /&gt;
And add another line after it:&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
(save exit).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, I would download the two other patches mentioned by JMS and apply them to UCSPI source:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /downloads/&lt;br /&gt;
[root@qmail downloads]# wget http://qmail.jms1.net/ucspi-tcp/ucspi-rss2.patch&lt;br /&gt;
[root@qmail downloads]# wget http://qmail.jms1.net/ucspi-tcp/tcpserver-limits-2007-12-22.patch&lt;br /&gt;
&lt;br /&gt;
cd /usr/local/src/ucspi-tcp-0.88&lt;br /&gt;
&lt;br /&gt;
[root@qmail ucspi-tcp-0.88]# patch &amp;lt; /downloads/ucspi-rss2.patch&lt;br /&gt;
patching file rblsmtpd.c&lt;br /&gt;
&lt;br /&gt;
[root@qmail ucspi-tcp-0.88]# patch &amp;lt; /downloads/tcpserver-limits-2007-12-22.patch&lt;br /&gt;
patching file CHANGES.tcpserver-limits-patch&lt;br /&gt;
patching file README.tcpserver-limits-patch&lt;br /&gt;
patching file tcpserver.c&lt;br /&gt;
[root@qmail ucspi-tcp-0.88]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now run “make” and “make setup check”:&lt;br /&gt;
&lt;br /&gt;
[root@qmail ucspi-tcp-0.88]# make&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
./compile install.c                                                                        &lt;br /&gt;
./compile hier.c                                                                           &lt;br /&gt;
./compile auto-str.c                                                                       &lt;br /&gt;
auto-str.c:9: warning: conflicting types for built-in function ‘puts’                      &lt;br /&gt;
./load auto-str unix.a byte.a                                                              &lt;br /&gt;
./auto-str auto_home `head -1 conf-home` &amp;gt; auto_home.c                                     &lt;br /&gt;
./compile auto_home.c                                                                      &lt;br /&gt;
./load install hier.o auto_home.o unix.a byte.a                                            &lt;br /&gt;
./compile instcheck.c                                                                      &lt;br /&gt;
./load instcheck hier.o auto_home.o unix.a byte.a                                          &lt;br /&gt;
[root@qmail ucspi-tcp-0.88]#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail ucspi-tcp-0.88]# make setup check&lt;br /&gt;
./install&lt;br /&gt;
./instcheck&lt;br /&gt;
[root@qmail ucspi-tcp-0.88]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's it. ucspi-tcp is installed. Alhumdulillah! Good.&lt;br /&gt;
&lt;br /&gt;
=== Daemontools: ===&lt;br /&gt;
The daemontools package monitors, controls, and logs the execution and output of long-running programs, often called daemons. &lt;br /&gt;
&lt;br /&gt;
==== Daemontools [LWQ] ====&lt;br /&gt;
Change to the daemontools build directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /package/admin/daemontools-0.76&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again, if you modified &amp;lt;conf-cc&amp;gt; and conf-ld during the qmail and ucspi-tcp builds, you'll need to make the same changes in the src directory.&lt;br /&gt;
&lt;br /&gt;
Then do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    cd src&lt;br /&gt;
    patch &amp;lt; /usr/local/src/netqmail-1.06/other-patches/daemontools-0.76.errno.patch&lt;br /&gt;
    cd ..&lt;br /&gt;
    package/install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Daemontools [QMR]: ====&lt;br /&gt;
QMR wants us to patch daemontools, using the patch copied from the netqmail distribution, which is ok to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Conclusion and Installation of Daemontools: ====&lt;br /&gt;
&lt;br /&gt;
We know that are not using LWQ's netqmail. Also we know that the patch applied to daemontools during QMR installation is in-fact a patch copied from LWQ's distribution. Basically this “errno” patch is exactly the same as it was for ucspi-tcp sotware. We just need to disable a line and introduce another line, exactly as before. So here it goes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /package/admin/daemontools-0.76/src/&lt;br /&gt;
&lt;br /&gt;
vi error.h&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
Replace :&lt;br /&gt;
extern int errno;&lt;br /&gt;
&lt;br /&gt;
With :&lt;br /&gt;
/* extern int errno; */&lt;br /&gt;
&lt;br /&gt;
And add another line after it:&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
(save exit).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change directory one step back :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd .. &lt;br /&gt;
&lt;br /&gt;
OR &lt;br /&gt;
&lt;br /&gt;
cd /package/admin/daemontools-0.76/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
package/install&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
./package/install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail daemontools-0.76]# package/install&lt;br /&gt;
... &lt;br /&gt;
... &lt;br /&gt;
grep sysdep hasmkffo.h &amp;gt;&amp;gt; sysdeps&lt;br /&gt;
grep sysdep hasflock.h &amp;gt;&amp;gt; sysdeps&lt;br /&gt;
grep sysdep hasshsgr.h &amp;gt;&amp;gt; sysdeps&lt;br /&gt;
Copying commands into ./command...&lt;br /&gt;
Creating symlink daemontools -&amp;gt; daemontools-0.76...&lt;br /&gt;
Making command links in /command...&lt;br /&gt;
Making compatibility links in /usr/local/bin...&lt;br /&gt;
Creating /service...&lt;br /&gt;
Adding svscanboot to inittab...&lt;br /&gt;
init should start svscan now.&lt;br /&gt;
[root@qmail daemontools-0.76]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point your daemontools installation is complete. You should be able to see the “svscan” process running on your machine. Use &amp;quot;ps -ef | grep svscan&amp;quot; , “ps aux | grep svscan” or &amp;quot;ps waux | grep svscan&amp;quot; to verify that svscan is running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail daemontools-0.76]# ps waux | grep svscan&lt;br /&gt;
root     25206  0.0  0.1   2452  1044 ?        Ss   15:06   0:00 /bin/sh /command/svscanboot&lt;br /&gt;
root     25208  0.0  0.0   1684   356 ?        S    15:06   0:00 svscan /service&lt;br /&gt;
root     25213  0.0  0.0   3912   676 pts/0    S+   15:09   0:00 grep svscan&lt;br /&gt;
[root@qmail daemontools-0.76]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will also see the following line added to your /etc/inittab file :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail daemontools-0.76]# cat /etc/inittab &lt;br /&gt;
. . . &lt;br /&gt;
. . . &lt;br /&gt;
SV:123456:respawn:/command/svscanboot&lt;br /&gt;
&lt;br /&gt;
[root@qmail daemontools-0.76]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alhumdulillah this step is done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: This process check (shown above, just now) is what QMR performs at the end of it's “Part 2 - Installing Qmail Itself”. But as soon as QMR does this, it goes on an “Install spree” (same as shopping spree) and installs all sorts of software until it reaches it's “Part-9” where is decides to have mercy on the person doing the install,  and  finalize the qmail installation. Why did'nt that guy just start the qmail software first and made sure that it worked before moving on to installing bells and whistles ? It is a mystery to me. &lt;br /&gt;
&lt;br /&gt;
And believe me, I was stupid and dumb enough to keep following it for all these years blindly, for the same reason JMS accuses it for:  “to take the easy way out”. Until I read JMS and Life with Qmail “seriously”, I was living in fool's paradise. Anyway. Everyone learns from mistakes and I learned (and still learning) from mine.&lt;br /&gt;
&lt;br /&gt;
== Start qmail: ==&lt;br /&gt;
&lt;br /&gt;
=== The  /var/qmail/rc file [LWQ]: ===&lt;br /&gt;
The /var/qmail/boot directory contains example qmail boot scripts for different configurations. However  for our installation, we'll use the following script :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# Using stdout for logging&lt;br /&gt;
# Using control/defaultdelivery from qmail-local to deliver messages by default&lt;br /&gt;
exec env - PATH=&amp;quot;/var/qmail/bin:$PATH&amp;quot; \&lt;br /&gt;
qmail-start &amp;quot;`cat /var/qmail/control/defaultdelivery`&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note 1: Notice the back ticks!&lt;br /&gt;
Note 2: QMR does the same, but doesn't inform us anything about creating this script, or it's contents. Also, QMR places ./Maildir (without quotes) in the /var/qmail/control/defaultdelivery file. That is intended, but an extra slash (/) is what is mentioned in LWQ guide. i.e. it should be ./Maildir/ as per LWQ. Normally it doesn't matter. It works both ways.&lt;br /&gt;
&lt;br /&gt;
Save the above code as above /var/qmail/rc, then execute the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 755 /var/qmail/rc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: LWQ creates a directory (/var/log/qmail) at this point. This will be used in various run scripts created below. Also the qmail log-run scripts will create files in this directory, “directly”. QMR deviated a little from this and created three sub directories inside /var/log/qmail , named qmail-send, qmail-smtpd, qmail-pop3d . JMS acknowledges here ( http://qmail.jms1.net/logfiles.shtml ), that is is not standard, however it is not wrong as well. So we will use the QMR log directories. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir /var/log/qmail # LWQ&lt;br /&gt;
&lt;br /&gt;
mkdir /var/log/qmail/qmail-send # QMR&lt;br /&gt;
mkdir /var/log/qmail/qmail-smtpd # QMR&lt;br /&gt;
mkdir /var/log/qmail/qmail-pop3d # QMR&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
QMR, also sets up certain ownership and permission to these log directories. Such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chown -R qmaill:root /var/log/qmail&lt;br /&gt;
chmod -R 750 /var/log/qmail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check the LWQ run script for qmail-send/log, and qmail-smtpd/log, you will notice that setuidgid program (provided with qmail source code itself), is called with an account name of qmaill. The setuidgid program takes care of the correct ownership of the files being written by the child program it calls.  So setting the ownership for /var/log/qmail and it's sub directories , as the user qmaill, is okay. The same is verified/confirmed when LWQ also sets up the log directories and sets up ownership of these files as user qmaill . Also see http://cr.yp.to/qmail/faq/admin.html#multilog &lt;br /&gt;
&lt;br /&gt;
At this point you need to decide the default delivery mode for messages that aren't delivered by a .qmail file. Well the most common options are Mailbox or Maildir formats. We are going to use the Maildir format as the default delivery mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo './Maildir/' &amp;gt;/var/qmail/control/defaultdelivery&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more information, see INSTALL.mbox, INSTALL.maildir files in /usr/local/src/qmail-1.03 directory.&lt;br /&gt;
&lt;br /&gt;
Note [from LWQ]: defaultdelivery isn't a standard qmail control file. It's a feature of the above /var/qmail/rc file. The defaultdelivery argument to qmail-start is the contents of a .qmail file that specifies delivery instructions to be followed when no actual .qmail is found. Putting these instructions in a separate control file eliminates the need to quote shell metacharacters in the delivery instructions and avoids messy multi-line command arguments. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== System start-up files [from LWQ] : ===&lt;br /&gt;
&lt;br /&gt;
=== The qmailctl script: ===&lt;br /&gt;
If you were to manually execute the /var/qmail/rc script, qmail would be partially started. But we want qmail started up automatically every time the system is booted and we want it shut down cleanly when the system is halted. This is accomplished by creating a startup/shutdown script like the following in /var/qmail/bin/qmailctl. This script is available via http://lifewithqmail.org/qmailctl-script-dt70 . Create the script using your editor or by downloading it with your web browser (recommended):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]#  wget http://lifewithqmail.org/qmailctl-script-dt70&lt;br /&gt;
[root@qmail ~]#  cp qmailctl-script-dt70 /var/qmail/bin/qmailctl &lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]#  vi /var/qmail/bin/qmailctl&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# For Red Hat chkconfig&lt;br /&gt;
# chkconfig: - 80 30&lt;br /&gt;
# description: the qmail MTA control file&lt;br /&gt;
&lt;br /&gt;
PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin&lt;br /&gt;
export PATH&lt;br /&gt;
&lt;br /&gt;
QMAILDUID=`id -u qmaild`&lt;br /&gt;
NOFILESGID=`id -g qmaild`&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
  start)&lt;br /&gt;
    echo &amp;quot;Starting qmail&amp;quot;&lt;br /&gt;
    if svok /service/qmail-send ; then&lt;br /&gt;
      svc -u /service/qmail-send /service/qmail-send/log&lt;br /&gt;
    else&lt;br /&gt;
      echo &amp;quot;qmail-send supervise not running&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    if svok /service/qmail-smtpd ; then&lt;br /&gt;
      svc -u /service/qmail-smtpd /service/qmail-smtpd/log&lt;br /&gt;
    else&lt;br /&gt;
      echo &amp;quot;qmail-smtpd supervise not running&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    if [ -d /var/lock/subsys ]; then&lt;br /&gt;
      touch /var/lock/subsys/qmail&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  stop)&lt;br /&gt;
    echo &amp;quot;Stopping qmail...&amp;quot;&lt;br /&gt;
    echo &amp;quot;  qmail-smtpd&amp;quot;&lt;br /&gt;
    svc -d /service/qmail-smtpd /service/qmail-smtpd/log&lt;br /&gt;
    echo &amp;quot;  qmail-send&amp;quot;&lt;br /&gt;
    svc -d /service/qmail-send /service/qmail-send/log&lt;br /&gt;
    if [ -f /var/lock/subsys/qmail ]; then&lt;br /&gt;
      rm /var/lock/subsys/qmail&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  stat)&lt;br /&gt;
    svstat /service/qmail-send&lt;br /&gt;
    svstat /service/qmail-send/log&lt;br /&gt;
    svstat /service/qmail-smtpd&lt;br /&gt;
    svstat /service/qmail-smtpd/log&lt;br /&gt;
    qmail-qstat&lt;br /&gt;
    ;;&lt;br /&gt;
  doqueue|alrm|flush)&lt;br /&gt;
    echo &amp;quot;Flushing timeout table and sending ALRM signal to qmail-send.&amp;quot;&lt;br /&gt;
    /var/qmail/bin/qmail-tcpok&lt;br /&gt;
    svc -a /service/qmail-send&lt;br /&gt;
    ;;&lt;br /&gt;
  queue)&lt;br /&gt;
    qmail-qstat&lt;br /&gt;
    qmail-qread&lt;br /&gt;
    ;;&lt;br /&gt;
  reload|hup)&lt;br /&gt;
    echo &amp;quot;Sending HUP signal to qmail-send.&amp;quot;&lt;br /&gt;
    svc -h /service/qmail-send&lt;br /&gt;
    ;;&lt;br /&gt;
  pause)&lt;br /&gt;
    echo &amp;quot;Pausing qmail-send&amp;quot;&lt;br /&gt;
    svc -p /service/qmail-send&lt;br /&gt;
    echo &amp;quot;Pausing qmail-smtpd&amp;quot;&lt;br /&gt;
    svc -p /service/qmail-smtpd&lt;br /&gt;
    ;;&lt;br /&gt;
  cont)&lt;br /&gt;
    echo &amp;quot;Continuing qmail-send&amp;quot;&lt;br /&gt;
    svc -c /service/qmail-send&lt;br /&gt;
    echo &amp;quot;Continuing qmail-smtpd&amp;quot;&lt;br /&gt;
    svc -c /service/qmail-smtpd&lt;br /&gt;
    ;;&lt;br /&gt;
  restart)&lt;br /&gt;
    echo &amp;quot;Restarting qmail:&amp;quot;&lt;br /&gt;
    echo &amp;quot;* Stopping qmail-smtpd.&amp;quot;&lt;br /&gt;
    svc -d /service/qmail-smtpd /service/qmail-smtpd/log&lt;br /&gt;
    echo &amp;quot;* Sending qmail-send SIGTERM and restarting.&amp;quot;&lt;br /&gt;
    svc -t /service/qmail-send /service/qmail-send/log&lt;br /&gt;
    echo &amp;quot;* Restarting qmail-smtpd.&amp;quot;&lt;br /&gt;
    svc -u /service/qmail-smtpd /service/qmail-smtpd/log&lt;br /&gt;
    ;;&lt;br /&gt;
  cdb)&lt;br /&gt;
    tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp &amp;lt; /etc/tcp.smtp&lt;br /&gt;
    chmod 644 /etc/tcp.smtp.cdb&lt;br /&gt;
    echo &amp;quot;Reloaded /etc/tcp.smtp.&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
  help)&lt;br /&gt;
    cat &amp;lt;&amp;lt;HELP&lt;br /&gt;
   stop -- stops mail service (smtp connections refused, nothing goes out)&lt;br /&gt;
  start -- starts mail service (smtp connection accepted, mail can go out)&lt;br /&gt;
  pause -- temporarily stops mail service (connections accepted, nothing leaves)&lt;br /&gt;
   cont -- continues paused mail service&lt;br /&gt;
   stat -- displays status of mail service&lt;br /&gt;
    cdb -- rebuild the tcpserver cdb file for smtp&lt;br /&gt;
restart -- stops and restarts smtp, sends qmail-send a TERM &amp;amp; restarts it&lt;br /&gt;
doqueue -- schedules queued messages for immediate delivery&lt;br /&gt;
 reload -- sends qmail-send HUP, rereading locals and virtualdomains&lt;br /&gt;
  queue -- shows status of queue&lt;br /&gt;
   alrm -- same as doqueue&lt;br /&gt;
  flush -- same as doqueue&lt;br /&gt;
    hup -- same as reload&lt;br /&gt;
HELP&lt;br /&gt;
    ;;&lt;br /&gt;
  *)&lt;br /&gt;
    echo &amp;quot;Usage: $0 {start|stop|restart|doqueue|flush|reload|stat|pause|cont|cdb|queue|help}&amp;quot;&lt;br /&gt;
    exit 1&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the qmailctl script executable and link it to a directory in your path:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod 755 /var/qmail/bin/qmailctl&lt;br /&gt;
ln -s /var/qmail/bin/qmailctl /usr/bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: QMR also uses the same script which is copied from /downloads/qmailrocks/scripts/finalize location to /var/qmail/bin directory, as a result of running the the /downloads/qmailrocks/scripts/finalize/linux/finalize_linux.script script-file, in the start of QMR step 9. QMR also makes this executable , and link it in /usr/bin the same way.&lt;br /&gt;
&lt;br /&gt;
=== The supervise scripts: ===&lt;br /&gt;
&lt;br /&gt;
Note: QMR already has these scripts ready in a specific directory (/downloads/qmailrocks/scripts/finalize/freebsd/) . It just copies these files at the same locations where LWQ suggests. This was revealed from studying the script (finalize_linux.script), which QMR runs in part 9.&lt;br /&gt;
&lt;br /&gt;
Now create the supervise directories for the qmail services [LWQ]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p /var/qmail/supervise/qmail-send/log&lt;br /&gt;
mkdir -p /var/qmail/supervise/qmail-smtpd/log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: QMR also creates these directories, when a script named qmr_install_linux-s1.script is run. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JMS qmail-send run script looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VQ=&amp;quot;/var/qmail&amp;quot;&lt;br /&gt;
exec env - PATH=&amp;quot;$VQ/bin:/usr/local/bin:/usr/bin:/bin&amp;quot; \&lt;br /&gt;
  qmail-start ./Maildir/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is in-fact an almost the same as the /var/qmail/rc file. Apparently JMS doesn't want to use /var/qmail/rc in his scripts, and would rather (kind of) hard-code the same. &lt;br /&gt;
&lt;br /&gt;
Create the /var/qmail/supervise/qmail-send/run file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;gt; /var/qmail/supervise/qmail-send/run &amp;lt;&amp;lt; EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
exec /var/qmail/rc&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[QMR's send_run file has same contents, for this file.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Now the qmail-send/log/run file: ===&lt;br /&gt;
&lt;br /&gt;
The /var/qmail/supervise/qmail-send/log/run file by LWQ, which I will use with some variation (shown later):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail&lt;br /&gt;
&lt;br /&gt;
Note: QMR also uses the same contents with a little variation. These variations are permitted / certified by DJB (http://cr.yp.to/daemontools/multilog.html) , and JMS ( http://qmail.jms1.net/scripts/ ). QMR's send_log script, later copied in system as /var/qmail/supervise/qmail-send/log/run, looks like:&lt;br /&gt;
&lt;br /&gt;
cat /downloads/qmailrocks/scripts/finalize/freebsd/send_log&lt;br /&gt;
&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin&lt;br /&gt;
export PATH&lt;br /&gt;
exec setuidgid qmaill multilog t s100000 n20 /var/log/qmail/qmail-send 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;A little explanation:&amp;lt;/b&amp;gt; s1000000 means that the current logfile will be rotated when reached a size of 100KB. And 20 such rotated log files will be retained by qmail / multilog. Older log files will automatically get deleted. We will adopt this variation and use this. I just want to raise the size-limit of the logfile to 50MB and 20 generations of this file. This will result in a total of 1GB of disk consumed by my qmail logs. You can adjust as per your requirements. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JMS provides a script at (http://qmail.jms1.net/scripts/service-any-log-run) location. Which looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
VQ=&amp;quot;/var/qmail&amp;quot;&lt;br /&gt;
&lt;br /&gt;
exec env - PATH=&amp;quot;$VQ/bin:/usr/local/bin:/usr/bin:/bin&amp;quot; \&lt;br /&gt;
  multilog t n1024 s1048576 ./main \&lt;br /&gt;
    '-*' '+*ver: status:*' =lstatus&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JMS calls it “service-any-log-run” because you can use it to log any service you want to, such as qmail-send, qmail-smtpd, etc. He uses the technique of using relative file name instead of absolute file names. That means that if this script it run under qmail-send/log/ directory, it will create a file “main” over there. The cryptic line at the end of the script is basically removal of all log lines except the ones with “ver” and “status” in them. This indicated minimal logging being done. Default is that all lines will be logged.  He is keeping 1024 generations of this log file (n1024) , each one being 1MB in size (s1048576).&lt;br /&gt;
&lt;br /&gt;
For detailed explanation of multilog options, look here: http://cr.yp.to/daemontools/multilog.html&lt;br /&gt;
&lt;br /&gt;
Alright, the final version of my  /var/qmail/supervise/qmail-send/log/run file looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;gt; /var/qmail/supervise/qmail-send/log/run &amp;lt;&amp;lt; EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin&lt;br /&gt;
export PATH&lt;br /&gt;
exec setuidgid qmaill multilog t s50000000 n20 /var/log/qmail/qmail-send 2&amp;gt;&amp;amp;1&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look here for more explanations:&lt;br /&gt;
http://cr.yp.to/daemontools/multilog.html&lt;br /&gt;
http://qmail.jms1.net/logfiles.shtml&lt;br /&gt;
http://qmail.jms1.net/scripts/service-any-log-run &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== The qmail-smtpd/run file: ===&lt;br /&gt;
&lt;br /&gt;
Here is the LWQ version of the qmail-smtpd/run file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
QMAILDUID=`id -u qmaild`&lt;br /&gt;
NOFILESGID=`id -g qmaild`&lt;br /&gt;
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`&lt;br /&gt;
LOCAL=`head -1 /var/qmail/control/me`&lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;$QMAILDUID&amp;quot; -o -z &amp;quot;$NOFILESGID&amp;quot; -o -z &amp;quot;$MAXSMTPD&amp;quot; -o -z &amp;quot;$LOCAL&amp;quot; ]; then&lt;br /&gt;
    echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in&lt;br /&gt;
    echo /var/qmail/supervise/qmail-smtpd/run&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
if [ ! -f /var/qmail/control/rcpthosts ]; then&lt;br /&gt;
    echo &amp;quot;No /var/qmail/control/rcpthosts!&amp;quot;&lt;br /&gt;
    echo &amp;quot;Refusing to start SMTP listener because it'll create an open relay&amp;quot;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exec /usr/local/bin/softlimit -m 2000000 \&lt;br /&gt;
    /usr/local/bin/tcpserver -v -R -l &amp;quot;$LOCAL&amp;quot; -x /etc/tcp.smtp.cdb -c &amp;quot;$MAXSMTPD&amp;quot; \&lt;br /&gt;
        -u &amp;quot;$QMAILDUID&amp;quot; -g &amp;quot;$NOFILESGID&amp;quot; 0 smtp /var/qmail/bin/qmail-smtpd 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The QMR version of qmail-smtpd/run file is below. When the finalize_linux.script script is run in QMR part 9, this file gets copied as /var/qmail/supervise/qmail-smtpd/run file. The differences from LWQ are highlighted:&lt;br /&gt;
&lt;br /&gt;
[root@qmail freebsd]# cat /downloads/qmailrocks/scripts/finalize/freebsd/smtpd_run&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
QMAILDUID=`id -u vpopmail`&lt;br /&gt;
NOFILESGID=`id -g vpopmail`&lt;br /&gt;
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`&lt;br /&gt;
LOCAL=`head -1 /var/qmail/control/me`&lt;br /&gt;
if [ -z &amp;quot;$QMAILDUID&amp;quot; -o -z &amp;quot;$NOFILESGID&amp;quot; -o -z &amp;quot;$MAXSMTPD&amp;quot; -o -z &amp;quot;$LOCAL&amp;quot; ]; then&lt;br /&gt;
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in&lt;br /&gt;
echo /var/qmail/supervise/qmail-smtpd/run&lt;br /&gt;
exit 1&lt;br /&gt;
fi&lt;br /&gt;
if [ ! -f /var/qmail/control/rcpthosts ]; then&lt;br /&gt;
echo &amp;quot;No /var/qmail/control/rcpthosts!&amp;quot;&lt;br /&gt;
echo &amp;quot;Refusing to start SMTP listener because it'll create an open relay&amp;quot;&lt;br /&gt;
exit 1&lt;br /&gt;
fi&lt;br /&gt;
exec /usr/local/bin/softlimit -m 30000000 \&lt;br /&gt;
/usr/local/bin/tcpserver -v -R -l &amp;quot;$LOCAL&amp;quot; -x /etc/tcp.smtp.cdb -c &amp;quot;$MAXSMTPD&amp;quot; \&lt;br /&gt;
-u &amp;quot;$QMAILDUID&amp;quot; -g &amp;quot;$NOFILESGID&amp;quot; 0 smtp \&lt;br /&gt;
/var/qmail/bin/qmail-smtpd mail.example.com \&lt;br /&gt;
/usr/home/vpopmail/bin/vchkpw /usr/bin/true 2&amp;gt;&amp;amp;1&lt;br /&gt;
[root@qmail freebsd]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: [LWQ]: concurrencyincoming isn't a standard qmail control file. It's a feature of the above script. Also, that's -1 (dash one) on the LOCAL line and -l (dash ell) on the tcpserver line. &lt;br /&gt;
&lt;br /&gt;
Note: [LWQ]: The memory limit specified in the softlimit command may need to be raised depending upon your operating system and hardware platform. If attempts to connect to port 25 fail or remote systems are unable to send you mail, or you see a message like: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/bin/tcpserver: error while loading shared libraries:&lt;br /&gt;
libc.so.6: failed to map segment from shared object: Cannot allocate memory &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
, then try raising it to 3000000 or 4000000, or whatever you can afford based on your system resources.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: You will need to create the concurrencyincoming control file as used in the smtpd/run scripts above (IF you use above script, that is!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo 20 &amp;gt; /var/qmail/control/concurrencyincoming&lt;br /&gt;
chmod 644 /var/qmail/control/concurrencyincoming&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The strange thing is that why QMR's author is using vpopmail as QMAILUID and NOFILESGID variables?&lt;br /&gt;
&lt;br /&gt;
Answer: The following link ( http://qmail.jms1.net/upgrade-qmr.shtml) from JMS website clearly indicates the problems you may run into, IF you run qmail-smtpd as uid of vpopmail. Here is the explanation from the mentioned web-link:&lt;br /&gt;
&lt;br /&gt;
The qmail-smtpd program handles the server end of an SMTP connection. It was originally designed to run as the userid qmaild. However, the /service/qmail-smtp/run script that qmailrocks installs sets things up so that qmail-smtpd runs as the vpopmail user, which means that a bug in qmail-smtpd (or in any of the programs that it calls, such as qmail-scanner, clamav, or spamassassin) could possibly erase all of your users' mailboxes. Not cool.&lt;br /&gt;
My scripts set things up so that qmail-smtpd runs as the qmaild user, as djb originally designed it.&lt;br /&gt;
Why did qmailrocks change from djb's standard? qmailrocks sets things up to use vpopmail's vchkpw program to validate any AUTH commands. And in order for vchkpw to read the files which actually contain the passwords (or the MD5 hashes of the passwords, or the file containing login information to a mysql server with that information) it needs to run as the vpopmail user.&lt;br /&gt;
At some point in the past, somebody decided that the best way to allow vchkpw to access these files was to run qmail-smtpd as the vpopmail user, and apparently qmailrocks blindly copied that person's &amp;quot;run&amp;quot; script when putting the qmailrocks package together.&lt;br /&gt;
There are two alternatives to this, both of which are more secure:&lt;br /&gt;
You can give vchkpw the permissions it needs by making it &amp;quot;setuid&amp;quot;, so that no matter which userid starts the program, it will always run as the vpopmail user. To me this option makes more sense than running qmail-smtpd itself as the vpopmail user, since a malicious email crafted to take advantage of some as-yet unknown security hole in clamav, spamassassin, or qmail-scanner, would not be able to access or delete any messages from your users' mailboxes- becasue only vchkpw runs as the vpopmail user (which owns all of the vpopmail mailbox directories) while the other programs continue to run as the qmaild user (or the qscand user, if you run qmail-scanner the same way I do.)&lt;br /&gt;
The vfixpermissions script will make your vchkpw binary setuid, along with fixing the ownership and permissions of everything else under the vpopmail user's home directory (which is where vpopmail stores everything.)&lt;br /&gt;
The AUTH_CDB patch, which is part of the newer versions of the combined patch, allows you to create a .cdb file (I use the name &amp;quot;auth.cdb&amp;quot; for this) which contains the valid userids and their encrypted passwords, and make that one file readable to the userid as which qmail-smtpd runs.&lt;br /&gt;
Either option is preferable to making qmail-smtpd, plus all of the child processes it runs, run as the vpopmail user.&lt;br /&gt;
&lt;br /&gt;
== The qmail-smtpd/run file by JMS ==&lt;br /&gt;
The qmail-smtpd/run file by JMS is quite big. Download-able from (http://qmail.jms1.net/scripts/service-qmail-smtpd-run) . It has a lot of options in it, which are explained here: http://qmail.jms1.net/scripts/service-qmail-smtpd-run.shtml &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /downlaods&lt;br /&gt;
wget http://qmail.jms1.net/scripts/service-qmail-smtpd-run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let's have a look at the script :-)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail downloads]# cat service-qmail-smtpd-run &lt;br /&gt;
#!/bin/sh                                           &lt;br /&gt;
#                                                   &lt;br /&gt;
# service-qmail-smtpd-run (formerly &amp;quot;run.smtp&amp;quot; and &amp;quot;run.smtp.sslserver&amp;quot;)&lt;br /&gt;
# John Simpson &amp;lt;jms1@jms1.net&amp;gt; 2003-07-05 to 2008-03-24                 &lt;br /&gt;
#                                                                       &lt;br /&gt;
# Generic daemontools &amp;quot;run&amp;quot; script for qmail &amp;quot;smtp&amp;quot; or &amp;quot;smtpssl&amp;quot; service.&lt;br /&gt;
#                                                                        &lt;br /&gt;
# Documentation: http://qmail.jms1.net/scripts/service-qmail-smtpd-run.shtml&lt;br /&gt;
&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1&lt;br /&gt;
VQ=&amp;quot;/var/qmail&amp;quot;&lt;br /&gt;
PATH=&amp;quot;$VQ/bin:/usr/local/bin:/usr/bin:/bin&amp;quot;&lt;br /&gt;
QUSER=qmaild                               &lt;br /&gt;
LOCAL=`head -1 $VQ/control/me`             &lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options for tcpserver/sslserver                                              &lt;br /&gt;
&lt;br /&gt;
IP=unset&lt;br /&gt;
PORT=25 &lt;br /&gt;
SSL=0   &lt;br /&gt;
SSL_CERT=&amp;quot;$VQ/control/servercert.pem&amp;quot;&lt;br /&gt;
SMTP_CDB=&amp;quot;/etc/tcp/smtp.cdb&amp;quot;         &lt;br /&gt;
MAX=30                               &lt;br /&gt;
&lt;br /&gt;
# these require the &amp;quot;tcpserver limits&amp;quot; patch for ucspi-tcp, available here:&lt;br /&gt;
# http://linux.voyager.hr/ucspi-tcp/                                       &lt;br /&gt;
&lt;br /&gt;
#MAXLOAD=750&lt;br /&gt;
#MAXCONNIP=2&lt;br /&gt;
#MAXCONNC=5 &lt;br /&gt;
#DIEMSG=&amp;quot;421 $LOCAL Service temporarily unavailable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# my newer version of the tcpserver limits patch allows you to specify&lt;br /&gt;
# individual DIEMSG values for each policy.                           &lt;br /&gt;
# http://qmail.jms1.net/ucspi-tcp/                                    &lt;br /&gt;
&lt;br /&gt;
#DIEMSG_MAXLOAD=&amp;quot;421 $LOCAL Server busy, try again later.&amp;quot;&lt;br /&gt;
#DIEMSG_MAXCONNIP=&amp;quot;421 $LOCAL Too many connections from your IP.&amp;quot;&lt;br /&gt;
#DIEMSG_MAXCONNC=&amp;quot;421 $LOCAL Too many connections from your network.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options for programs which run before qmail-smtpd                            &lt;br /&gt;
&lt;br /&gt;
#RBLSMTPD_PROG=&amp;quot;rblsmtpd&amp;quot;&lt;br /&gt;
#RBL_GOOD=&amp;quot;&amp;quot;             &lt;br /&gt;
#RBL_BAD=&amp;quot;zen.spamhaus.org dnsbl.njabl.org dnsbl.sorbs.net bl.spamcop.net&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#GREYLIST=&amp;quot;jgreylist&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#JGREYLIST_DIR=&amp;quot;$VQ/jgreylist&amp;quot;&lt;br /&gt;
#JGREYLIST_NOREV=1            &lt;br /&gt;
#JGREYLIST_BY_IP=0            &lt;br /&gt;
#JGREYLIST_HOLDTIME=120       &lt;br /&gt;
#JGREYLIST_LOG=1              &lt;br /&gt;
#JGREYLIST_LOG_PID=1          &lt;br /&gt;
#JGREYLIST_LOG_SMTP=0         &lt;br /&gt;
#JGREYLIST_TIMEOUT=60         &lt;br /&gt;
#JGREYLIST_LIMIT=0            &lt;br /&gt;
&lt;br /&gt;
#RECORDIO=&amp;quot;recordio&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options for qmail-smtpd itself                                               &lt;br /&gt;
&lt;br /&gt;
SMTPD=&amp;quot;qmail-smtpd&amp;quot;&lt;br /&gt;
#SMTPGREETING=&amp;quot;$LOCAL NO UCE&amp;quot;&lt;br /&gt;
#GREETDELAY=30               &lt;br /&gt;
#DROP_PRE_GREET=1            &lt;br /&gt;
FORCE_TLS=0                  &lt;br /&gt;
DENY_TLS=0                   &lt;br /&gt;
MFCHECK=3                    &lt;br /&gt;
#MAXRCPT=100                 &lt;br /&gt;
#RELAYREJ=1                  &lt;br /&gt;
QMAILSMTPD_LOG_MAIL=1        &lt;br /&gt;
QMAILSMTPD_LOG_RCPT=1        &lt;br /&gt;
#QMAILSMTPD_HELP_VERSION=1   &lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options pertaining to the AUTH command.                                      &lt;br /&gt;
&lt;br /&gt;
AUTH=0&lt;br /&gt;
REQUIRE_AUTH=0&lt;br /&gt;
ALLOW_INSECURE_AUTH=0&lt;br /&gt;
&lt;br /&gt;
# if using the AUTH_CDB method&lt;br /&gt;
#AUTH_CDB=&amp;quot;$VQ/control/auth.cdb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# if using the CHECKPW method&lt;br /&gt;
CHECKPW=~vpopmail/bin/vchkpw &lt;br /&gt;
TRUE=`which true`            &lt;br /&gt;
&lt;br /&gt;
# to change the environment whenever somebody authenticates&lt;br /&gt;
#AUTH_SET_MFCHECK=0                                        &lt;br /&gt;
#AUTH_SET_MAXRCPT=0                                        &lt;br /&gt;
#AUTH_SET_DATABYTES=0                                      &lt;br /&gt;
#AUTH_SET_SPFBEHAVIOR=1                                    &lt;br /&gt;
#AUTH_SET_VALIDRCPTTO_LIMIT=10                             &lt;br /&gt;
#AUTH_SET_VALIDRCPTTO_LOG=1                                &lt;br /&gt;
#AUTH_SET_SPF_LOG=1                                        &lt;br /&gt;
#AUTH_SET_RELAYREJ=0                                       &lt;br /&gt;
#AUTH_SET_VALIDRCPTTO_CDB=&amp;quot;&amp;quot;                               &lt;br /&gt;
#AUTH_SET_QMAILSMTPD_LOG_MAIL=1                            &lt;br /&gt;
#AUTH_SET_QMAILSMTPD_LOG_RCPT=1                            &lt;br /&gt;
#AUTH_SET_QMAILSMTPD_HELP_VERSION=1                        &lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options pertaining to the &amp;quot;validrcptto.cdb&amp;quot; mechanism.                       &lt;br /&gt;
# see http://qmail.jms1.net/patches/validrcptto.cdb.shtml for details.         &lt;br /&gt;
&lt;br /&gt;
VALIDRCPTTO_CDB=&amp;quot;$VQ/control/validrcptto.cdb&amp;quot;&lt;br /&gt;
VALIDRCPTTO_LIMIT=10                         &lt;br /&gt;
VALIDRCPTTO_LOG=2                            &lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options pertaining to the SPF mechanism.                                     &lt;br /&gt;
&lt;br /&gt;
SPFBEHAVIOR=3&lt;br /&gt;
SPF_LOG=1    &lt;br /&gt;
SPF_BLOCK_PLUS_ALL=1&lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options pertaining to the Domainkeys mechanism.                              &lt;br /&gt;
# this requires an add-on patch.                                               &lt;br /&gt;
&lt;br /&gt;
#DOMAINKEYS=0&lt;br /&gt;
#DKVERIFY=DEfGhIJK&lt;br /&gt;
#AUTH_SET_DKSIGN=/etc/domainkeys/%/default&lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# options for programs which run after qmail-smtpd                             &lt;br /&gt;
&lt;br /&gt;
# if you are using simscan...&lt;br /&gt;
&lt;br /&gt;
#QMAILQUEUE=&amp;quot;$VQ/bin/simscan&amp;quot;&lt;br /&gt;
NOP0FCHECK=1                 &lt;br /&gt;
#SIMSCAN_DEBUG=0             &lt;br /&gt;
#SIMSCAN_DEBUG_FILES=0       &lt;br /&gt;
&lt;br /&gt;
# if you are using qmail-scanner, un-comment ONE of these lines.&lt;br /&gt;
&lt;br /&gt;
#QMAILQUEUE=&amp;quot;$VQ/bin/qmail-scanner-queue&amp;quot;&lt;br /&gt;
#QMAILQUEUE=&amp;quot;$VQ/bin/qmail-scanner-queue.pl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# if you're using some other qmail-queue replacement, add your own line here&lt;br /&gt;
# with the correct value.                                                   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
###############################################################################&lt;br /&gt;
###############################################################################&lt;br /&gt;
###############################################################################&lt;br /&gt;
#                                                                              &lt;br /&gt;
# THERE SHOULD BE NO NEED TO CHANGE ANYTHING BELOW THIS LINE. of course, the   &lt;br /&gt;
# script is on your system and you're free to edit it however you want, but    &lt;br /&gt;
# changing things below this point may cause strange things to happen. make    &lt;br /&gt;
# sure you understand what you're doing if you change anything below...        &lt;br /&gt;
&lt;br /&gt;
QDUID=`id -u $QUSER`&lt;br /&gt;
QDGID=`id -g $QUSER`&lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;$IP&amp;quot; -o &amp;quot;$IP&amp;quot; = &amp;quot;unset&amp;quot; ]&lt;br /&gt;
then                              &lt;br /&gt;
        echo &amp;quot;The IP variable is not set in the run script. Cannot start.&amp;quot;&lt;br /&gt;
        sleep 5                                                           &lt;br /&gt;
        exit 1                                                            &lt;br /&gt;
fi                                                                        &lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;$QDUID&amp;quot; -o -z &amp;quot;$QDGID&amp;quot; -o -z &amp;quot;$MAX&amp;quot; -o -z &amp;quot;$LOCAL&amp;quot; \&lt;br /&gt;
        -o -z &amp;quot;$SSL&amp;quot; -o -z &amp;quot;$AUTH&amp;quot; ]                         &lt;br /&gt;
then                                                         &lt;br /&gt;
        echo &amp;quot;One of the variables QDUID, QDGID, MAX, LOCAL, SSL, or AUTH&amp;quot;&lt;br /&gt;
        echo &amp;quot;is not set in the run script. Cannot start.&amp;quot;                &lt;br /&gt;
        sleep 5                                                           &lt;br /&gt;
        exit 1                                                            &lt;br /&gt;
fi                                                                        &lt;br /&gt;
&lt;br /&gt;
if [ ! -f $VQ/control/rcpthosts ]&lt;br /&gt;
then                             &lt;br /&gt;
        echo Creating emtpy $VQ/control/rcpthosts file to prevent open relay.&lt;br /&gt;
        touch $VQ/control/rcpthosts                                          &lt;br /&gt;
        chmod 644 $VQ/control/rcpthosts                                      &lt;br /&gt;
fi                                                                           &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$SSL&amp;quot; = &amp;quot;1&amp;quot; ]&lt;br /&gt;
then               &lt;br /&gt;
        if ! which sslserver &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
        then                                 &lt;br /&gt;
                echo ERROR: sslserver not found in PATH [$PATH]&lt;br /&gt;
                exit 1                                         &lt;br /&gt;
        fi                                                     &lt;br /&gt;
&lt;br /&gt;
        if [ ! -f $SSL_CERT ]&lt;br /&gt;
        then                 &lt;br /&gt;
                echo ERROR: $SSL_CERT does not exist&lt;br /&gt;
                exit 1                              &lt;br /&gt;
        fi                                          &lt;br /&gt;
&lt;br /&gt;
        export CERTFILE=${SSL_CERT}&lt;br /&gt;
        export KEYFILE=&amp;quot;&amp;quot;          &lt;br /&gt;
        export DHFILE=&amp;quot;&amp;quot;           &lt;br /&gt;
&lt;br /&gt;
        SCMD=&amp;quot;sslserver -e&amp;quot;&lt;br /&gt;
else                       &lt;br /&gt;
        if [ -n &amp;quot;$SSL_CERT&amp;quot; ]&lt;br /&gt;
        then                 &lt;br /&gt;
                export TLS_SERVER_CERT=${SSL_CERT}&lt;br /&gt;
        fi                                        &lt;br /&gt;
&lt;br /&gt;
        SCMD=&amp;quot;tcpserver&amp;quot;&lt;br /&gt;
fi                      &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$IP&amp;quot; = &amp;quot;127.0.0.1&amp;quot; ]&lt;br /&gt;
then                      &lt;br /&gt;
        export RELAYCLIENT=&amp;quot;&amp;quot;&lt;br /&gt;
        RBLSMTPD_PROG=&amp;quot;&amp;quot;     &lt;br /&gt;
        ACMD=&amp;quot;&amp;quot;              &lt;br /&gt;
elif [ -z &amp;quot;${SMTP_CDB:-}&amp;quot; ]  &lt;br /&gt;
then                         &lt;br /&gt;
        ACMD=&amp;quot;&amp;quot;              &lt;br /&gt;
else                         &lt;br /&gt;
        if [ ! -f &amp;quot;$SMTP_CDB&amp;quot; ]&lt;br /&gt;
        then                   &lt;br /&gt;
                echo ERROR: $SMTP_CDB does not exist&lt;br /&gt;
                exit 1                              &lt;br /&gt;
        fi                                          &lt;br /&gt;
&lt;br /&gt;
        ACMD=&amp;quot;-x $SMTP_CDB&amp;quot;&lt;br /&gt;
fi                         &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$AUTH&amp;quot; = &amp;quot;1&amp;quot; ]&lt;br /&gt;
then                &lt;br /&gt;
        if [ -n &amp;quot;$AUTH_CDB&amp;quot; ]&lt;br /&gt;
        then                 &lt;br /&gt;
                if [ ! -f $AUTH_CDB ]&lt;br /&gt;
                then                 &lt;br /&gt;
                        echo ERROR: AUTH_CDB file [$AUTH_CDB] does not exist&lt;br /&gt;
                        exit 1                                              &lt;br /&gt;
                fi                                                          &lt;br /&gt;
&lt;br /&gt;
                export AUTH_CDB&lt;br /&gt;
                ARGS=&amp;quot;&amp;quot;        &lt;br /&gt;
        elif [ -n &amp;quot;$CHECKPW&amp;quot; ] &lt;br /&gt;
        then                   &lt;br /&gt;
                if [ ! -f $CHECKPW ]&lt;br /&gt;
                then                &lt;br /&gt;
                        echo ERROR: $CHECKPW [$CHECKPW] program does not exist&lt;br /&gt;
                        exit 1                                                &lt;br /&gt;
                fi                                                            &lt;br /&gt;
&lt;br /&gt;
                if [ -z &amp;quot;$LOCAL&amp;quot; ]&lt;br /&gt;
                then              &lt;br /&gt;
                        echo ERROR: LOCAL is not set in the run script&lt;br /&gt;
                        exit 1                                        &lt;br /&gt;
                elif [ -z &amp;quot;$TRUE&amp;quot; ]                                   &lt;br /&gt;
                then                                                  &lt;br /&gt;
                        echo ERROR: TRUE is not set in the run script &lt;br /&gt;
                        exit 1                                        &lt;br /&gt;
                elif [ ! -e $TRUE ]                                   &lt;br /&gt;
                then                                                  &lt;br /&gt;
                        echo ERROR: $TRUE [$TRUE] is not an executable&lt;br /&gt;
                        exit 1                                        &lt;br /&gt;
                fi                                                    &lt;br /&gt;
&lt;br /&gt;
                ARGS=&amp;quot; $LOCAL $CHECKPW $TRUE&amp;quot;&lt;br /&gt;
        else                                 &lt;br /&gt;
                echo ERROR: AUTH=1 but no AUTH_CDB or CHECKPW&lt;br /&gt;
                exit 1                                       &lt;br /&gt;
        fi                                                   &lt;br /&gt;
else                                                         &lt;br /&gt;
        ARGS=&amp;quot;&amp;quot;                                              &lt;br /&gt;
        AUTH_CDB=&amp;quot;&amp;quot;                                          &lt;br /&gt;
fi                                                           &lt;br /&gt;
&lt;br /&gt;
########################################&lt;br /&gt;
# make RBL command (if needed)          &lt;br /&gt;
&lt;br /&gt;
RBLCMD=&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ -n &amp;quot;$RBLSMTPD_PROG&amp;quot; ]&lt;br /&gt;
then                      &lt;br /&gt;
        if [ -n &amp;quot;$RBL_GOOD&amp;quot; ]&lt;br /&gt;
        then                 &lt;br /&gt;
                for name in $RBL_GOOD&lt;br /&gt;
                do                   &lt;br /&gt;
                        RBLCMD=&amp;quot;$RBLCMD -a $name&amp;quot;&lt;br /&gt;
                done                             &lt;br /&gt;
        fi                                       &lt;br /&gt;
&lt;br /&gt;
        if [ -n &amp;quot;$RBL_BAD&amp;quot; ]&lt;br /&gt;
        then                &lt;br /&gt;
                for name in $RBL_BAD&lt;br /&gt;
                do                  &lt;br /&gt;
                        RBLCMD=&amp;quot;$RBLCMD -r $name&amp;quot;&lt;br /&gt;
                done                             &lt;br /&gt;
        fi                                       &lt;br /&gt;
&lt;br /&gt;
        if [ -n &amp;quot;$RBLCMD&amp;quot; ]&lt;br /&gt;
        then               &lt;br /&gt;
                RBLCMD=&amp;quot;$RBLSMTPD_PROG -t0 $RBLCMD&amp;quot;&lt;br /&gt;
        fi                                         &lt;br /&gt;
fi                                                 &lt;br /&gt;
&lt;br /&gt;
########################################&lt;br /&gt;
# make domainkeys command (if needed)   &lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$DOMAINKEYS&amp;quot; = &amp;quot;1&amp;quot; ]&lt;br /&gt;
then                      &lt;br /&gt;
        if [ -f &amp;quot;$VQ/bin/qmail-dk&amp;quot; ]&lt;br /&gt;
        then                        &lt;br /&gt;
                if [ -n &amp;quot;$QMAILQUEUE&amp;quot; ]&lt;br /&gt;
                then                   &lt;br /&gt;
                        export DKQUEUE=&amp;quot;$QMAILQUEUE&amp;quot;&lt;br /&gt;
                fi                                  &lt;br /&gt;
                export AUTH_UNSET_DKVERIFY=1        &lt;br /&gt;
                export QMAILQUEUE=&amp;quot;$VQ/bin/qmail-dk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                if [ -n &amp;quot;$DKVERIFY&amp;quot; ] ; then export DKVERIFY ; fi&lt;br /&gt;
                if [ -n &amp;quot;$DKSIGN&amp;quot;   ] ; then export DKSIGN   ; fi&lt;br /&gt;
        else                                                     &lt;br /&gt;
                echo ERROR: $VQ/bin/qmail-dk not found, cannot use domainkeys&lt;br /&gt;
        fi                                                                   &lt;br /&gt;
fi                                                                           &lt;br /&gt;
&lt;br /&gt;
########################################&lt;br /&gt;
# handle variables which may not have been set, but need to exist even&lt;br /&gt;
# if they contain blank values                                        &lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;$RECORDIO&amp;quot; ]&lt;br /&gt;
then                 &lt;br /&gt;
        RECORDIO=&amp;quot;&amp;quot;  &lt;br /&gt;
fi                   &lt;br /&gt;
&lt;br /&gt;
if [ -z &amp;quot;$GREYLIST&amp;quot; ]&lt;br /&gt;
then                 &lt;br /&gt;
        GREYLIST=&amp;quot;&amp;quot;  &lt;br /&gt;
fi                   &lt;br /&gt;
&lt;br /&gt;
########################################&lt;br /&gt;
# do the deed                           &lt;br /&gt;
&lt;br /&gt;
for n in SSL                                    \&lt;br /&gt;
        MAXLOAD                                 \&lt;br /&gt;
        MAXCONNIP                               \&lt;br /&gt;
        MAXCONNC                                \&lt;br /&gt;
        DIEMSG                                  \&lt;br /&gt;
        DIEMSG_MAXLOAD                          \&lt;br /&gt;
        DIEMSG_MAXCONNIP                        \&lt;br /&gt;
        DIEMSG_MAXCONNC                         \&lt;br /&gt;
        JGREYLIST_DIR                           \&lt;br /&gt;
        JGREYLIST_NOREV                         \&lt;br /&gt;
        JGREYLIST_BY_IP                         \&lt;br /&gt;
        JGREYLIST_HOLDTIME                      \&lt;br /&gt;
        JGREYLIST_LOG                           \&lt;br /&gt;
        JGREYLIST_LOG_PID                       \&lt;br /&gt;
        JGREYLIST_LOG_SMTP                      \&lt;br /&gt;
        JGREYLIST_TIMEOUT                       \&lt;br /&gt;
        JGREYLIST_LIMIT                         \&lt;br /&gt;
        SMTPGREETING                            \&lt;br /&gt;
        GREETDELAY                              \&lt;br /&gt;
        DROP_PRE_GREET                          \&lt;br /&gt;
        FORCE_TLS                               \&lt;br /&gt;
        DENY_TLS                                \&lt;br /&gt;
        MFCHECK                                 \&lt;br /&gt;
        MAXRCPT                                 \&lt;br /&gt;
        RELAYREJ                                \&lt;br /&gt;
        QMAILSMTPD_LOG_MAIL                     \&lt;br /&gt;
        QMAILSMTPD_LOG_RCPT                     \&lt;br /&gt;
        QMAILSMTPD_HELP_VERSION                 \&lt;br /&gt;
        REQUIRE_AUTH                            \&lt;br /&gt;
        ALLOW_INSECURE_AUTH                     \&lt;br /&gt;
        AUTH_CDB                                \&lt;br /&gt;
        AUTH_SET_MFCHECK                        \&lt;br /&gt;
        AUTH_SET_MAXRCPT                        \&lt;br /&gt;
        AUTH_SET_DATABYTES                      \&lt;br /&gt;
        AUTH_SET_SPFBEHAVIOR                    \&lt;br /&gt;
        AUTH_SET_VALIDRCPTTO_LIMIT              \&lt;br /&gt;
        AUTH_SET_VALIDRCPTTO_LOG                \&lt;br /&gt;
        AUTH_SET_SPF_LOG                        \&lt;br /&gt;
        AUTH_SET_RELAYREJ                       \&lt;br /&gt;
        AUTH_SET_VALIDRCPTTO_CDB                \&lt;br /&gt;
        AUTH_SET_QMAILSMTPD_LOG_MAIL            \&lt;br /&gt;
        AUTH_SET_QMAILSMTPD_LOG_RCPT            \&lt;br /&gt;
        AUTH_SET_QMAILSMTPD_HELP_VERSION        \&lt;br /&gt;
        VALIDRCPTTO_CDB                         \&lt;br /&gt;
        VALIDRCPTTO_LIMIT                       \&lt;br /&gt;
        VALIDRCPTTO_LOG                         \&lt;br /&gt;
        SPFBEHAVIOR                             \&lt;br /&gt;
        SPF_LOG                                 \&lt;br /&gt;
        SPF_BLOCK_PLUS_ALL                      \&lt;br /&gt;
        DKVERIFY                                \&lt;br /&gt;
        AUTH_SET_DKSIGN                         \&lt;br /&gt;
        QMAILQUEUE                              \&lt;br /&gt;
        NOP0FCHECK                              \&lt;br /&gt;
        SIMSCAN_DEBUG                           \&lt;br /&gt;
        SIMSCAN_DEBUG_FILES&lt;br /&gt;
do&lt;br /&gt;
        # note: not 100% sure &amp;quot;eval&amp;quot; works under old-school /bin/sh&lt;br /&gt;
        eval &amp;quot;if [ -n \&amp;quot;\$$n\&amp;quot; ];then echo \&amp;quot;$n=\\\&amp;quot;\$$n\\\&amp;quot;\&amp;quot;;export $n;fi&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
CMD=&amp;quot;$SCMD -vR -l $LOCAL -c $MAX -u $QDUID -g $QDGID $ACMD $IP $PORT&amp;quot;&lt;br /&gt;
CMD=&amp;quot;$CMD $RBLCMD $GREYLIST $RECORDIO $SMTPD $ARGS&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;command-line: exec $CMD 2&amp;gt;&amp;amp;1&amp;quot;&lt;br /&gt;
exec $CMD 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
########################################&lt;br /&gt;
# this will only be reached if the exec fails&lt;br /&gt;
&lt;br /&gt;
echo ERROR: command did not run correctly&lt;br /&gt;
exit 1&lt;br /&gt;
[root@qmail downloads]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is the short summary of the tcpserver options used in the qmail-smtpd/run scripts shown above. Details about the tcpserver command/program can be studied from the following location:  http://cr.yp.to/ucspi-tcp/tcpserver.html .&lt;br /&gt;
&lt;br /&gt;
=== Summary of tcpserver options:===&lt;br /&gt;
Syntax:     tcpserver opts host port prog&lt;br /&gt;
&lt;br /&gt;
Where:   opts is a series of getopt-style options; host is one argument; port is one argument; prog consists of one or more arguments. &lt;br /&gt;
tcpserver waits for connections from TCP clients. For each connection, it runs prog, with descriptor 0 reading from the network and descriptor 1 writing to the network. It also sets up several environment variables. &lt;br /&gt;
&lt;br /&gt;
==== General options: ====&lt;br /&gt;
-v: Verbose. Print error messages and status messages. &lt;br /&gt;
&lt;br /&gt;
==== Connection options: ====&lt;br /&gt;
* -c n: Do not handle more than n simultaneous connections. If there are n simultaneous copies of prog running, defer acceptance of a new connection until one copy finishes. n must be a positive integer. Default: 40. &lt;br /&gt;
* -x cdb: Follow the rules compiled into cdb by tcprules. These rules may specify setting environment variables or rejecting connections from bad sources. You can rerun tcprules to change the rules while tcpserver is running. &lt;br /&gt;
* -g gid: Switch group ID to gid after preparing to receive connections. gid must be a positive integer. &lt;br /&gt;
* -u uid: Switch user ID to uid after preparing to receive connections. uid must be a positive integer. &lt;br /&gt;
* -1: After preparing to receive connections, print the local port number to standard output. &lt;br /&gt;
Data-gathering options: &lt;br /&gt;
* -l localname: Do not look up the local host name in DNS; use localname for the environment variable $TCPLOCALHOST. A common choice for localname is 0. To avoid loops, you must use this option for servers on TCP port 53. &lt;br /&gt;
* -R: Do not attempt to obtain $TCPREMOTEINFO from the remote host. To avoid loops, you must use this option for servers on TCP ports 53 and 113. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== the softlimit program  ===&lt;br /&gt;
A little explanation of the softlimit program (by DJB), from the link: http://cr.yp.to/daemontools/softlimit.html &lt;br /&gt;
&lt;br /&gt;
softlimit runs another program with new resource limits. &lt;br /&gt;
Syntax: softlimit opts child&lt;br /&gt;
Where: opts is a series of getopt-style options; child consists of one or more arguments.  softlimit sets soft resource limits as specified by opts. It then runs child program. &lt;br /&gt;
&lt;br /&gt;
Options&lt;br /&gt;
In each of the following options, n may be =, indicating that the soft limit should be set equal to the hard limit. &lt;br /&gt;
&lt;br /&gt;
==== Options controlling memory use: ====&lt;br /&gt;
* -m n: Same as -d n -s n -l n -a n. &lt;br /&gt;
* -d n: Limit the data segment per process to n bytes. &lt;br /&gt;
* -s n: Limit the stack segment per process to n bytes. &lt;br /&gt;
* -l n: Limit the locked physical pages per process to n bytes. This option has no effect on some operating systems. &lt;br /&gt;
* -a n: Limit the total of all segments per process to n bytes. This option has no effect on some operating systems. &lt;br /&gt;
* -o n: Limit the number of open file descriptors per process to n. This option has no effect on some operating systems. &lt;br /&gt;
* -p n: Limit the number of processes per uid to n. &lt;br /&gt;
Options controlling file sizes: &lt;br /&gt;
* -f n: Limit output file sizes to n bytes. &lt;br /&gt;
* -c n: Limit core file sizes to n bytes. &lt;br /&gt;
&lt;br /&gt;
==== Efficiency options: ====&lt;br /&gt;
* -r n: Limit the resident set size to n bytes. This limit is not enforced unless physical memory is full. &lt;br /&gt;
* -t n: Limit the CPU time to n seconds. This limit is not enforced except that the process receives a SIGXCPU signal after n seconds. &lt;br /&gt;
&lt;br /&gt;
Notice that JMS does not use softlimit in his qmail-smtpd/run script. The reason I see is that in modern linux systems the limits can be controlled through /etc/security/limits.conf file. And more importantly most of the limits are now controlled by the kernel itself, in the shape of better resource management. So apparently there is no need to run your programs as a softlimit's child. [Anyone with a better explanation?]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Conclusion for qmail-smtpd/run script: ===&lt;br /&gt;
&lt;br /&gt;
Copy the downloaded smtpd-run file to /var/qmail/supervise/qmail-smtpd/run . &lt;br /&gt;
&lt;br /&gt;
# cp /downloads/service-qmail-smtpd-run /var/qmail/supervise/qmail-smtpd/run&lt;br /&gt;
&lt;br /&gt;
Before we go on and edit the file, I would advise you to check the list/details of patches, on this location (http://qmail.jms1.net/patches/combined-details.shtml), which  JMS has included in his combined patch. It is a 22 page document , if you print it on A4 size paper! This wwould definitely help us what to select / enable, and what not. &lt;br /&gt;
&lt;br /&gt;
It mainly contains vpopmail passwd program, Grey Listing checks, Delays, SPF, RBL, AUTH mechanism, DomainKeys QmailScanner, etc.&lt;br /&gt;
&lt;br /&gt;
I have still not installed the grey-listing software, Qmail-Scanner, and domain keys. So I have not enabled them yet in this qmail-smtpd/run script.&lt;br /&gt;
&lt;br /&gt;
Edit this file and adjust according to your needs. (The SMTP_CDB needs to be updated. It should not be /etc/tcp/smtp.cdb  . This is updated after encountering an error a little later.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vi /var/qmail/supervise/qmail-smtpd/run&lt;br /&gt;
#(my configuration part of the script looks like this):&lt;br /&gt;
exec 2&amp;gt;&amp;amp;1                                                                   &lt;br /&gt;
VQ=&amp;quot;/var/qmail&amp;quot;                                                             &lt;br /&gt;
PATH=&amp;quot;$VQ/bin:/usr/local/bin:/usr/bin:/bin&amp;quot;                                 &lt;br /&gt;
QUSER=qmaild                                                                &lt;br /&gt;
LOCAL=`head -1 $VQ/control/me`                                              &lt;br /&gt;
IP=192.168.122.90                                                           &lt;br /&gt;
PORT=25                                                                     &lt;br /&gt;
SSL=0                                                                       &lt;br /&gt;
#SSL_CERT=&amp;quot;$VQ/control/servercert.pem&amp;quot;                                       &lt;br /&gt;
SMTP_CDB=&amp;quot;/etc/tcp/smtp.cdb&amp;quot;                                                &lt;br /&gt;
MAX=30                                                                      &lt;br /&gt;
MAXLOAD=150                                                                 &lt;br /&gt;
MAXCONNIP=2                                                                 &lt;br /&gt;
MAXCONNC=5                                                                  &lt;br /&gt;
DIEMSG=&amp;quot;421 $LOCAL Service temporarily unavailable&amp;quot;                         &lt;br /&gt;
DIEMSG_MAXLOAD=&amp;quot;421 $LOCAL Server busy, try again later.&amp;quot;                   &lt;br /&gt;
DIEMSG_MAXCONNIP=&amp;quot;421 $LOCAL Too many connections from your IP.&amp;quot;            &lt;br /&gt;
DIEMSG_MAXCONNC=&amp;quot;421 $LOCAL Too many connections from your network.&amp;quot;        &lt;br /&gt;
RBLSMTPD_PROG=&amp;quot;rblsmtpd&amp;quot;                                                    &lt;br /&gt;
RBL_GOOD=&amp;quot;&amp;quot;                                                                 &lt;br /&gt;
RBL_BAD=&amp;quot;zen.spamhaus.org bl.spamcop.net&amp;quot;                                   &lt;br /&gt;
SMTPD=&amp;quot;qmail-smtpd&amp;quot;                                                         &lt;br /&gt;
SMTPGREETING=&amp;quot;$LOCAL NO UCE&amp;quot;                                                &lt;br /&gt;
#GREETDELAY=30                                                               &lt;br /&gt;
DROP_PRE_GREET=1                                                            &lt;br /&gt;
FORCE_TLS=0                                                                 &lt;br /&gt;
DENY_TLS=0                                                                  &lt;br /&gt;
MFCHECK=3                                                                   &lt;br /&gt;
MAXRCPT=100                                                                 &lt;br /&gt;
RELAYREJ=1                                                                  &lt;br /&gt;
QMAILSMTPD_LOG_MAIL=1                                                       &lt;br /&gt;
QMAILSMTPD_LOG_RCPT=1                                                       &lt;br /&gt;
QMAILSMTPD_HELP_VERSION=1                                                   &lt;br /&gt;
AUTH=0                                                                      &lt;br /&gt;
REQUIRE_AUTH=0                                                              &lt;br /&gt;
ALLOW_INSECURE_AUTH=0                                                       &lt;br /&gt;
#CHECKPW=~vpopmail/bin/vchkpw                                                &lt;br /&gt;
#TRUE=`which true`                                                           &lt;br /&gt;
#VALIDRCPTTO_CDB=&amp;quot;$VQ/control/validrcptto.cdb&amp;quot;                               &lt;br /&gt;
#VALIDRCPTTO_LIMIT=10                                                        &lt;br /&gt;
#VALIDRCPTTO_LOG=2                                                           &lt;br /&gt;
SPFBEHAVIOR=3                                                               &lt;br /&gt;
SPF_LOG=1                                                                   &lt;br /&gt;
SPF_BLOCK_PLUS_ALL=1                                &lt;br /&gt;
. . . &lt;br /&gt;
. . . &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: If you do not select the options correctly in the run file, your qmail will start, but when you try to connect to it, it will show you an error. Such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[kamran@kworkbee ~]$ telnet qmail.example.com 25&lt;br /&gt;
Trying 192.168.122.90...&lt;br /&gt;
Connected to qmail.example.com.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
421 unable to read controls (#4.3.0)&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
[kamran@kworkbee ~]$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, the tip is to enable few things at a time and work gradually to a securer system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Time to create the qmail-smtpd/log/run file:&lt;br /&gt;
&lt;br /&gt;
The qmail-smtpd/log/run file:-&lt;br /&gt;
&lt;br /&gt;
Now is the time to create the /var/qmail/supervise/qmail-smtpd/log/run file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat &amp;gt; /var/qmail/supervise/qmail-smtpd/log/run &amp;lt;&amp;lt; EOF&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin&lt;br /&gt;
export PATH&lt;br /&gt;
exec setuidgid qmaill multilog t s50000000 n20 /var/log/qmail/qmail-smtpd 2&amp;gt;&amp;amp;1&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the run files executable [LWQ]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    chmod 755 /var/qmail/supervise/qmail-send/run&lt;br /&gt;
    chmod 755 /var/qmail/supervise/qmail-send/log/run&lt;br /&gt;
    chmod 755 /var/qmail/supervise/qmail-smtpd/run&lt;br /&gt;
    chmod 755 /var/qmail/supervise/qmail-smtpd/log/run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then set up the log directories[LWQ]:&lt;br /&gt;
Note: We have already setup log directories a while ago, with a slight modification. So we will not execute the following three lines. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    mkdir /var/log/qmail&lt;br /&gt;
    mkdir -p /var/log/qmail/smtpd&lt;br /&gt;
    chown qmaill /var/log/qmail /var/log/qmail/smtpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, link the supervise directories into /service. However, please note that the qmail system will start automatically shortly after these links are created. So at this point you should make sure that no service is running on port 25, such as sendmail, postfix or exim. If they are running, it is time to stop them:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service sendmail stop&lt;br /&gt;
service exim stop&lt;br /&gt;
service postfix stop&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# netstat -antp&lt;br /&gt;
Active Internet connections (servers and established)&lt;br /&gt;
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name&lt;br /&gt;
tcp        0      0 :::22                       :::*                        LISTEN      1799/sshd&lt;br /&gt;
tcp        0      0 ::ffff:192.168.122.90:22    ::ffff:192.168.122.1:56432  ESTABLISHED 2031/0&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good! No SMTP software running. So lets link the qmail supervise directories into /service .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -s /var/qmail/supervise/qmail-send   /var/qmail/supervise/qmail-smtpd   /service&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The /service directory is created when daemontools is installed.&lt;br /&gt;
&lt;br /&gt;
As mentioned just now, the qmail system would now be running. Lets check:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# qmailctl stat&lt;br /&gt;
/service/qmail-send: up (pid 17094) 3 seconds&lt;br /&gt;
/service/qmail-send/log: up (pid 17095) 3 seconds&lt;br /&gt;
/service/qmail-smtpd: up (pid 17116) 1 seconds&lt;br /&gt;
/service/qmail-smtpd/log: up (pid 17098) 3 seconds&lt;br /&gt;
messages in queue: 0&lt;br /&gt;
messages in queue but not yet preprocessed: 0&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The qmail-smtpd service seems to be stuck at 1 second. This is not good. Lets try to find the reason:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# tail /var/log/qmail/qmail-smtpd/current&lt;br /&gt;
@400000004a8d955234dccc7c ERROR: /etc/tcp/smtp.cdb does not exist&lt;br /&gt;
@400000004a8d955336fb5b04 ERROR: /etc/tcp/smtp.cdb does not exist&lt;br /&gt;
@400000004a8d9554382e1a5c ERROR: /etc/tcp/smtp.cdb does not exist&lt;br /&gt;
@400000004a8d95553982bd7c ERROR: /etc/tcp/smtp.cdb does not exist&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ahan!&lt;br /&gt;
&lt;br /&gt;
Actually the qmail-smtpd/run file by JMS is looking for a the tcprules file named /etc/tcp/smtp.cdb . Whereas LWQ asks us to create a file named /etc/tcp.smtp . (I have still not created the file using the LWQ method as well). This means we have to adjust this value in qmail-smtpd/run script by JMS.&lt;br /&gt;
&lt;br /&gt;
We know that in qmailctl file, we have a section as :-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  cdb)&lt;br /&gt;
    tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp &amp;lt; /etc/tcp.smtp&lt;br /&gt;
    chmod 644 /etc/tcp.smtp.cdb&lt;br /&gt;
    echo &amp;quot;Reloaded /etc/tcp.smtp.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means the compiled tcprules file is /etc/tcp.smtp.cdb . “not” /etc/tcp/smtp.cdb . This may be a typo from JMS or just a different location by his own preference. Lets adjust that (to /etc/tcp.smtp.cdb) in the qmail-smtpd/run file we downloaded from JMS site accordingly:-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SMTP_CDB=&amp;quot;/etc/tcp.smtp.cdb&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also the right time to create the tcprules file. In LWQ, it is titled as SMTP Access Control. &lt;br /&gt;
&lt;br /&gt;
Allow the local host to inject mail via SMTP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo '127.:allow,RELAYCLIENT=&amp;quot;&amp;quot;' &amp;gt;&amp;gt;/etc/tcp.smtp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now execute the following command to compile CDB rules: [LWQ]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qmailctl cdb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now lets stop qmail and start it again. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
qmailctl stop&lt;br /&gt;
qmailctl start&lt;br /&gt;
&lt;br /&gt;
# wait for a few seconds here&lt;br /&gt;
qmail stat&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# qmailctl stat&lt;br /&gt;
/service/qmail-send: up (pid 18357) 17 seconds&lt;br /&gt;
/service/qmail-send/log: up (pid 18356) 17 seconds&lt;br /&gt;
/service/qmail-smtpd: up (pid 18360) 17 seconds&lt;br /&gt;
/service/qmail-smtpd/log: up (pid 18361) 17 seconds&lt;br /&gt;
messages in queue: 0&lt;br /&gt;
messages in queue but not yet preprocessed: 0&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alhumdulillah. As you can see, now your qmail-send and qmail-smtpd (and their respective log services) are all up for the same amount of time. This indicates all is well. Check through netstat as well:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# netstat -antp&lt;br /&gt;
Active Internet connections (servers and established)&lt;br /&gt;
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name&lt;br /&gt;
tcp        0      0 192.168.122.90:25           0.0.0.0:*                   LISTEN      2012/tcpserver&lt;br /&gt;
tcp        0      0 :::22                       :::*                        LISTEN      1799/sshd&lt;br /&gt;
tcp        0      0 ::ffff:192.168.122.90:22    ::ffff:192.168.122.1:56432  ESTABLISHED 2031/0&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plus, you will also see the following in the log files. Just to make sure things are good.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# tail -f /var/log/qmail/qmail-smtpd/current &lt;br /&gt;
. . . &lt;br /&gt;
. . . &lt;br /&gt;
@400000004a8d98fc2ced80c4 SSL=&amp;quot;0&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cf06adc MAXLOAD=&amp;quot;150&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cf1f564 MAXCONNIP=&amp;quot;2&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cf43784 MAXCONNC=&amp;quot;5&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cf5cdc4 DIEMSG=&amp;quot;421 qmail.example.com Service temporarily unavailable&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cf8a06c DIEMSG_MAXLOAD=&amp;quot;421 qmail.example.com Server busy, try again later.&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cfa59d4 DIEMSG_MAXCONNIP=&amp;quot;421 qmail.example.com Too many connections from your IP.&amp;quot;&lt;br /&gt;
@400000004a8d98fc2cfca7ac DIEMSG_MAXCONNC=&amp;quot;421 qmail.example.com Too many connections from your network.&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d09135c SMTPGREETING=&amp;quot;qmail.example.com NO UCE&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d0cd064 DROP_PRE_GREET=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d0e7a2c FORCE_TLS=&amp;quot;0&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d10106c DENY_TLS=&amp;quot;0&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d123f04 MFCHECK=&amp;quot;3&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d13bdd4 MAXRCPT=&amp;quot;100&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d16425c RELAYREJ=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d180f4c QMAILSMTPD_LOG_MAIL=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d1a3de4 QMAILSMTPD_LOG_RCPT=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d1c0ad4 QMAILSMTPD_HELP_VERSION=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d1e5c94 REQUIRE_AUTH=&amp;quot;0&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d20065c ALLOW_INSECURE_AUTH=&amp;quot;0&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d37cc4c SPFBEHAVIOR=&amp;quot;3&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d394f04 SPF_LOG=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d3bbc1c SPF_BLOCK_PLUS_ALL=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d40964c NOP0FCHECK=&amp;quot;1&amp;quot;&lt;br /&gt;
@400000004a8d98fc2d45aefc command-line: exec tcpserver -vR -l qmail.example.com -c 30 -u 702 -g 700 -x /etc/tcp.smtp.cdb 192.168.122.90 25 rblsmtpd -t0  -r zen.spamhaus.org -r bl.spamcop.net   qmail-smtpd  2&amp;gt;&amp;amp;1&lt;br /&gt;
@400000004a8d98fc2d6d0d1c tcpserver: status: 0/30&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
qmail-smtpd seems good!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail ~]# tail -f /var/log/qmail/qmail-send/current&lt;br /&gt;
. . . &lt;br /&gt;
@400000004a8d949a05aab4dc status: local 0/10 remote 0/20&lt;br /&gt;
@400000004a8d94ab0fdfdd9c status: qmail-todo stop processing asap&lt;br /&gt;
@400000004a8d94ab0fe000c4 status: exiting&lt;br /&gt;
@400000004a8d94b32d8c87b4 status: local 0/10 remote 0/20&lt;br /&gt;
@400000004a8d95411e2ad8d4 status: qmail-todo stop processing asap&lt;br /&gt;
@400000004a8d95411e2afbfc status: exiting&lt;br /&gt;
@400000004a8d95411f7f1664 status: local 0/10 remote 0/20&lt;br /&gt;
@400000004a8d98fc29f2ea1c status: qmail-todo stop processing asap&lt;br /&gt;
@400000004a8d98fc29f3865c status: exiting&lt;br /&gt;
@400000004a8d98fc2c477cc4 status: local 0/10 remote 0/20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
qmail-send also seems good. &lt;br /&gt;
&lt;br /&gt;
Note: There is no log entry for these (qmail start / stop /error events) in /var/log/messages , or in /var/log/maillog .&lt;br /&gt;
&lt;br /&gt;
Alhumdulillah.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Linking of the supervise script directories in /service directory and the following line added in the /etc/inittab file ensures that the qmail service will be started at system boot time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tail /etc/inittab&lt;br /&gt;
SV:123456:respawn:/command/svscanboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; End of day &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Time to remove any other SMTP software from your system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -e sendmail sendmail-cf exim postfix --nodeps&lt;br /&gt;
&lt;br /&gt;
[root@qmail ~]# rpm -e sendmail sendmail-cf exim postfix --nodeps&lt;br /&gt;
error: package sendmail is not installed&lt;br /&gt;
error: package sendmail-cf is not installed&lt;br /&gt;
error: package postfix is not installed&lt;br /&gt;
[root@qmail ~]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note [LWQ]: If you're using an RPM-based Linux distribution like Red Hat, removing the MTA package might cause problems down the road. Utilities that update the system might try to reinstall Sendmail, or MUA packages might not install because they can't tell an MTA is installed. Mate Wierdl provides a stub package called &amp;quot;fake_mta&amp;quot; that can be installed to prevent these problems. Simply install the RPM available from ftp://ftp.csi.hu/mw/fake_mta-1-10memphis.noarch.rpm . &lt;br /&gt;
&lt;br /&gt;
I could not find the fake_mta on the net. (Purely my fault). So I am skipping it.&lt;br /&gt;
&lt;br /&gt;
[LWQ]: Lastly, replace any existing /usr/lib/sendmail with the qmail version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mv /usr/lib/sendmail /usr/lib/sendmail.old                  # ignore any errors&lt;br /&gt;
mv /usr/sbin/sendmail /usr/sbin/sendmail.old                # ignore any errors&lt;br /&gt;
chmod 000 /usr/lib/sendmail.old /usr/sbin/sendmail.old        # ignore any errors&lt;br /&gt;
ln -s /var/qmail/bin/sendmail /usr/lib&lt;br /&gt;
ln -s /var/qmail/bin/sendmail /usr/sbin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
QMR does the same in Part-10. &lt;br /&gt;
&lt;br /&gt;
Note[LWQ]: It's important to create the sendmail links, regardless of the previous MTA, if any. The sendmail command is invoked by many applications for sending mail. &lt;br /&gt;
&lt;br /&gt;
Note: QMR , when it runs the finalize_linux.script in part 9, copies the smtpd_ssl and pop3d run scripts as well to the supervise directory. Also sets up links in the /service directory for them. We are not going to use QMR's smtpd_ssl , at least for now. And about pop3, though it seems very tempting, I would not install qmail's own pop3 daemon, because, I will be using the pop3 and IMAP services of either Courier or DoveCot. So no need to go into hassle of installing qmail-pop3 in the first place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[LWQ]: Create System Aliases&lt;br /&gt;
There are three system aliases that should be created on all qmail installations:&lt;br /&gt;
&lt;br /&gt;
* Alias         Purpose &lt;br /&gt;
* postmaster    RFC 2821 required, points to the mail adminstrator (you) &lt;br /&gt;
* mailer-daemon de facto standard recipient for some bounces &lt;br /&gt;
* root          redirects mail from privileged account to the system administrator &lt;br /&gt;
* abuse         de facto standard recipient for abuse complaints &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create these aliases, decide where you want each of them to go (a local user or a remote address) and create and populate the appropriate .qmail files. For example, say local user dave is both the system and mail administrator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#echo dave &amp;gt; /var/qmail/alias/.qmail-root&lt;br /&gt;
#echo dave &amp;gt; /var/qmail/alias/.qmail-postmaster&lt;br /&gt;
#ln -s .qmail-postmaster /var/qmail/alias/.qmail-mailer-daemon&lt;br /&gt;
#ln -s .qmail-postmaster /var/qmail/alias/.qmail-abuse&lt;br /&gt;
#chmod 644 /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-postmaster&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What I want to do is setup these links to point to postmaster@yourdomain.com . I will set them to postmaster@example.com . Note that QMR also creates these aliases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo postmaster@example.com  &amp;gt; /var/qmail/alias/.qmail-root&lt;br /&gt;
echo postmaster@example.com  &amp;gt; /var/qmail/alias/.qmail-postmaster&lt;br /&gt;
ln -s /var/qmail/alias/.qmail-postmaster /var/qmail/alias/.qmail-mailer-daemon&lt;br /&gt;
ln -s /var/qmail/alias/.qmail-postmaster /var/qmail/alias/.qmail-abuse&lt;br /&gt;
chmod 644 /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-postmaster&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the Installation [LWQ]:&lt;br /&gt;
qmail should now be running. First run qmailctl stat to verify that the services are up and running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    # qmailctl stat&lt;br /&gt;
    /service/qmail-send: up (pid 30303) 187 seconds&lt;br /&gt;
    /service/qmail-send/log: up (pid 30304) 187 seconds&lt;br /&gt;
    /service/qmail-smtpd: up (pid 30305) 187 seconds&lt;br /&gt;
    /service/qmail-smtpd/log: up (pid 30308) 187 seconds&lt;br /&gt;
    messages in queue: 0&lt;br /&gt;
    messages in queue but not yet preprocessed: 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four services should be &amp;quot;up&amp;quot; for more than a second. If they're not, you've probably got a typo in the associated run script or you skipped one or more steps in creating the necessary files, directories, or links. Go back through the installation step-by-step and double check your work. You can also download and run the inst_check script, available from http://lifewithqmail.org/inst_check. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    # sh inst_check&lt;br /&gt;
    ! /var/log/qmail has wrong owner, should be qmaill&lt;br /&gt;
    ...try: chown qmaill /var/log/qmail&lt;br /&gt;
    #&lt;br /&gt;
If inst_check finds problems, fix them and re-run it. When everything looks right, inst_check will report:&lt;br /&gt;
    Congratulations, your LWQ installation looks good!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So let's do that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /downloads/&lt;br /&gt;
wget http://lifewithqmail.org/inst_check&lt;br /&gt;
chmod +x inst_check&lt;br /&gt;
&lt;br /&gt;
[root@qmail downloads]# ./inst_check&lt;br /&gt;
! /var/qmail/control/concurrencyincoming is missing&lt;br /&gt;
...try: echo 20 &amp;gt;/var/qmail/control/concurrencyincoming&lt;br /&gt;
! /var/log/qmail has wrong mode, should be 755&lt;br /&gt;
...try: chmod 755 /var/log/qmail&lt;br /&gt;
! /var/log/qmail/smtpd is missing&lt;br /&gt;
...try: mkdir -p /var/log/qmail/smtpd&lt;br /&gt;
! Alias for root is missing&lt;br /&gt;
...try: echo me &amp;gt;/var/qmail/alias/.qmail-root&lt;br /&gt;
! Alias for postmaster is missing&lt;br /&gt;
...try: echo me &amp;gt;/var/qmail/alias/.qmail-postmaster&lt;br /&gt;
! Alias for mailer-daemon is missing&lt;br /&gt;
...try: echo me &amp;gt;/var/qmail/alias/.qmail-mailer-daemon&lt;br /&gt;
[root@qmail downloads]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wow! So many errors! &lt;br /&gt;
&lt;br /&gt;
Actually I forgot to create the email aliases mentioned above. I created them now. Also created the concurrencyincoming file, and fixed the permissions of /var/log/qmail directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo 20 &amp;gt;/var/qmail/control/concurrencyincoming&lt;br /&gt;
chmod 755 /var/log/qmail -R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last check left is about missing /var/log/qmail/smtpd directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail downloads]# ./inst_check&lt;br /&gt;
! /var/log/qmail/smtpd is missing&lt;br /&gt;
...try: mkdir -p /var/log/qmail/smtpd&lt;br /&gt;
[root@qmail downloads]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can ignore this error, as we are using a different name (/var/log/qmail/qmail-smtpd) for it. As shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail downloads]# ls /var/log/qmail/ -l&lt;br /&gt;
total 12&lt;br /&gt;
drwxr-xr-x 2 qmaill root 4096 Aug 18 15:32 qmail-pop3d&lt;br /&gt;
drwxr-xr-x 2 qmaill root 4096 Aug 21 12:11 qmail-send&lt;br /&gt;
drwxr-xr-x 2 qmaill root 4096 Aug 21 12:11 qmail-smtpd&lt;br /&gt;
[root@qmail downloads]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if you want to fee happy, and desperate to see the congratulations message, you can try to create this directory and run the test script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail downloads]# mkdir /var/log/qmail/smtpd&lt;br /&gt;
[root@qmail downloads]# chown qmaill /var/log/qmail/smtpd/&lt;br /&gt;
&lt;br /&gt;
[root@qmail downloads]# ./inst_check&lt;br /&gt;
Congratulations, your LWQ installation looks good!&lt;br /&gt;
[root@qmail downloads]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well, in this example you fooled the script!&lt;br /&gt;
&lt;br /&gt;
Note: A little about QMR's qmr_isnt_check script:&lt;br /&gt;
QMR runs the qmr_inst_check script in part 11. QMR has modified the default inst_check script from LWQ. The following differences exist. The “diff” is shown below with little summary in simple words explained further below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail downloads]# diff /downloads/qmailrocks/scripts/util/qmr_inst_check ./inst_check &lt;br /&gt;
3,10d2                                                                                      &lt;br /&gt;
&amp;lt; # Qmailrocks, 2003-12-05                                                                  &lt;br /&gt;
&amp;lt; # I've modified Dave Sill's script slightly to accomodate                                 &lt;br /&gt;
&amp;lt; # the variations between his Qmail installation and the                                   &lt;br /&gt;
&amp;lt; # Qmailrocks.org installation. The Qmailrocks version                                     &lt;br /&gt;
&amp;lt; # of this script takes into account the slightly different                                &lt;br /&gt;
&amp;lt; # loggind directory setup and a few permissions differences.                              &lt;br /&gt;
&amp;lt; # http://www.qmailrocks.org/downloads/scripts/qmr_inst_check                              &lt;br /&gt;
&amp;lt;                                                                                           &lt;br /&gt;
15,16c7,8                                                                                   &lt;br /&gt;
&amp;lt; CHECKPOP=y                                                                                &lt;br /&gt;
&amp;lt; CHECKSEND=y                                                                               &lt;br /&gt;
---                                                                                         &lt;br /&gt;
&amp;gt; CHECKPOP=n                                                                                &lt;br /&gt;
&amp;gt;&lt;br /&gt;
191c183&lt;br /&gt;
&amp;lt;   echo &amp;quot;...try: echo 30 &amp;gt;$QMHOME/control/concurrencyincoming&amp;quot;&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;   echo &amp;quot;...try: echo 20 &amp;gt;$QMHOME/control/concurrencyincoming&amp;quot;&lt;br /&gt;
197c189&lt;br /&gt;
&amp;lt; LOGDIRS=&amp;quot;/var/log/qmail /var/log/qmail/qmail-smtpd&amp;quot;&lt;br /&gt;
---&lt;br /&gt;
&amp;gt; LOGDIRS=&amp;quot;/var/log/qmail /var/log/qmail/smtpd&amp;quot;&lt;br /&gt;
199,202c191&lt;br /&gt;
&amp;lt;   LOGDIRS=&amp;quot;$LOGDIRS /var/log/qmail/qmail-pop3d&amp;quot;&lt;br /&gt;
&amp;lt; fi&lt;br /&gt;
&amp;lt; if [ &amp;quot;$CHECKSEND&amp;quot; = &amp;quot;y&amp;quot; ]; then&lt;br /&gt;
&amp;lt;   LOGDIRS=&amp;quot;$LOGDIRS /var/log/qmail/qmail-send&amp;quot;&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;   LOGDIRS=&amp;quot;$LOGDIRS /var/log/qmail/pop3d&amp;quot;&lt;br /&gt;
213,215c202,204&lt;br /&gt;
&amp;lt;   elif [ &amp;quot;`ls -ld $i|awk '{print $1}'`&amp;quot; != &amp;quot;drwxr-x---&amp;quot; ]; then&lt;br /&gt;
&amp;lt;     echo &amp;quot;! $i has wrong mode, should be 750&amp;quot;&lt;br /&gt;
&amp;lt;     echo &amp;quot;...try: chmod 750 $i&amp;quot;&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;   elif [ &amp;quot;`ls -ld $i|awk '{print $1}'`&amp;quot; != &amp;quot;drwxr-xr-x&amp;quot; ]; then&lt;br /&gt;
&amp;gt;     echo &amp;quot;! $i has wrong mode, should be 755&amp;quot;&lt;br /&gt;
&amp;gt;     echo &amp;quot;...try: chmod 755 $i&amp;quot;&lt;br /&gt;
313c302&lt;br /&gt;
&amp;lt;   echo &amp;quot;Congratulations, your Qmailrocks.org Qmail installation looks good!&amp;quot;&lt;br /&gt;
---&lt;br /&gt;
&amp;gt;   echo &amp;quot;Congratulations, your LWQ installation looks good!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summary of differences between QMR and LWQ's installation check scripts in plain words:&lt;br /&gt;
&lt;br /&gt;
* QMR's script has CHECKPOP and CHECKSEND enabled as “y”. Whereas LWQ's script uses CHECKPOP=n .  &lt;br /&gt;
* QMR sets concurrencyincoming as 30, whereas LWQ sets it as 20.&lt;br /&gt;
* QMR checks  LOGDIRS=&amp;quot;/var/log/qmail /var/log/qmail/qmail-smtpd&amp;quot;, whereas LWQ checks LOGDIRS=&amp;quot;/var/log/qmail /var/log/qmail/smtpd&amp;quot; . &lt;br /&gt;
* QMR additionally checks for  LOGDIRS=&amp;quot;$LOGDIRS /var/log/qmail/qmail-pop3d&amp;quot; .&lt;br /&gt;
* QMR also checks for LOGDIRS=&amp;quot;$LOGDIRS /var/log/qmail/qmail-send&amp;quot; if CHECKSEND=y&lt;br /&gt;
* QMR wants permissions of log directories as “750”, whereas LWQ expects them to be “755”. Not an issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LWQ: The readproctitle program keeps a log of error messages generated by services managed by svscan. To see these messages, use ps or some other process listing command. For example, you might see something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ps -efl | grep &amp;quot;service errors&amp;quot; | grep -v grep&lt;br /&gt;
000 S root      1006  1001  0  76   0    -   334 pipe_w Mar31 ?        00:00:00&lt;br /&gt;
readproctitle service errors: ...unable to start qmail-smtpd/run: exec format error&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the problem is that there is an error in the first line of the /service/qmail-smtpd/run script--most likely caused by the file being is DOS format (CR-LF line endings instead of Unix's LF-only).&lt;br /&gt;
It sometimes helps to run a service manually in order to find configuration problems. For example, if your qmail-smtpd/log service isn't running, do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /service/qmail-smtpd/log&lt;br /&gt;
svc -d .&lt;br /&gt;
./run&lt;br /&gt;
if no errors, enter a line of text and press ENTER&lt;br /&gt;
if still no errors, enter CTRL-D (end of file)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, you should be able to identify the problem and fix it. Once that's done, return to the service's directory, if necessary, and do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svc -u .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no problems, your readproctitle will show you dots only, instead of errors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail downloads]# ps -efl | grep &amp;quot;service errors&amp;quot; | grep -v grep&lt;br /&gt;
0 S root      2001  1963  0  84   0 -   378 pipe_w 12:11 ?        00:00:00 readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the services are all up with &amp;gt;1 second uptime, follow the instructions in TEST.deliver and TEST.receive to verify that they're working correctly. Note that using these instructions, logging will be accomplished by multilog to /var/log/qmail, not splogger to something like /var/log/maillog.&lt;br /&gt;
&lt;br /&gt;
Note: If you chose maildir mailbox format as the default delivery method, you will need to create a Maildir directory in your home directory and alias's home directory before trying these instructions. See the maildir section to see how to properly create this directory. &lt;br /&gt;
&lt;br /&gt;
If I am to follow these instructions in TEST.deliver and TEST.receive files, I need to have some OS accounts to send mail back and forth. Also I need to have a special directory named Maildir in home directories of those users. This is because vpopmail and mysql are not yet installed. So all testing will be done through OS users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
useradd kamran&lt;br /&gt;
useradd feysal&lt;br /&gt;
&lt;br /&gt;
echo 'redhat' | passwd --stdin kamran&lt;br /&gt;
echo 'redhat'| passwd --stdin feysal&lt;br /&gt;
&lt;br /&gt;
mkdir /home/kamran/Maildir&lt;br /&gt;
mkdir /home/feysal/Maildir&lt;br /&gt;
chown kamran:kamran /home/kamran/* -R&lt;br /&gt;
chown kamran:kamran /home/feysal/* -R&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try the test:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# echo to: kamran | /var/qmail/bin/qmail-inject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the log:-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# tail -F  /var/log/qmail/qmail-send/current&lt;br /&gt;
@400000004a8e95f405201c64 new msg 65096&lt;br /&gt;
@400000004a8e95f4052471c4 info msg 65096: bytes 217 from &amp;lt;root@qmail.example.com&amp;gt; qp 3059 uid 0&lt;br /&gt;
@400000004a8e95f4052bf78c starting delivery 1: msg 65096 to local kamran@qmail.example.com&lt;br /&gt;
@400000004a8e95f4053970c4 status: local 1/10 remote 0/20&lt;br /&gt;
@400000004a8e95f40be3154c delivery 1: deferral: Temporary_error_on_maildir_delivery._(#4.3.0)/&lt;br /&gt;
@400000004a8e95f40be36f24 status: local 0/10 remote 0/20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A note from LWQ , explains the possible reason: &lt;br /&gt;
Note: qmail-local can deliver mail to maildir mailboxes, but it can't create them. Maildir mailboxes should be created with the maildirmake program that comes with qmail. E.g., &amp;quot;maildirmake ~/Maildir&amp;quot;. Be sure to run maildirmake as the owner of the maildir, not as root. Your useradd or adduser command might support a &amp;quot;skeleton&amp;quot; directory, e.g. /etc/skel, where you can create a maildir that will be copied for all new users. &lt;br /&gt;
&lt;br /&gt;
A maildir mailbox is a directory containing three subdirectories, new, cur, and tmp. Each message in a maildir mailbox is in a separate file in one of the subdirectories, depending upon its status: new is for unread messages, cur is for messages that have been seen, and tmp is for messages in the process of being delivered. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So I deleted the old directories and created new ones using the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# rm -fr /home/kamran/Maildir&lt;br /&gt;
[root@qmail qmail-1.03]# rm -fr /home/feysal/Maildir&lt;br /&gt;
&lt;br /&gt;
[root@qmail qmail-1.03]# su -c &amp;quot;/var/qmail/bin/maildirmake ~/Maildir&amp;quot; kamran&lt;br /&gt;
[root@qmail qmail-1.03]# su -c &amp;quot;/var/qmail/bin/maildirmake ~/Maildir&amp;quot; feysal&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following shows that this command has created the Maildir in the user's home directory with desired permssions, as well as directories cur, new and tmp in the ~/Maildir .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# ls -l /home/kamran/&lt;br /&gt;
total 4&lt;br /&gt;
drwx------ 5 kamran kamran 4096 Aug 21 16:29 Maildir&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[root@qmail qmail-1.03]# ls -l /home/kamran/Maildir/&lt;br /&gt;
total 12&lt;br /&gt;
drwx------ 2 kamran kamran 4096 Aug 21 16:29 cur&lt;br /&gt;
drwx------ 2 kamran kamran 4096 Aug 21 16:29 new&lt;br /&gt;
drwx------ 2 kamran kamran 4096 Aug 21 16:29 tmp&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try the mail test again:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# echo to: kamran | /var/qmail/bin/qmail-inject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it succeeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# tail -F /var/log/qmail/qmail-send/current&lt;br /&gt;
@400000004a8ea2321cf0b6dc new msg 65097&lt;br /&gt;
@400000004a8ea2321cf206cc info msg 65097: bytes 217 from &amp;lt;root@qmail.example.com&amp;gt; qp 3155 uid 0&lt;br /&gt;
@400000004a8ea2321cf3f2fc starting delivery 7: msg 65097 to local kamran@qmail.example.com&lt;br /&gt;
@400000004a8ea2321cfa05ac status: local 1/10 remote 0/20&lt;br /&gt;
@400000004a8ea2321dc3d1d4 delivery 7: success: did_1+0+0/&lt;br /&gt;
@400000004a8ea2321dc698c4 status: local 0/10 remote 0/20&lt;br /&gt;
@400000004a8ea2321dd1a0fc end msg 65097&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check inside user kamran's Maildir/new directory, you will find a file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# ls ~kamran/Maildir/new/ -lh&lt;br /&gt;
total 4.0K&lt;br /&gt;
-rw------- 1 kamran kamran 294 Aug 21 16:33 1250861608.3158.qmail.example.com&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This mail file, has the following contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# cat ~kamran/Maildir/new/1250861608.3158.qmail.example.com&lt;br /&gt;
Return-Path: &amp;lt;root@qmail.example.com&amp;gt;&lt;br /&gt;
Delivered-To: kamran@qmail.example.com&lt;br /&gt;
Received: (qmail 3155 invoked by uid 0); 21 Aug 2009 16:33:28 +0300&lt;br /&gt;
Date: 21 Aug 2009 16:33:28 +0300&lt;br /&gt;
Message-ID: &amp;lt;20090821133328.3154.qmail@qmail.example.com&amp;gt;&lt;br /&gt;
From: root@qmail.example.com&lt;br /&gt;
to: kamran@qmail.example.com&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So this seems to be working properly. I can try from another machine, using smtpd protocol and send another mail to the same user. Here is how:&lt;br /&gt;
&lt;br /&gt;
I log on to another machine and try sending the mail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[kamran@kworkbee ~]$ telnet qmail.example.com 25&lt;br /&gt;
Trying 192.168.122.90...&lt;br /&gt;
Connected to qmail.example.com.&lt;br /&gt;
Escape character is '^]'.&lt;br /&gt;
220 qmail.example.com NO UCE ESMTP&lt;br /&gt;
ehlo kworkbee.homedomain.com&lt;br /&gt;
250-qmail.example.com NO UCE&lt;br /&gt;
250-SIZE 0&lt;br /&gt;
250-PIPELINING&lt;br /&gt;
250 8BITMIME&lt;br /&gt;
mail from: kamranazeem@homedomain.com&lt;br /&gt;
250 ok&lt;br /&gt;
rcpt to: kamran@example.com&lt;br /&gt;
553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)&lt;br /&gt;
rcpt to: kamran@qmail.example.com&lt;br /&gt;
250 ok&lt;br /&gt;
data&lt;br /&gt;
354 go ahead&lt;br /&gt;
Subject: test message&lt;br /&gt;
This is a test over SMTP from another machine.&lt;br /&gt;
.&lt;br /&gt;
250 ok 1250862005 qp 3166&lt;br /&gt;
quit&lt;br /&gt;
221 qmail.example.com NO UCE&lt;br /&gt;
Connection closed by foreign host.&lt;br /&gt;
[kamran@kworkbee ~]$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I have the following in my qmail-send log file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@400000004a8ea3bf06373d6c new msg 65097&lt;br /&gt;
@400000004a8ea3bf0637935c info msg 65097: bytes 379 from &amp;lt;kamranazeem@homedomain.com&amp;gt; qp 3166 uid 702&lt;br /&gt;
@400000004a8ea3bf0649a844 starting delivery 8: msg 65097 to local kamran@qmail.example.com&lt;br /&gt;
@400000004a8ea3bf0649c784 status: local 1/10 remote 0/20&lt;br /&gt;
@400000004a8ea3bf071368b4 delivery 8: success: did_1+0+0/&lt;br /&gt;
@400000004a8ea3bf07164afc status: local 0/10 remote 0/20&lt;br /&gt;
@400000004a8ea3bf071bc16c end msg 65097&lt;br /&gt;
@400000004a8ea40502fa17b4 starting delivery 9: msg 65096 to local kamran@qmail.example.com&lt;br /&gt;
@400000004a8ea4050309dec4 status: local 1/10 remote 0/20&lt;br /&gt;
@400000004a8ea40504f5860c delivery 9: success: did_1+0+0/&lt;br /&gt;
@400000004a8ea40504f5d814 status: local 0/10 remote 0/20&lt;br /&gt;
@400000004a8ea40504f61e64 end msg 65096&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And I should have a new file in the Maildir/new of user kamran:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@qmail qmail-1.03]# ls ~kamran/Maildir/new/ -lh&lt;br /&gt;
total 12K&lt;br /&gt;
-rw------- 1 kamran kamran 294 Aug 21 16:33 1250861608.3158.qmail.example.com&lt;br /&gt;
-rw------- 1 kamran kamran 460 Aug 21 16:40 1250862005.3171.qmail.example.com&lt;br /&gt;
&lt;br /&gt;
[root@qmail qmail-1.03]# cat ~kamran/Maildir/new/1250862005.3171.qmail.example.com&lt;br /&gt;
Return-Path: &amp;lt;kamranazeem@homedomain.com&amp;gt;&lt;br /&gt;
Delivered-To: kamran@qmail.example.com&lt;br /&gt;
Received: (qmail 3166 invoked from network); 21 Aug 2009 16:39:48 +0300&lt;br /&gt;
Received: from unknown (HELO kworkbee.homedomain.com) (192.168.122.1)&lt;br /&gt;
  by qmail.example.com with SMTP; 21 Aug 2009 16:39:48 +0300&lt;br /&gt;
Received-SPF: none (qmail.example.com: domain at homedomain.com does not designate permitted sender hosts)&lt;br /&gt;
Subject: test message&lt;br /&gt;
This is a test over SMTP from another machine.&lt;br /&gt;
[root@qmail qmail-1.03]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Great! So this seems to be working. There are a lot of tests explained in the TEST.deliver file in the Qmail source directory, which you can (should) perform , before moving on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Todo: ==&lt;br /&gt;
“Make cert” ???&lt;br /&gt;
&lt;br /&gt;
JMS Queue analyzer : http://qmail.jms1.net/scripts/qlanalyze&lt;/div&gt;</description>
			<pubDate>Tue, 15 Jun 2010 18:21:05 GMT</pubDate>			<dc:creator>WikiChaudhry</dc:creator>			<comments>http://cooker.wbitt.com/index.php/Talk:Qmail</comments>		</item>
		<item>
			<title>Main Page</title>
			<link>http://cooker.wbitt.com/index.php/Main_Page</link>
			<description>&lt;p&gt;WikiChaudhry:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Being Cooked! ==&lt;br /&gt;
* [[PXEBooting]]&lt;br /&gt;
* [[PXEClusterInstall]]&lt;br /&gt;
* [[CobblerTest]]&lt;br /&gt;
* [[LoadMonitoringScript]]&lt;br /&gt;
* [[Virtualization]]&lt;br /&gt;
** [[Virtualization-XEN]]&lt;br /&gt;
* [[Qmail]]&lt;br /&gt;
* [[Data Center In A Box]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [http://meta.wikimedia.org/wiki/Help:Editing Wiki Editing and Formatting  Help]&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [http://meta.wikimedia.org/wiki/Help:Contents Wiki User's Guide] for information on using the wiki software&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
&lt;br /&gt;
==Popular Pages==&lt;br /&gt;
[[Special:PopularPages]]&lt;/div&gt;</description>
			<pubDate>Mon, 14 Jun 2010 15:02:40 GMT</pubDate>			<dc:creator>WikiChaudhry</dc:creator>			<comments>http://cooker.wbitt.com/index.php/Talk:Main_Page</comments>		</item>
		<item>
			<title>Main Page</title>
			<link>http://cooker.wbitt.com/index.php/Main_Page</link>
			<description>&lt;p&gt;WikiChaudhry:&amp;#32;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Being Cooked! ==&lt;br /&gt;
* [[PXEBooting]]&lt;br /&gt;
* [[PXEClusterInstall]]&lt;br /&gt;
* [[CobblerTest]]&lt;br /&gt;
* [[LoadMonitoringScript]]&lt;br /&gt;
* [[Virtualization]]&lt;br /&gt;
** [[Virtualization-XEN]]&lt;br /&gt;
* [[Qmail]]&lt;br /&gt;
* [[Data Center In A Box]]&lt;br /&gt;
* [[Migrating a web development company from Windows to Linux]]&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [http://meta.wikimedia.org/wiki/Help:Editing Wiki Editing and Formatting  Help]&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [http://meta.wikimedia.org/wiki/Help:Contents Wiki User's Guide] for information on using the wiki software&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
&lt;br /&gt;
==Popular Pages==&lt;br /&gt;
[[Special:PopularPages]]&lt;/div&gt;</description>
			<pubDate>Fri, 11 Jun 2010 17:30:07 GMT</pubDate>			<dc:creator>WikiChaudhry</dc:creator>			<comments>http://cooker.wbitt.com/index.php/Talk:Main_Page</comments>		</item>
	</channel>
</rss>