User Tools

Site Tools


qmail-ldap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
qmail-ldap [2004/12/30 13:26]
127.0.0.1 external edit
qmail-ldap [2020/02/13 22:55] (current)
Line 1: Line 1:
  
 ====== qmail-ldap Installation ====== ====== qmail-ldap Installation ======
-<toc><ul><li><link topicref="2">virtualdomains (wildcard domain aliasing):</link></li><li><link topicref="3">SMTP_AUTH:</link></li><li><link topicref="4">ezmlm:</link></li><li><link topicref="5">OpenLDAP Replication notes:</link></li></ul></toc> 
-<list><ul><li>You will need to get the following software:<ul><li><link href="ftp://cr.yp.to/software/qmail-1.03.tar.gz">qmail</link></li><li><link href="http://www.nrg4u.com/qmail/">qmail-ldap patch</link></li><li><link href="http://www.openldap.org/software/download/">OpenLDAP</link></li><li><link href="http://phpqladmin.bayour.com/">phpQLAdmin</link></li></ul></li></ul></list> 
-      Additional (Optional) Packages: 
  
-          * <uri strref="http://cr.yp.to/software/ezmlm-0.53.tar.gz"/> [ezmlm notes|#ezmlm] - mailing list manager ( Requires the dash-trick patch if you plan to set up LDAP users to have mailing lists, rather than just real users ) +You will need to get the following software: 
-<p>          * <uri strref="http://qmail-scanner.sourceforge.net/"/> <link idref="10"></link> - Use qmail-scanner to check for viruses (using an antivirus program like NAI's <link href="http://www.mcafeeb2b.com/products/virusscan/">VirusScan</link>)</p> + 
-<list><ul><li>Untar qmail, and apply the current qmail-ldap patch:</li></ul></list>+  * qmail http://cr.yp.to/software/qmail-1.03.tar.gz 
 +  * qmail-ldap patch http://www.nrg4u.com/qmail 
 + 
 +From your distro install slapd (openldap), phpldapadmin, daemontools-run, and ucspi-tcp-ipv6. 
 + 
 +Optional: 
 + 
 +  * <uri strref="http://cr.yp.to/software/ezmlm-0.53.tar.gz"/> [ezmlm notes|#ezmlm] - mailing list manager ( Requires the dash-trick patch if you plan to set up LDAP users to have mailing lists, rather than just real users ) 
 + 
 +Untar qmail, and apply the current qmail-ldap patch:
 <pre> <pre>
 +tar xvzf qmail-1.03.tar.gz
 cd qmail-1.03; gzip -dc ../qmail-ldap-1.03-xxxxxxxx.patch.gz | patch -p1 cd qmail-1.03; gzip -dc ../qmail-ldap-1.03-xxxxxxxx.patch.gz | patch -p1
 </pre> </pre>
Line 19: Line 26:
       are uncommented!       are uncommented!
  
-<list><ul><li>If you are installing qmail on a glibc 2.3 based system, you will need to apply these patches:</li></ul></list> +<list><ul><li>Edit /etc/openldap/slapd.conf and replace where possible:<ul><li><tt>schemacheck</tt> - to on</li><li><tt>suffix</tt> - use either <tt>'dc=domianname, dc=com'</tt> -or- <tt>'o=~MrZesty, c=CA'</tt> (organization, country)</li><li><tt>rootdn</tt> - <tt>'cn=Manager, dc=mrzesty, dc=net'</tt> - must match suffix above</li><li><tt>rootpw</tt>- change your password from 'secret'</li><li><tt>index objectclass,mail,~mailAlternateAddress,uid eq</tt></li></ul></li></ul></list>
-<code> +
-      patch -p1 &lt; ../glibc-2.3-1.patch +
-      patch -p1 &lt; ../glibc-2.3-2.patch +
- +
-diff -naur qmail-1.03.clean/cdb_seek.c qmail-1.03/cdb_seek.c +
---- qmail-1.03.clean/cdb_seek.c Mon Jun 15 13:53:16 1998 +
-+++ qmail-1.03/cdb_seek.c       Tue Jan 21 08:09:19 2003 +
-@@ -1,6 +1,5 @@ +
- #include &lt;sys/types.h&gt; +
- #include &lt;errno.h&gt; +
--extern int errno; +
- #include &quot;cdb.h&quot; +
- +
- #ifndef SEEK_SET +
-diff -naur qmail-1.03.clean/dns.c qmail-1.03/dns.c +
---- qmail-1.03.clean/dns.c      Mon Jun 15 13:53:16 1998 +
-+++ qmail-1.03/dns.c    Tue Jan 21 08:09:04 2003 +
-@@ -7,8 +7,6 @@ +
- #include &lt;errno.h&gt; +
- extern int res_query(); +
- extern int res_search(); +
--extern int errno; +
--extern int h_errno; +
- #include &quot;ip.h&quot; +
- #include &quot;ipalloc.h&quot; +
- #include &quot;fmt.h&quot; +
-diff -naur qmail-1.03.clean/error.h qmail-1.03/error.h +
---- qmail-1.03.clean/error.h    Mon Jun 15 13:53:16 1998 +
-+++ qmail-1.03/error.h  Tue Jan 21 08:08:30 2003 +
-@@ -1,7 +1,6 @@ +
- #ifndef ERROR_H +
- #define ERROR_H +
-+
--extern int errno; +
-+#include &lt;errno.h&gt; +
- +
- extern int error_intr; +
- extern int error_nomem; +
-</code> +
-<list><ul><li>Install OpenLDAP</li></ul></list> +
-<code> +
-./configure &amp;&amp; make &amp;&amp; make install +
-</code> +
-<list><ul><li>Edit /usr/local/etc/openldap/slapd.conf and replace where possible:<ul><li><tt>schemacheck</tt> - to on</li><li><tt>suffix</tt> - use either <tt>&quot;dc=domianname, dc=com&quot;</tt> -or- <tt>&quot;o=~MrZesty, c=CA&quot;</tt> (organization, country)</li><li><tt>rootdn</tt> - <tt>&quot;cn=Manager, dc=mrzesty, dc=net&quot;</tt> - must match suffix above</li><li><tt>rootpw</tt>- change your password from 'secret'</li><li><tt>index objectclass,mail,~mailAlternateAddress,uid eq</tt></li></ul></li></ul></list>+
       Edit <tt>/usr/local/etc/openldap/ldap.conf</tt> and set your BASE dn:       Edit <tt>/usr/local/etc/openldap/ldap.conf</tt> and set your BASE dn:
  
Line 69: Line 32:
 <p>      Copy <tt>qmail-1.03/qmail.schema</tt> to <tt><em>usr/local/etc/openldap/schema</em></tt> and add the following 3 lines to <tt>/usr/local/etc/openldap/slapd.conf</tt> after the first include line</p> <p>      Copy <tt>qmail-1.03/qmail.schema</tt> to <tt><em>usr/local/etc/openldap/schema</em></tt> and add the following 3 lines to <tt>/usr/local/etc/openldap/slapd.conf</tt> after the first include line</p>
 <code> <code>
-include /usr/local/etc/openldap/schema/cosine.schema +include /etc/openldap/schema/cosine.schema 
-include /usr/local/etc/openldap/schema/nis.schema +include /etc/openldap/schema/nis.schema 
-include /usr/local/etc/openldap/schema/qmail.schema +include /etc/openldap/schema/qmail.schema
-</code> +
-<list><ul><li>Add OpenLDAP to the startup ( /etc/rc.d/rc.local ):</li></ul></list> +
-<code> +
-  echo &quot;Starting OpenLDAP&quot; +
-  /usr/local/libexec/slapd -u daemon+
 </code> </code>
-      Because you're running slapd as daemon now, instead of root - you will have to make a couple of ownership changes: 
- 
-<code> 
-  chown daemon /usr/local/etc/openldap/slapd.conf 
-  chown -R daemon /usr/local/var/openldap-* 
-</code> 
-      Start openldap using the command above before you continue. 
  
 <list><ul><li>The idea here is that all email will be handled through virtual accounts, not <tt>/etc/passwd</tt> accounts. Create those now:<ul><li><tt>mkdir -p /var/qmail</tt></li><li>Add a group <tt>vmail</tt></li><li>Add a user <tt>vmail</tt>, home directory is <tt>/var/qmail/maildirs</tt>, and shell is <tt>/bin/true</tt></li></ul></li></ul></list> <list><ul><li>The idea here is that all email will be handled through virtual accounts, not <tt>/etc/passwd</tt> accounts. Create those now:<ul><li><tt>mkdir -p /var/qmail</tt></li><li>Add a group <tt>vmail</tt></li><li>Add a user <tt>vmail</tt>, home directory is <tt>/var/qmail/maildirs</tt>, and shell is <tt>/bin/true</tt></li></ul></li></ul></list>
 <code> <code>
   /usr/sbin/groupadd -g 200 vmail   /usr/sbin/groupadd -g 200 vmail
-  /usr/sbin/useradd -u 200 -g vmail -d /var/qmail/maildirs -m -k /dev/null -s /bin/true -c &quot;qmail vmail user&quot; vmail+  /usr/sbin/useradd -u 200 -g vmail -d /var/qmail/maildirs -m -k /dev/null -s /bin/true -c 'qmail vmail uservmail
 </code> </code>
 <list><ul><li>Create the other users and groups needed for qmail to operate: Create 2 groups <tt>nofiles</tt> and <tt>qmail</tt>, then create these users:</li></ul></list> <list><ul><li>Create the other users and groups needed for qmail to operate: Create 2 groups <tt>nofiles</tt> and <tt>qmail</tt>, then create these users:</li></ul></list>
Line 100: Line 51:
 /usr/sbin/groupadd -g 201 nofiles /usr/sbin/groupadd -g 201 nofiles
 /usr/sbin/groupadd -g 202 qmail /usr/sbin/groupadd -g 202 qmail
-/usr/sbin/useradd -u 201 -g nofiles -d /var/qmail/alias -m -k /dev/null -s /bin/true -c &quot;qmail server&quot; alias +/usr/sbin/useradd -u 201 -g nofiles -d /var/qmail/alias -m -k /dev/null -s /bin/true -c 'qmail serveralias 
-/usr/sbin/useradd -u 202 -g nofiles -d /var/qmail  -s /bin/true -c &quot;qmail server&quot; qmaild +/usr/sbin/useradd -u 202 -g nofiles -d /var/qmail  -s /bin/true -c 'qmail serverqmaild 
-/usr/sbin/useradd -u 203 -g nofiles -d /var/qmail  -s /bin/true -c &quot;qmail server&quot; qmaill +/usr/sbin/useradd -u 203 -g nofiles -d /var/qmail  -s /bin/true -c 'qmail serverqmaill 
-/usr/sbin/useradd -u 204 -g nofiles -d /var/qmail  -s /bin/true -c &quot;qmail server&quot; qmailp +/usr/sbin/useradd -u 204 -g nofiles -d /var/qmail  -s /bin/true -c 'qmail serverqmailp 
-/usr/sbin/useradd -u 205 -g qmail -d /var/qmail  -s /bin/true -c &quot;qmail server&quot; qmailq +/usr/sbin/useradd -u 205 -g qmail -d /var/qmail  -s /bin/true -c 'qmail serverqmailq 
-/usr/sbin/useradd -u 206 -g qmail -d /var/qmail  -s /bin/true -c &quot;qmail server&quot; qmailr +/usr/sbin/useradd -u 206 -g qmail -d /var/qmail  -s /bin/true -c 'qmail serverqmailr 
-/usr/sbin/useradd -u 207 -g qmail -d /var/qmail  -s /bin/true -c &quot;qmail server&quot; qmails+/usr/sbin/useradd -u 207 -g qmail -d /var/qmail  -s /bin/true -c 'qmail serverqmails
 </code> </code>
 <list><ul><li>Create the initial entries in the LDAP database for the qmail-ldap structure. Create a file <tt>qmail-ldap.ldif</tt> with the following contents, modified as needed for your setup:</li></ul></list> <list><ul><li>Create the initial entries in the LDAP database for the qmail-ldap structure. Create a file <tt>qmail-ldap.ldif</tt> with the following contents, modified as needed for your setup:</li></ul></list>
Line 127: Line 78:
       Now load the ldif file into the LDAP directory:       Now load the ldif file into the LDAP directory:
  
-      <tt>ldapadd -vxc -h localhost -D &quot;cn=manager,dc=mrzesty,dc=net&quot; -w managers_password -f qmail-ldap.ldif</tt>+      <tt>ldapadd -vxc -h localhost -D 'cn=manager,dc=mrzesty,dc=net-w managers_password -f qmail-ldap.ldif</tt>
  
 <list><ul><li>Make sure you are in your qmail-1.03 source directory, and run:</li></ul></list> <list><ul><li>Make sure you are in your qmail-1.03 source directory, and run:</li></ul></list>
       <tt>make setup check</tt>       <tt>make setup check</tt>
  
-      (On the FreeBSD machine I was using, gmake was not installed but pmake was, and the make failed complaining about &quot;Makefile&quot;, line 78: Need an operator. Install gmake and try again: /usr/local/bin/gmake setup check) 
-<p>      If you get:</p><p>      /usr/local/lib/libldap.so: undefined reference to `res_query'</p><p>      /usr/local/lib/libldap.so: undefined reference to `dn_expand'</p><p>      Add -lresolv to the end of line 14 in your Makefile:</p><p>      <tt>LDAPLIBS</tt>-L/usr/local/lib -lldap -llber -lresolv=</p> 
 <list><ul><li>Configure qmail with default values (use the mail server name - not the machine name below):</li></ul></list> <list><ul><li>Configure qmail with default values (use the mail server name - not the machine name below):</li></ul></list>
 <code> <code>
 ./config-fast mail.mrzesty.net ./config-fast mail.mrzesty.net
-echo &quot;localhost&quot; &gt; /var/qmail/control/ldapserver +echo 'localhost' > /var/qmail/control/ldapserver 
-echo &quot;ou=qmail, dc=mrzesty, dc=net&quot; &gt; /var/qmail/control/ldapbasedn +echo 'ou=qmail, dc=mrzesty, dc=net' > /var/qmail/control/ldapbasedn 
-echo `id -u vmail` &gt; /var/qmail/control/ldapuid +echo `id -u vmail` /var/qmail/control/ldapuid 
-echo `id -g vmail` &gt; /var/qmail/control/ldapgid +echo `id -g vmail` /var/qmail/control/ldapgid 
-echo &quot;/var/qmail/maildirs&quot; &gt; /var/qmail/control/ldapmessagestore +echo '/var/qmail/maildirs' > /var/qmail/control/ldapmessagestore 
-echo &quot;20000000&quot; &gt; /var/qmail/control/defaultquotasize +echo '20000000' > /var/qmail/control/defaultquotasize 
-echo &quot;You are near your quota for email.  You will need to delete some messages from the server.&quot; &gt; /var/qmail/control/quotawarning +echo 'You are near your quota for email.  You will need to delete some messages from the server.' > /var/qmail/control/quotawarning 
-echo 5 &gt; /var/qmail/control/tarpitcount +echo 5 /var/qmail/control/tarpitcount 
-echo &quot;/var/qmail/bin/dirmaker.sh&quot; &gt; /var/qmail/control/dirmaker +echo '/var/qmail/bin/dirmaker.sh' > /var/qmail/control/dirmaker 
-echo &quot;mrzesty.net&quot; &gt; /var/qmail/control/defaulthost +echo 'mrzesty.net' > /var/qmail/control/defaulthost 
-echo 0 &gt; /var/qmail/control/ldaplocaldelivery+echo 0 /var/qmail/control/ldaplocaldelivery
 </code> </code>
-<list><ul><li>Create a dirmaker.sh script in /var/qmail/bin/dirmaker.sh</li></ul></list>+
 <code> <code>
-#!/bin/sh +cp dirmaker /var/qmail/bin/ 
-mkdir -m 700 -p $1+chmod 755 /var/qmail/bin/dirmaker
 </code> </code>
-      Make sure you make it executable (chmod 755) 
  
 <list><ul><li>Create default system aliases, and define who receives them:</li></ul></list> <list><ul><li>Create default system aliases, and define who receives them:</li></ul></list>
 <code> <code>
-echo &quot;[email protected]&quot; &gt; ~alias/.qmail-postmaster; chmod 644 ~alias/.qmail-postmaster +echo '[email protected]' > ~alias/.qmail-postmaster; chmod 644 ~alias/.qmail-postmaster 
-echo &quot;|cat /dev/null&quot; &gt; ~alias/.qmail-mailer-daemon; chmod 644 ~alias/.qmail-mailer-daemon +echo '|cat /dev/null' > ~alias/.qmail-mailer-daemon; chmod 644 ~alias/.qmail-mailer-daemon 
-echo &quot;[email protected]&quot; &gt; ~alias/.qmail-root; chmod 644 ~alias/.qmail-root +echo '[email protected]' > ~alias/.qmail-root; chmod 644 ~alias/.qmail-root 
-echo &quot;[email protected]&quot; &gt; ~alias/.qmail-abuse; chmod 644 ~alias/.qmail-abuse+echo '[email protected]' > ~alias/.qmail-abuse; chmod 644 ~alias/.qmail-abuse
 </code> </code>
-<list><ul><li>Create the file /var/qmail/rc</li></ul></list>+
 <code> <code>
-#!/bin/sh +cp qmail.run /var/qmail/rc 
-# Using stdout for logging +chmod 755 /var/qmail/rc
- +
-exec env - PATH=&quot;/var/qmail/bin:$PATH&quot; qmail-start &quot;./Maildir/&quot;+
 </code> </code>
-      and make it executable (chmod 755) 
  
-<list><ul><li>Shutdown then remove sendmail:</li></ul></list> 
-      <tt>killall sendmail; rpm -e sendmail</tt> 
- 
-      Link qmail's pseudo-sendmail script to existing sendmail locations: 
- 
-<code> 
-      ln -s /var/qmail/bin/sendmail /usr/lib/sendmail 
-      ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail 
-</code> 
 <list><ul><li>Download <uri strref="http://www.lifewithqmail.org/qmailctl-script-dt70"/> and install it as <tt>/var/qmail/bin/qmailctl</tt>.</li></ul></list> <list><ul><li>Download <uri strref="http://www.lifewithqmail.org/qmailctl-script-dt70"/> and install it as <tt>/var/qmail/bin/qmailctl</tt>.</li></ul></list>
 <code> <code>
Line 192: Line 128:
       Remember to make it executable (755).       Remember to make it executable (755).
  
-<list><ul><li>Download and install <link href="http://cr.yp.to/ucspi-tcp/install.html">ucspi-tcp</link> and <link href="http://cr.yp.to/daemontools/install.html">daemontools</link>. You will again need to apply glibc-2.3-2.patch from above in ucspi-tcp-0.xx and daemontools-0.xx/src.</li></ul></list> 
       Now configure daemontools:       Now configure daemontools:
  
-          * <tt>mkdir -p /var/qmail/supervise/qmail-send/log</tt> +<code> 
-<p>          * <tt>mkdir -p /var/qmail/supervise/qmail-smtpd/log</tt></p><p>          * Create <tt>/var/qmail/supervise/qmail-send/run</tt>:</p>+mkdir -p /var/qmail/supervise/qmail-send/log 
 +mkdir -p /var/qmail/supervise/qmail-smtpd/log 
 +</code> 
 + 
 +Create <tt>/var/qmail/supervise/qmail-send/run</tt>:</p> 
 <code> <code>
 #!/bin/sh #!/bin/sh
Line 202: Line 142:
 exec /var/qmail/rc exec /var/qmail/rc
 </code> </code>
-          * Create <tt>/var/qmail/supervise/qmail-send/log/run</tt>:+ 
 +Create <tt>/var/qmail/supervise/qmail-send/log/run</tt>:
  
 <code> <code>
 #!/bin/sh #!/bin/sh
-exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t s999999 /var/log/qmail+exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s999999 /var/log/qmail
 </code> </code>
-          * Create <tt>/var/qmail/supervise/qmail-smtpd/run</tt>: 
  
 <code> <code>
-#!/bin/sh +cp qmail-smtpd.run /var/qmail/supervise/qmail-smtpd/run
-QMAILDUID=`id -u qmaild` +
-NOFILESGID=`id -g qmaild` +
-MAXSMTPD=20 +
-DENYMAIL=&quot;DNSCHECK&quot; export DENYMAIL +
- +
-exec /usr/local/bin/softlimit -m 20000000 \ +
-    /usr/local/bin/tcpserver -v -R -H -l 0 -x /var/qmail/control/qmail-smtpd.cdb -c &quot;$MAXSMTPD&quot;+
-        -u &quot;$QMAILDUID&quot; -g &quot;$NOFILESGID&quot; 0 smtp \ +
-        /var/qmail/bin/qmail-smtpd 2&gt;&amp;1+
 </code> </code>
-            If you want to use the MAPS lists from mail-abuse.org - you will have to patch your ucspi-tcp ( patch -p1 &lt; ../ucspi-rss.diff ): 
  
-            <uri strref="http://www.mail-abuse.org/rss/qmail/ucspi-rss.diff"/> +Create <tt>/var/qmail/supervise/qmail-smtpd/log/run</tt>: 
-<p>            <uri strref="http://www.nlc.net.au/pub/linux/mail/qmail/ucspi-rss.patch"/></p><p>            <uri strref="http://www.cqc.com/~pacman/projects/rblsmtpd-rss/"/></p><p>            Here are 2 public RBL servers are currently available:</p><p>            <link href="http://www.ordb.org/">Open Relay Database</link></p><p>            <link href="http://www.spamcop.net/bl">SpamCop</link></p><p>            to use them your run file should look like this:</p>+
 <code> <code>
 #!/bin/sh #!/bin/sh
-QMAILDUID=`id -u qmaild` +exec /usr/bin/setuidgid qmaill /usr/bin/multilog t s999999 /var/log/qmail/smtpd
-NOFILESGID=`id -g qmaild` +
-MAXSMTPD=20 +
- +
-exec /usr/local/bin/softlimit -m 20000000 \ +
-    /usr/local/bin/tcpserver -v -R -H -l 0 -x /var/qmail/control/qmail-smtpd.cdb -c &quot;$MAXSMTPD&quot;+
-        -u &quot;$QMAILDUID&quot; -g &quot;$NOFILESGID&quot; 0 smtp \ +
-    /usr/local/bin/rblsmtpd -b -rrelays.ordb.org -rbl.spamcop.net \ +
-        /var/qmail/bin/qmail-smtpd 2&gt;&amp;1+
 </code> </code>
-          * Create <tt>/var/qmail/supervise/qmail-smtpd/log/run</tt>: 
  
-<code> +Set the new scripts as executable:
-#!/bin/sh +
-exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t s999999 /var/log/qmail/smtpd +
-</code> +
-          * Set the new scripts as executable:+
  
 <code> <code>
Line 254: Line 171:
 mkdir -p /var/log/qmail/smtpd mkdir -p /var/log/qmail/smtpd
 chown qmaill /var/log/qmail /var/log/qmail/smtpd chown qmaill /var/log/qmail /var/log/qmail/smtpd
-ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service +ln -s /etc/service /service 
-kill -HUP 1 +update-service --add /var/qmail/supervise/qmail-send 
-ps -axww | grep [s]vscan +update-service --add /var/qmail/supervise/qmail-smtpd 
-/var/qmail/bin/qmailctl stop+start svscan 
 +/etc/init.d/qmail-ldap stop
 </code> </code>
 +
 <list><ul><li>Set up relay permissions for certain IP's in <tt>/var/qmail/control/qmail-smtpd.cdb</tt>:</li></ul></list> <list><ul><li>Set up relay permissions for certain IP's in <tt>/var/qmail/control/qmail-smtpd.cdb</tt>:</li></ul></list>
 <code> <code>
-127.0.0.1:allow,RELAYCLIENT=&quot;&quot;,RBLSMTPD=&quot;&quot;,SMTPAUTH=&quot;&quot; +127.0.0.1:allow,RELAYCLIENT='',RBLSMTPD='',SMTPAUTH='' 
-192.168.1.:allow,RELAYCLIENT=&quot;&quot;,RBLSMTPD=&quot;&quot;,SMTPAUTH=&quot;&quot; +192.168.1.:allow,RELAYCLIENT='',RBLSMTPD='',SMTPAUTH='' 
-:allow,DENYMAIL=&quot;DNSCHECK&quot;,SMTPAUTH=&quot;&quot;,RCPTCHECK=&quot;&quot;+:allow,DENYMAIL='DNSCHECK',SMTPAUTH='',RCPTCHECK=''
 </code> </code>
       From <tt>/var/qmail/control</tt>, run: <tt>make</tt>       From <tt>/var/qmail/control</tt>, run: <tt>make</tt>
- 
-<list><ul><li>Install qmail-pop3d according to <uri strref="http://www.lifewithqmail.org/lwq.html#pop-imap-servers"/> (ignore refernces to checkpassword - it's not used for qmail-ldap). Your <tt>/var/qmail/supervise/qmail-pop3d/run</tt> should look like (notice the change from <tt>/bin/checkpassword</tt> to <tt>/var/qmail/bin/auth_pop</tt>, and the change to <tt>5000000</tt> !):</li></ul></list> 
-<code> 
-#!/bin/sh 
-export POP3_LOGLEVEL=2 
-ME=`head -1 /var/qmail/control/me` 
-exec /usr/local/bin/softlimit -m 5000000 \ 
-    /usr/local/bin/tcpserver -v -R -H -l 0 -x /var/qmail/control/qmail-pop3d.cdb 0 110 /var/qmail/bin/qmail-popup \ 
-        $ME /var/qmail/bin/auth_pop /var/qmail/bin/qmail-pop3d Maildir 2&gt;&amp;1 
-</code> 
-<list><ul><li>Install Courier IMAP <uri strref="http://www.courier-mta.org/download.php#imap."/> You must be a non-root user when you untar and <tt>./configure</tt> Courier.</li></ul></list> 
-<code> 
-./configure --enable-workarounds-for-imap-client-bugs --without-authdaemon &amp;&amp; make 
-su -c &quot;make install install-configure&quot; 
-</code> 
-      Modify the <tt>/usr/lib/courier-imap/libexec/imapd.rc</tt> file to use qmail's auth_imap authentication module: 
- 
-      -- snip -- 
- 
-<code> 
-      start) 
-      LIBAUTHMODULES=&quot;/var/qmail/bin/auth_imap&quot; 
-      # for f in `echo $AUTHMODULES` 
-      # do 
-      # LIBAUTHMODULES=&quot;$LIBAUTHMODULES ${exec_prefix}/libexec/authlib/$f&quot; 
-      # done 
- 
-      # if test -x ${libexecdir}/authlib/authdaemond 
-      # then 
-      # /usr/bin/env - ${libexecdir}/authlib/authdaemond start 
-      # fi 
- 
-      ulimit -d $IMAP_ULIMITD 
-</code> 
-      -- snip -- 
- 
-      You will probabaly also want to check the value of <tt>MAXPERIP</tt> in the <tt>/usr/lib/courier-imap/etc/imapd</tt> and make sure it's high enough (especially if you want to use <link strref="webmail">http://www.horde.org/imp</link> or have an office full of people accessing the server through a NAT gateway). 
-<p>      You can start Courier IMAPd using:</p><p>      <tt>/usr/lib/courier-imap/libexec/imapd.rc start</tt></p><p>      You can set up imapd-ssl.rc using the same steps as above. You will need a valid x509 certificate as described in the courier-imap install docs.</p><p>    <tt>vi /usr/lib/courier-imap/etc/imapd.cnf</tt></p><p>    <tt>/usr/lib/courier-imap/share/mkimapdcert</tt></p> 
-<list><ul><li>Untar phpQLAdmin into a convenient place where Apache can reach it. Move all the files from the include directory into PHP's include path, or just move them into the root folder with the rest of the phpQLAdmin documents. Make the necessary configuration changes to the config.inc file, including the following:</li></ul></list> 
-<code> 
-    define(&quot;PQL_HOSTMASTER&quot;,&quot;[email protected]&quot;); 
- 
-    define(&quot;PQL_LDAP_BASEDN&quot;,&quot;ou=qmail, dc=mrzesty, dc=net&quot;); 
-    define(&quot;PQL_LDAP_ROOTDN&quot;, &quot;cn=manager, dc=mrzesty, dc=net&quot;); 
-    define(&quot;PQL_LDAP_ROOTPW&quot;, &quot;your-manager-password&quot;); 
- 
-    define(&quot;PQL_LDAP_CONTROL_USE&quot;, false); 
-</code> 
-      Your PHP must have compiled in ldap support ( <tt>--with-ldap</tt> )! I would also suggest using --with-mhash in your PHP configure, and setting MD5 in define(&quot;PQL_PW_HASH&quot;,&quot;MD5&quot;); so that passwords longer than 8 characters are recognized (and not just truncated to 8 characters). 
  
 <list><ul><li>If you're using ReiserFS partitions, you may want to optimze the performance of the partition containing your /var/qmail/queue directory.</li></ul></list> <list><ul><li>If you're using ReiserFS partitions, you may want to optimze the performance of the partition containing your /var/qmail/queue directory.</li></ul></list>
Line 324: Line 194:
       (Of course you'll have to reboot before this takes effect...) You may want to read <uri strref="http://www.jedi.claranet.fr/reiserfs-tuning.html"/> for a more detailed explanation.       (Of course you'll have to reboot before this takes effect...) You may want to read <uri strref="http://www.jedi.claranet.fr/reiserfs-tuning.html"/> for a more detailed explanation.
  
-<list><ul><li>Unknown to me - you end up with TLS SMTP encryption installed - without even asking! qmail will advertise the capability of receiving encrypted SMTP messages, but it won't work until you set up a server certificate (This one is a self-signed certificate for years - 1461 days):</li></ul></list> +<list><ul><li>Unknown to me - you end up with TLS SMTP encryption installed - without even asking! qmail will advertise the capability of receiving encrypted SMTP messages, but it won't work until you set up a server certificate (This one is a self-signed certificate for 10 years - 3650 days):</li></ul></list> 
-    <tt>openssl req -new -x509 -nodes -out /var/qmail/control/cert.pem -days 1461 -keyout /var/qmail/control/cert.pem</tt>+    <tt>openssl req -new -x509 -nodes -out /var/qmail/control/cert.pem -days 3650 -keyout /var/qmail/control/cert.pem</tt>
  
-    <tt>chmod 640 /var/qmail/control/cert.pem</tt> +<code> 
-<p>    <tt>chown qmaild:qmail /var/qmail/control/cert.pem</tt></p><p>      or copy from your imap-ssl install</p><p>    <tt>cp /usr/lib/courier-imap/share/imapd.pem /var/qmail/control/cert.pem</tt></p><p>    <tt>chown qmaild:qmail /var/qmail/control/cert.pem</tt></p><p>    <tt>chmod 640 /var/qmail/control/cert.pem</tt></p+chmod 640 /var/qmail/control/cert.pem 
-<list><ul><li>Start it up and see if it works! <tt>/etc/rc.d/init.d/qmail start</tt> Test your TLS installation by sending a test message to [email protected] and look for the return header something like:</li></ul></list>+chown qmaild:qmail /var/qmail/control/cert.pem 
 +</code> 
 + 
 +<list><ul><li>Start it up and see if it works! <tt>/etc/init.d/qmail start</tt> Test your TLS installation by sending a test message to [email protected] and look for the return header something like:</li></ul></list>
   Received: from unknown (HELO www.TBS-satellite.com) (213.186.35.102) (envelope-sender )   Received: from unknown (HELO www.TBS-satellite.com) (213.186.35.102) (envelope-sender )
  
Line 335: Line 208:
  
 ====== virtualdomains (wildcard domain aliasing): ====== ====== virtualdomains (wildcard domain aliasing): ======
-I have an old domain pic.ab.ca - I wanted to set up [email protected] to be automatically rewritten to sameuser@~MrZesty.net+I have an old domain pic.ab.ca - I wanted to set up [email protected] to be automatically rewritten to [email protected]
  
 To do that you must add the domain to the control/rcpthosts file <strong>only!</strong> (not to locals like you would normally do), then create a file called virtualdomains in your qmail/control directory. To do that you must add the domain to the control/rcpthosts file <strong>only!</strong> (not to locals like you would normally do), then create a file called virtualdomains in your qmail/control directory.
Line 351: Line 224:
 <tt>pic.ab.ca:alias-mrzesty</tt> <tt>pic.ab.ca:alias-mrzesty</tt>
 <p>if you wanted the user 'alias' to handle the direction of the mail. If you wanted a regular user to handle the mail, you could just as easily make it</p><p><tt>pic.ab.ca:ian</tt></p><p>then by creating a ~ian/.qmail-default file, all mail for pic.ab.ca would be directed through the instructions in ~ian/.qmail-default</p> <p>if you wanted the user 'alias' to handle the direction of the mail. If you wanted a regular user to handle the mail, you could just as easily make it</p><p><tt>pic.ab.ca:ian</tt></p><p>then by creating a ~ian/.qmail-default file, all mail for pic.ab.ca would be directed through the instructions in ~ian/.qmail-default</p>
 +
 ====== SMTP_AUTH: ====== ====== SMTP_AUTH: ======
 <uri strref="http://www.lifewithqmail.org/ldap/#SMTP%20AUTH"/> <uri strref="http://www.lifewithqmail.org/ldap/#SMTP%20AUTH"/>
Line 369: Line 243:
 quit quit
 </code> </code>
-My final <tt>/service/qmail-smtpd/run</tt> file looks like this: 
  
-<code> 
-#!/bin/sh 
-QMAILDUID=`id -u qmaild` 
-NOFILESGID=`id -g qmaild` 
-MAXSMTPD=20 
- 
-exec /usr/local/bin/softlimit -m 20000000 \ 
-         /usr/local/bin/tcpserver -v -R -l 0 -x /var/qmail/control/qmail-smtpd.cdb -c &quot;$MAXSMTPD&quot; \ 
-              -u &quot;$QMAILDUID&quot; -g &quot;$NOFILESGID&quot; 0 smtp \ 
-                /usr/local/bin/rblsmtpd -b -rrelays.ordb.org -rbl.spamcop.net \ 
-                      /var/qmail/bin/qmail-smtpd /var/qmail/bin/auth_smtp /bin/true 2&gt;&amp;1 
-</code> 
 If you want to test smtp-auth and 'auth login' you will need to generate base64 encoded versions of your username and password (I'm using PHP here): If you want to test smtp-auth and 'auth login' you will need to generate base64 encoded versions of your username and password (I'm using PHP here):
  
 <code> <code>
-echo '&lt;? print base64_encode(&quot;ian&quot;).&quot;\n&quot;; ?&gt;' | php+echo '<?php print base64_encode('ian').'\n'; ?>' | php
 aWFu aWFu
  
-echo '&lt;? print base64_encode(&quot;password&quot;).&quot;\n&quot;; ?&gt;' | php+echo '<?php print base64_encode('password').'\n'; ?>' | php
 cGFzc3dvcmQ= cGFzc3dvcmQ=
 </code> </code>
Line 412: Line 273:
 quit quit
 </code> </code>
-If you authenticate successfully, you will see &quot;235 go ahead&quot;.+If you authenticate successfully, you will see '235 go ahead'.
  
 ====== ezmlm: ====== ====== ezmlm: ======
Line 430: Line 291:
  
 replogfile /usr/local/var/openldap-slurp/slurpd.replog replogfile /usr/local/var/openldap-slurp/slurpd.replog
-<p>replica host=ldap2.mrzesty.net:389 binddn=&quot;cn=manager,dc=mrzesty,dc=net&quot; bindmethod=simple credentials=managers-password</p><p>Add the following two lines to the slave's slapd.conf:</p><p>updatedn &quot;cn=manager,dc=mrzesty,dc=net&quot;</p><p>updateref ldap://ldap1.mrzesty.net</p><p>Start slapd and slurpd on the primary ldap server, and start slapd on the secondary. If you already have data in the ldap database - you should manually copy the /usr/local/var/openldap-ldbm directory and its files to the slave server - before starting slapd and slurpd.</p>+<p>replica host=ldap2.mrzesty.net:389 binddn='cn=manager,dc=mrzesty,dc=netbindmethod=simple credentials=managers-password</p><p>Add the following two lines to the slave's slapd.conf:</p><p>updatedn 'cn=manager,dc=mrzesty,dc=net'</p><p>updateref ldap://ldap1.mrzesty.net</p><p>Start slapd and slurpd on the primary ldap server, and start slapd on the secondary. If you already have data in the ldap database - you should manually copy the /usr/local/var/openldap-ldbm directory and its files to the slave server - before starting slapd and slurpd.</p>
  
qmail-ldap.1104431194.txt.gz · Last modified: 2020/02/13 22:55 (external edit)

free spam filter