Date: Tue, 4 Sep 2001 13:34:59 -0700 (PDT) Here are steps to install Open WebMail. These steps include setting up Apache to run CGI scripts. Please note I am successfully able to use Open WebMail on my OpenBSD system to retrieve and send mails via the virtual email system. This will have a working setup. But it is not thoroughly tested. (Spell check is not installed yet and it is not configured/patched to work with other virtual domains yet.) Maybe I will make further modifications for Open WebMail so it will work properly with several virtual domains and, hopefully, make it more efficient. 1) This is assuming that the install is for the www.foo.bar.org website. (Make the source directory if needed.) su foo.bar cd ~ mkdir src # if needed cd src mkdir openwebmail 2) Open WebMail needs to be installed from source. An OpenBSD port (or package) is not available. (In fact, no OpenBSD ports/packages for web-mail clients are available.) Fetch the source code: lynx -source \ http://turtle.ee.ncku.edu.tw/openwebmail/download/openwebmail-1.40.tgz \ > openwebmail-1.40.tgz (The resulting file is 326,747 bytes.) 3) Unpack the source: cd openwebmail tar xvzf ../openwebmail-1.40.tgz 4) Begin to install CGI script and files. mv cgi-bin/openwebmail ~/public_html/ mv data/openwebmail/images ~/public_html/openwebmail/ mv data/openwebmail/yougotmail.* ~/public_html/openwebmail/ 5) Enable CGI scripts for Apache. You'll need to be superuser for these steps. First edit the /var/www/conf/httpd.conf file. Uncomment the "AddHandler cgi-script .cgi" line by removing the hash mark and add " .pl" to the end of that line, for example: # To use CGI scripts: # AddHandler cgi-script .cgi .pl Then add the "ExecCGI" option to the end of the Options line in the "" container. Then restart the Apache servers: apachectl graceful You can check for errors when trying CGI scripts with: tail /var/www/logs/error_log (Change back to a regular non-root user -- foo.bar.) 6) Start to configure Open WebMail. cd ~/public_html/openwebmail mkdir ~/openwebmail mv ~/public_html/openwebmail/etc ~/openwebmail chmod g+w /home/foo.bar/openwebmail/etc/sessions chmod g+w /home/foo.bar/openwebmail/etc/users 7) Edit ~/openwebmail/etc/openwebmail.conf. (This config file is attached.) Set $defaultlanguage to 'en'. Set @domainnames to 'foo.bar.org'. Set $passwdfile to '/etc/virtual/foo.bar.org/passwd'. Set $timeoffset to '-0800'; Set $mailspooldir to '/var/spool/virtual/foo.bar.org'. Set $homedirfolders to 'no'. Set $openwebmaildir to '/home/foo.bar/openwebmail/etc'. Set $global_addressbook to '/home/foo.bar/openwebmail/etc/address.book'. Set $global_filterbook to '/home/foo.bar/openwebmail/etc/filter.book'. Set $logfile to '/home/foo.bar/openwebmail/openwebmail.log'. Set $scripturl to '/openwebmail/openwebmail.pl'. Set $prefsurl to '/openwebmail/openwebmail-prefs.pl'. Set $spellcheckurl to '/openwebmail/spellcheck.pl'. Set $imagedir to '/home/foo.bar/public_html/openwebmail/images'. Set $defaultsignature to ''. 8) Setup permissions: chgrp mail /home/foo.bar/public_html/openwebmail/openwebmail.pl chmod g+s /home/foo.bar/public_html/openwebmail/openwebmail.pl chgrp -R mail /home/foo.bar/openwebmail chmod g+w /home/foo.bar/openwebmail/openwebmail.log 9) Set up proper permissions for Open WebMail's use of mail spools. chmod g+rwx /var/spool/virtual/foo.bar.org chmod g+rw /var/spool/virtual/foo.bar.org/testuser (This is for testing.) 9) Edit ~/openwebmail/etc/openwebmail.conf so @domainnames is set to 'foo.bar.org'. 10) Install the MIME-Base64 perl module. (Open WebMail comes with Mime perl code, but the Perl module works better and faster.) cd /usr/ports/converters/p5-MIME-Base64 su root -c 'make install This will fetch and install this perl module. 11) Several of the perl scripts have been modified. Attached is a patch. Place the patch at ~/src/openwebmail.diff. cd ~/public_html/openwebmail patch < /home/foo.bar/src/openwebmail.diff This will report a few errors, but should patch three files successfully. 12) The permissions on the CGI scripts must be reset. It will run as group mail. (This needs to be done by root.) chgrp mail /home/foo.bar/public_html/openwebmail/openwebmail-prefs.pl chmod g+s /home/foo.bar/public_html/openwebmail/openwebmail-prefs.pl chgrp mail /home/foo.bar/public_html/openwebmail/openwebmail.pl chmod g+s /home/foo.bar/public_html/openwebmail/openwebmail.pl 13) Set "www" to be a trusted user for exim. This is so the "Sender:" header for the emails will be correct. (This needs to be done as root.) Add to your /etc/exim/configure file below the "never_users = root" setting: --Start here-- # If this option is set, then any process that is running as one of the # listed users may pass a message to Exim and specify the sender's # address using the "-f" command line option, without Exim's adding a # "Sender" header. trusted_users = www --End here-- Then tell Exim to use new configure file by sending SIGHUP signal to teh Exim daemon. ps auxwwww | grep exim # this will return process ID kill -SIGHUP the-process-id-number-here 14) Try it on your system at: http://www.foo.bar.org/openwebmail/openwebmail.pl 15) The patch for openwebmail.pl. Near the top of your /home/foo.bar/public_html/openwebmail/openwebmail.pl should have: push (@INC, '/home/foo.bar/openwebmail', "."); Some other notes: The passwd file must be readable. # ls -ld /etc/virtual/foo.bar.org drwxr-xr-x 2 root wheel 512 Aug 21 17:00 /etc/virtual/foo.bar.org # ls -l /etc/virtual/foo.bar.org/passwd -rw-r----- 1 root mail 35 Aug 31 21:57 /etc/virtual/foo.bar.org/passwd The openwebmail.pl (and openwebmail-prefs.pl) must be setgid "mail": # ls -l /home/foo.bar/public_html/openwebmail/openwebmail{,-prefs}.pl -rwxr-sr-x 1 foo.bar mail 102605 Sep 4 16:19 /home/foo.bar/public_html/openwebmail/openwebmail-prefs.pl -rwxr-sr-x 1 foo.bar mail 139600 Sep 4 16:19 /home/foo.bar/public_html/openwebmail/openwebmail.pl (Notice that the group is "mail" above and that the group permissions are "r-s".) In the openwebmail.conf file, the $passwdfile must be set correctly. # grep ^\$passwdfile /home/foo.bar/openwebmail/etc/openwebmail.conf $passwdfile = '/etc/virtual/foo.bar.org/passwd'; In the /home/foo.bar/public_html/openwebmail/auth.pl script, the check_userpassword_by_file() routine needs to have an added line: open (PASSWD, $passwdfile) or return 0; while (defined($line=)) { # 31/Aug/2001 reed # if passwd file only has two fields then second field will have a newline # so chop it off chomp ($line); ($u, $p) = (split(/:/, $line))[0,1]; Another way: In this directory are three files to use instead of patching. Use it with: chgrp mail /home/foo.bar/public_html/openwebmail/openwebmail-prefs.pl chmod g+s /home/foo.bar/public_html/openwebmail/openwebmail-prefs.pl chgrp mail /home/foo.bar/public_html/openwebmail/openwebmail.pl chmod g+s /home/foo.bar/public_html/openwebmail/openwebmail.pl