Title: qmail notes Subject: more notes on qmail -------------------------------- create user accounts -------------------------------- ************************* Untar and get into the new qmail dir. ************************* cd qmail-1.03 ************************* Create the home for the application (/var/qmail) ************************* [root@server qmail-1.03]# mkdir /var/qmail ************************* Create the qmail lisener users/groups (alias, qmaild, mqmaill, qmailp/alias, qmailq, qmailr, qmails) ************************* [root@server qmail-1.03]# cp /etc/group group group- group.OLD group.lock [root@server qmail-1.03]# cp /etc/group /etc/group.20000805 [root@server qmail-1.03]# groupadd nofiles [root@server qmail-1.03]# useradd -g nofiles -d /var/qmail/alias alias [root@server qmail-1.03]# useradd -g nofiles -d /var/qmail qmaild [root@server qmail-1.03]# useradd -g nofiles -d /var/qmail qmaill [root@server qmail-1.03]# useradd -g nofiles -d /var/qmail qmailp [root@server qmail-1.03]# groupadd qmail [root@server qmail-1.03]# useradd -g qmail -d /var/qmail qmailq [root@server qmail-1.03]# useradd -g qmail -d /var/qmail qmailr [root@server qmail-1.03]# useradd -g qmail -d /var/qmail qmails ************************* This will test your reverse dns on the HOSTNAME Unless this works, you cant go any farther, so ... If you can't correct the rdns, make the first line of your /etc/hosts file 127.0.0.1 HOSTNAME and Make the server resolve with the hosts file before DNS (/etc/nsswitch.cong) hosts: files dns You may need to restart netwroking, I don't know. ************************* [root@server qmail-1.03]# make setup check [root@server qmail-1.03]# ./config Your hostname is server. soft error Sorry, I couldn't find your host's canonical name in DNS. You will have to set up control/me yourself. ************************* I'm defigning the dns here, to name the server as an MX (mail exchanger) This step sets up the default domin, and tells you how to add virtual domains. ************************* [root@server qmail-1.03]#vi /var/named/db.mydomain.com mail IN CNAME hostname.mydomain.com. IN MX 0 mydomain.com. ;Primary Mail Exchanger IN MX 0 mail.mydomain.com. [root@server qmail-1.03]# ./config Your hostname is server.mydomain.com. Your host's fully qualified name in DNS is mail.mydomain.com. Putting mail.mydomain.com into control/me... Putting mydomain.com into control/defaultdomain... Putting mydomain.com into control/plusdomain... Checking local IP addresses: 127.0.0.1: PTR lookup failed. I assume this address has no DNS name. 192.168.0.1: PTR lookup failed. I assume this address has no DNS name. 63.192.209.83: Adding mail.mydomain.com to control/locals... If there are any other domain names that point to you, you will have to add them to /var/qmail/control/locals. You don't have to worry about aliases, i.e., domains with CNAME records. Copying /var/qmail/control/locals to /var/qmail/control/rcpthosts... Now qmail will refuse to accept SMTP messages except to those hosts. Make sure to change rcpthosts if you add hosts to locals or virtualdomains! ************************* Check what qmail made as the mail server ************************ [root@server /root]# cat /var/qmail/control/locals mail.mydomain.com [root@server /root]# cat /var/qmail/control/locals mail.mydomain.com [root@server /root]# cat /var/qmail/control/rcpthosts mail.mydomain.com ************************* Make qmails files (.qmail-postmaster .qmail-mailer-daemon .qmail-root .qmail-default) ************************* [root@server /root]# cd ~alias [root@server alias]# pwd /var/qmail/alias [root@server alias]# ls -laF [root@server alias]# touch .qmail-postmaster .qmail-mailer-daemon .qmail-root .qmail-default [root@server alias]# ls -laF [root@server alias]# chmod 644 ~alias/.qmail* [root@server bin]# cat /var/log/maillog and look for qmail: stuff [root@server qmail]# cp /var/qmail/boot/home /var/qmail/rc ------------------------------------------------------------------ [root@server alias]# mv /usr/sbin/sendmail /usr/sbin/sendmail.org [root@server alias]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail [root@server alias]# mv /usr/sbin/sendmail /usr/sbin/sendmail.org [root@server alias]# mv /usr/lib/sendmail /usr/lib/sendmail.org [root@server alias]# ln -s /var/qmail/bin/sendmail /usr/lib/sendmail ----------------------------------------------------------------------- [root@server bin]# ps -aux |grep sen root 537 0.0 1.0 2104 652 ? S 05:40 0:00 sendmail: accepting c root 1547 0.0 0.7 1240 492 ? S 06:14 0:00 grep sen [root@server bin]# kill -9 537 [root@server bin]# ps -aux |grep sen [root@server bin]# ps -aux |grep qmi root 1551 0.0 0.6 1124 392 ? R 06:14 0:00 grep qmi [root@server bin]# vi /etc/inetd.conf [root@server bin]# kill -HUP [root@server bin]# ps -el |grep [q]mail [root@server bin]# ps -ef |grep qm 1569 ? S 0:00 \_ grep qm USERNAME=root ENV=/root/.bashrc HISTSIZE=1000 H [root@server bin]# ------------------------------------------------------------------------ vi /etc/inetd.conf Append smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-smtpd [root@server bin]# kill -HUP [root@server bin]# vi /etc/rc.d/init.d/qmail #!/bin/sh csh -cf '/var/qmail/rc &' exit Add a link in rc5.d that points to the start script. [root@server bin]# ln -s /etc/rc.d/init.d/qmail /etc/rc.d/rc5.d/S80qmail kill -HUP ------------------------------------------------- ------------------------------------------------- we are having dns problems. so we are going to setup dnsboss -------------------------------------------------- backup /var/named to /home/lars/ backup /etc/named.conf to /etc/named.conf.20000805 -------------------------------------------------- http://www.dnsboss.com/cheat_sheet/index.shtml [root@server DNSBoss]# mkdir /home/dnsboss [root@server DNSBoss]# cd /home/dnsboss [root@server DNSBoss]# tar -zxvpf DNSBoss_Linux.tar.gz [root@server dnsboss]# ./install.sh ____________________________________________________________________________ Starting DNS Boss postinstall script. Appending the following to /etc/passwd: dnsboss:CwPnQMzHqVLoA:30000:30000:dnsboss:/tmp:/bin/tcsh Appending the following to /etc/group: dnsboss::30000:root,dnsboss chown -R root /opt/DNSBoss chown -R root /var/opt/DNSBoss chgrp -R dnsboss /opt/DNSBoss chgrp -R dnsboss /var/opt/DNSBoss chmod -R 770 /var/opt/DNSBoss ____________________________________________________________________________ IMPORTANT TO READ A non-root user account has been setup to maintain DNS Boss. The user name is: dnsboss, and the passwd is: _theboss. It is suggested that you change the passwd. Made a copy of /etc/named.conf to: /etc/named.conf.Aug52000215118. /bin/ls -l /etc/named.conf.Aug52000215118 -rw-r--r-- 1 root root 313 Aug 6 04:51 /etc/named.conf.Aug52000215118 ____________________________________________________________________________ Completed DNS Boss installation successfully! ____________________________________________________________________________ DNSBoss must be run as "root" or "dnsboss". This is how you start it: # /opt/DNSBoss/bin/dnsboss This is the normal mode (no options). or # /opt/DNSBoss/bin/dnsboss -help (Shows all options). or # /opt/DNSBoss/bin/dnsboss -safemode If you use the -safemode option or as root, or start up dnsboss dnsboss% /opt/DNSBoss/bin/dnsboss as the dnsboss user, you will not be able to restart in.named, or write to /etc/named.boot. You will be able to create DNS databases. However, they will not become live DNS data until you run /opt/DNSBoss/bin/dnsboss as root with no options (normal mode). or the non-GUI mode- /opt/DNSBoss/bin/dnsboss_commandline -autobuild_all_domains (Updates all DNS domains and restarts DNS server from the command line with no GUI. Requires that one or more domain(s) already have been created via the GUI or from the command line). or # /opt/DNSBoss/bin/dnsboss_commandline -autobuild your_company.com (Updates a single domain instead of all domains). or # /opt/DNSBoss/bin/lockdnsboss This option logs the name of the current administrator along with a date stamp, and lock out other administrators until the current user is done. IMPORTANT TO READ ____________________________________________________________________________ testing phayse, [root@server bin]# echo to: lars | /var/qmail/bin/qmail-inject The basic procedure for switching to ~user/Mailbox is simple: * Move each /var/spool/mail/user to ~user/Mailbox. For safety, do this in single-user mode. mv /var/spool/mail/user ~user/Mailbox * As root, set up a symbolic link from /var/spool/mail/user to ~user/Mailbox for each user. /var/spool/mail should be mode 1777, so users will not be able to accidentally remove these links. ln -s ~user/Mailbox /var/spool/mail/user chmod 1777 /var/spool/mail/user * Most MUAs: Put ``setenv MAIL $HOME/Mailbox'' in your system-wide .cshrc and ``MAIL=$HOME/Mailbox; export MAIL'' in your system-wide .profile. * pine: Put ``inbox-path=Mailbox'' in your system-wide pine.conf. (For pine versions more recent than 3.91, see also FAQ 6.2.) http://www.inter7.com/ sending a test email message: echo "this is a test" > testmeassage cat testmeassage this is a test /usr/sbin/sendmail -v johns@ablecom.net < testmeassage telnet stilen.com 25 johns@ablecom.net... Connecting to mailhost.ablecom.net. via esmtp... 220 srv1.sj.ablecom.net ESMTP Sendmail 8.9.3/8.9.3; Sun, 30 Apr 2000 18:31:30 -0700 (PDT) >>> EHLO mother.stilen.com 250-srv1.sj.ablecom.net Hello IDENT:root@adsl-63-195-58-123.dsl.snfc21.pacbell.net [63.195.58.123], pleased to meet you 250-EXPN 250-VERB 250-8BITMIME 250-SIZE 250-DSN 250-ONEX 250-ETRN 250-XUSR 250 HELP >>> MAIL From: SIZE=15 501 ... Sender domain must exist johns@ablecom.net... Data format error /home/jstile/dead.letter... Saved message in /home/jstile/dead.letter Closing connection to mailhost.ablecom.net. >>> QUIT 221 srv1.sj.ablecom.net closing connection NOTE: My ISP rejected the mail /usr/sbin/sendmail -v jstile@ohlone.cc.ca.us < testmeassage jstile@ohlone.cc.ca.us... Connecting to mail.ohlone.cc.ca.us. via esmtp... 220 mail.ohlone.cc.ca.us ESMTP server (Netscape Messaging Server - Version 3.62) ready Sun, 30 Apr 2000 18:52:10 -0700 >>> EHLO mother.stilen.com 250-mail.ohlone.cc.ca.us 250-HELP 250-ETRN 250-PIPELINING 250-DSN 250 AUTH=LOGIN >>> MAIL From: 250 Sender Ok >>> RCPT To: 250 Recipient Ok >>> DATA 354 Ok Send data ending with . >>> . 250 Message received: 20000501015210359.AAA54.236@mother.stilen.com jstile@ohlone.cc.ca.us... Sent (Message received: 20000501015210359.AAA54.236@mother.stilen.com) Closing connection to mail.ohlone.cc.ca.us. >>> QUIT 221 mail.ohlone.cc.ca.us ESMTP server closing connection