{"id":726,"date":"2012-07-16T11:25:28","date_gmt":"2012-07-16T03:25:28","guid":{"rendered":"http:\/\/rmohan.com\/?p=726"},"modified":"2012-07-16T11:25:28","modified_gmt":"2012-07-16T03:25:28","slug":"qmail-installation-centos-5-5","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=726","title":{"rendered":"qmail installation Centos 5.5"},"content":{"rendered":"<p>mkdir \/root\/qmail<br \/>\ncd \/root\/qmail<br \/>\nwget http:\/\/www.qmail.org\/netqmail-1.06.tar.gz<br \/>\nwget http:\/\/cr.yp.to\/ucspi-tcp\/ucspi-tcp-0.88.tar.gz &#8211;&gt; inetd\/xinetd substitute manages various daemon that qmail shipped with.<br \/>\nwget http:\/\/cr.yp.to\/daemontools\/daemontools-0.76.tar.gz &#8211;&gt; Provide some services such as management as well as logging though 2 interfaces service scan and supervise (svscan\/supervise).<\/p>\n<p>tar -xvzf netqmail-1.06.tar.gz<br \/>\ntar -xvzf ucspi-tcp-0.88.tar.gz<br \/>\nmkdir \/package<br \/>\nmv daemontools-0.76.tar.gz \/package<br \/>\nmkdir \/var\/qmail<br \/>\ncd \/root\/qmail\/netqmail-1.06<br \/>\ncp INSTALL.ids IDS &#8211;&gt; This file used in compilation to create users and groups for qmail<\/p>\n<p>Note:- IDS file should include only the following<br \/>\ngroupadd nofiles<br \/>\nuseradd -g nofiles -d \/var\/qmail\/alias alias<br \/>\nuseradd -g nofiles -d \/var\/qmail qmaild<br \/>\nuseradd -g nofiles -d \/var\/qmail qmaill<br \/>\nuseradd -g nofiles -d \/var\/qmail qmailp<br \/>\ngroupadd qmail<br \/>\nuseradd -g qmail -d \/var\/qmail qmailq<br \/>\nuseradd -g qmail -d \/var\/qmail qmmailr<br \/>\nuseradd -g qmail -d \/var\/qmail qmails<\/p>\n<p>. IDS &amp;&amp; echo $? &#8211;&gt; To source the file in order to execute it and echo the exist status<br \/>\nyum install gcc gcc-c++ make flex bison bison-devel<br \/>\nmake setup check &#8211;&gt; To build source files<br \/>\n.\/config-fast mail.linux.org (FQDN) &#8211;&gt; If the FQDN is not defined you can check it using hostname -f<br \/>\ncd \/root\/qmail\/ucspi-tcp-0.88<br \/>\nyum install patch-2.5.4-31.el5 &#8211;&gt; Make sure that the patch command is installed<br \/>\npatch &lt; \/root\/qmail\/netqmail-1.06\/other-patches\/ucspi-tcp-0.88.errno.patch &#8211;&gt; this will pactch ucspi patch to the environment<br \/>\nmake &amp;&amp; make setup check<br \/>\ncd \/package<br \/>\ntar -xvzf daemontools-0.76.tar.gz<br \/>\ncd \/package\/admin\/daemontools-0.76\/src<br \/>\npatch &lt; \/root\/qmail\/netqmail-1.06\/other-patches\/daemontools-0.76.errno.patch<br \/>\ncd ..<br \/>\npackage\/install<br \/>\nvim \/var\/qmail\/rc &#8211;&gt; And add the following<\/p>\n<p>!\/bin\/sh<\/p>\n<p>Using stdout for logging<br \/>\nUsing control\/defaultdelivery from qmail-local to deliver messages by default<br \/>\nexec env &#8211; PATH=&#8221;\/var\/qmail\/bin:$PATH&#8221; \\<br \/>\nqmail-start &#8220;`cat \/var\/qmail\/control\/defaultdelivery`&#8221;<\/p>\n<p>chmod 755 \/var\/qmail\/rc<br \/>\nmkdir \/var\/log\/qmail<br \/>\necho &#8220;.\/Mailbox&#8221; &gt; \/var\/qmail\/control\/defaultdelivery<\/p>\n<p>The qmailctl script<\/p>\n<p>wget http:\/\/lifewithqmail.org\/qmailctl-script-dt70<br \/>\nmv qmailctl-script-dt70 \/var\/qmail\/bin\/qmailctl<br \/>\nchmod 755 \/var\/qmail\/bin\/qmailctl<br \/>\nln -s \/var\/qmail\/bin\/qmailctl \/usr\/bin<\/p>\n<p>The supervise scripts<\/p>\n<p>mkdir -p \/var\/qmail\/supervise\/qmail-send\/log<br \/>\nmkdir -p \/var\/qmail\/supervise\/qmail-smtpd\/log<br \/>\nvim \/var\/qmail\/supervise\/qmail-send\/run &#8211;&gt; Add the following<\/p>\n<p>!\/bin\/sh<br \/>\nexec \/var\/qmail\/rc<\/p>\n<p>vim \/var\/qmail\/supervise\/qmail-send\/log\/run &#8211;&gt; Add the following<\/p>\n<p>!\/bin\/sh<br \/>\nexec \/usr\/local\/bin\/setuidgid qmaill \/usr\/local\/bin\/multilog t \/var\/log\/qmail<\/p>\n<p>vim \/var\/qmail\/supervise\/qmail-smtpd\/run &#8211;&gt; Add the following<\/p>\n<p>!\/bin\/sh<\/p>\n<p>QMAILDUID=`id -u qmaild`<br \/>\nNOFILESGID=`id -g qmaild`<br \/>\nMAXSMTPD=`cat \/var\/qmail\/control\/concurrencyincoming`<br \/>\nLOCAL=`head -1 \/var\/qmail\/control\/me`<\/p>\n<p>if [ -z &#8220;$QMAILDUID&#8221; -o -z &#8220;$NOFILESGID&#8221; -o -z &#8220;$MAXSMTPD&#8221; -o -z &#8220;$LOCAL&#8221; ]; then<br \/>\necho QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in<br \/>\necho \/var\/qmail\/supervise\/qmail-smtpd\/run<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>if [ ! -f \/var\/qmail\/control\/rcpthosts ]; then<br \/>\necho &#8220;No \/var\/qmail\/control\/rcpthosts!&#8221;<br \/>\necho &#8220;Refusing to start SMTP listener because it&#8217;ll create an open relay&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>exec \/usr\/local\/bin\/softlimit -m 2000000 \\<br \/>\n\/usr\/local\/bin\/tcpserver -v -R -l &#8220;$LOCAL&#8221; -x \/etc\/tcp.smtp.cdb -c &#8220;$MAXSMTPD&#8221; \\<br \/>\n-u &#8220;$QMAILDUID&#8221; -g &#8220;$NOFILESGID&#8221; 0 smtp \/var\/qmail\/bin\/qmail-smtpd 2&gt;&amp;1<\/p>\n<p>Note: concurrencyincoming isn&#8217;t a standard qmail control file. It&#8217;s a feature of the above script. Also, that&#8217;s -1 (dash one) on the LOCAL line and -l (dash ell) on the tcpserver line.<\/p>\n<p>Note: 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:<\/p>\n<p>\/usr\/local\/bin\/tcpserver: error while loading shared libraries:<br \/>\nlibc.so.6: failed to map segment from shared object: Cannot allocate memory try raising it to 3000000 or 4000000.<\/p>\n<p>echo 20 &gt; \/var\/qmail\/control\/concurrencyincoming<br \/>\nchmod 644 \/var\/qmail\/control\/concurrencyincoming<br \/>\nvim \/var\/qmail\/supervise\/qmail-smtpd\/log\/run &#8211;&gt; Add the following<\/p>\n<p>!\/bin\/sh<br \/>\nexec \/usr\/local\/bin\/setuidgid qmaill \/usr\/local\/bin\/multilog t \/var\/log\/qmail\/smtpd<\/p>\n<p>chmod 755 \/var\/qmail\/supervise\/qmail-send\/run<br \/>\nchmod 755 \/var\/qmail\/supervise\/qmail-send\/log\/run<br \/>\nchmod 755 \/var\/qmail\/supervise\/qmail-smtpd\/run<br \/>\nchmod 755 \/var\/qmail\/supervise\/qmail-smtpd\/log\/run<\/p>\n<p>mkdir -p \/var\/log\/qmail\/smtpd<br \/>\nchown qmaill \/var\/log\/qmail \/var\/log\/qmail\/smtpd<br \/>\nrm -rf \/usr\/sbin\/sendmail<br \/>\nln -s \/var\/qmail\/bin\/sendmail \/usr\/sbin<br \/>\nrm -rf \/usr\/lib\/sendmail<br \/>\nln -s \/var\/qmail\/bin\/sendmail \/usr\/lib<br \/>\necho\u00a0 root &gt; \/var\/qmail\/alias\/.qmail-root<br \/>\necho\u00a0 root &gt; \/var\/qmail\/alias\/.qmail-postmaster<br \/>\nln -s var\/qmail\/alias\/.qmail-postmaster \/var\/qmail\/alias\/.qmail-mailer-daemon<br \/>\nchmod 644 \/var\/qmail\/alias\/.qmail-root \/var\/qmail\/alias\/.qmail-postmaster<br \/>\necho &#8216;127.:allow,RELAYCLIENT=&#8221;&#8221;&#8216; &gt;&gt;\/etc\/tcp.smtp<br \/>\nqmailctl cdb<br \/>\nln -s \/var\/qmail\/supervise\/qmail-send \/var\/qmail\/supervise\/qmail-smtpd \/service<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mkdir \/root\/qmail cd \/root\/qmail wget http:\/\/www.qmail.org\/netqmail-1.06.tar.gz wget http:\/\/cr.yp.to\/ucspi-tcp\/ucspi-tcp-0.88.tar.gz &#8211;&gt; inetd\/xinetd substitute manages various daemon that qmail shipped with. wget http:\/\/cr.yp.to\/daemontools\/daemontools-0.76.tar.gz &#8211;&gt; Provide some services such as management as well as logging though 2 interfaces service scan and supervise (svscan\/supervise).<\/p>\n<p>tar -xvzf netqmail-1.06.tar.gz tar -xvzf ucspi-tcp-0.88.tar.gz mkdir \/package mv daemontools-0.76.tar.gz \/package mkdir \/var\/qmail cd \/root\/qmail\/netqmail-1.06 cp [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/726"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=726"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/726\/revisions"}],"predecessor-version":[{"id":728,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/726\/revisions\/728"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}