I have been dreaming of being master of my very own email addresses for a while now. Finally, [ m @ thedigitalmachine.com] has arrived.

Actually getting Redhat 7.2 to cooperate with my plans required a bit of digging to uncover an underlying problem. It turns out that for Redhat 7.2’s default configuration, “sendmail will only accept and send email for ‘localhost'”. You will not get mail from any other box until you change this default, which takes a little work. Get the full dirt here, read on…

Here’s the tricky part. This was originally from OCLUG (I hope they don’t mind, but I copied it here in case it “disappears”):

Setting Up Web Mail on RedHat 7.2by Kevin Brouelette, OCLUG (3-22-02)

This ‘How-to’ is based on my setup of a RedHat 7.2 server as an sendmail/IMAP/Webmail server using as many ‘stock’ Redhat RPM’s as possible. It’s based on a stripped down install using a ‘kickstart’ floppy and the only non-RedHat RPM’s being those for Squirrelmail. This document assumes that your MX records point to the IP of this server so the email will get to it. This setup will finalize using approx 385MB of your hard drive and could probably be reduced even further.
I used ‘Kickstart’ to make the install smooth. It works on my pc so it should be fine on yours.
This How-to assumes the user has the basic skills to configure his Linux server.

1] Kickstart disk
Make a boot floppy from the /images/boot.img on RH7.2 disk#1 using ‘dd’ or ‘rawrite’.
Empty the contents of “syslinux.cfg” on the floppy and add the following 5 lines:
default ks
prompt 0
label ks
kernel vmlinuz
append ks=floppy initrd=initrd.img devfs=nomount ramdisk_size=7168
Next, create a NEW file on the floppy called ks.cfg and add the following as the contents:
ks.cfg
Boot up from the floppy with CD1 in the PC and RedHat will begin the install.
You may partition as you like or just ‘auto partition’ and the rest of the install is done for you.
Put in CD2 when prompted.
Lilo auto installs on the MBR and no rescue floppy will be made etc.
I haven’t tried this on a dual boot, so just use a dedicated hard drive
as this could remove all the data from your drive.
2] Reboot after install
After the system reboots, you may logon as ‘root’ with the password ‘123456’.
Immediately change the ‘root’ password to something more secure.
The kickstart disk setup the network as a DHCP client so you can setup your specific networking
settings as required by your needs.
3] Put in all of the Latest RedHat RPM updates. [don’t miss this step!]
Subscribe to RedHat Network or ftp them from a mirror like ftp://mirrors.kernel.org/redhat/redhat/linux
4] Use ‘ntsysv’ or ‘chkconfig’ and enable the following:
anacron
atd
crond
httpd
imap
imaps
keytable
network
random
rawdevices
sendmail
syslog
xinetd
[Make sure those daemons that do not run through xinetd are up and running.]
Restart xinetd when you are done:
service xinetd restart
[or just reboot]
5] Create a new sendmail.cf file. [Thanks Christopher M.]
Enable the following 3 lines in /etc/mail/sendmail.mc [uncomment them by removing the leading ‘dnl’ to look like this]
TRUST_AUTH_MECH(`DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
define(`confAUTH_MECHANISMS’, `DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
FEATURE(delay_checks)dnl
Comment OUT the following by adding ‘dnl’ to the beginning so it looks like this:
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)
Make those chages,save, and make a new /etc/sendmail.cf by running the following:
m4 /etc/mail/sendmail.mc > /etc/sendmail.cf
Two reasons for the above changes to the default RedHat sendmail.mc are that
the first 3 lines we enabled will allow us to RELAY mail thru our mail server
without it being an ‘open relay’. We will authenticate with a valid username
and password to be authorized to RELAY email.
Secondly, by default, sendmail will only accept and send email for ‘localhost’
on a default RedHat 7.2 server so we need to disable that so we can send mail to others.
Add your domain name[s] to /etc/mail/local-host-names and restart sendmail:
service sendmail restart
6] Install Squirrelmail:
Grab the 2 latest rpms from http://www.squirrelmail.org and install them.
Add your domain name to Squirrelmail by running the admin script:
/var/www/html/webmail/config/conf.pl
Select [2] then [1] and change to your FQDN. Save and exit.
7] Add some normal users:
Add the users the regular way now and set them up with a password. If you’d like, you can set their
default shell to /bin/false in the /etc/passwd file and dis-allow them a shell login.
8] Login!
If all the above was done you can browse your server from a remote PC with an SSL enabled browser:
https://123.456.789.012/webmail/
Login, go to ‘options’ [at the top of the main screen] and setup your personal settings now. [you need an accurate Reply To: ]
9] You’re done!
That’s all there is to it.
You can also access the server remotely from Outlook, Evolution, Sylpheed etc, by enabling ‘IMAP’ and ‘SMTP Server Requires Auth…’
If you don’t, your mail will come back with a ‘Relaying Denied’ error.
IMAP configuration in Windows
10] Check out the Squirrelmail website for great plugins!
‘Plugins’ are what make Squirrelmail really shine!
Many cool features are easily added by extracting the plugins to
/var/www/html/webmail/plugins and going back in to the admin script and enable the plugin listed there.
You can also setup centralized ‘filters’ for your IMAP users by using ‘Procmail’ so each email
client won’t have to set them up seperatly.
Be sure to think about any additional firewall or security issues you may wish to add.
Kevin Brouelette
kevin1a@socal.rr.com

Leave a Reply