Allowing Relaying with sendmail
Add (access_db) feature to the m4 file for sendmail. The m4 file on solaris 9
can be found in /usr/lib/mail/cf
The standard server sendmail m4 file is called main.mc. If this is the first time you have edited it, copy it to a different filename so that you know that it is not the standard one, eg myconfig.mc
If however you already have a custom sendmail file, eg in this case myconfig.mc, copy it to new filename eg myconfig2.mc
previously the file myconfig.mc looked like :
divert(-1)
#
#
divert(0)dnl
VERSIONID(`@(#)myconfig.mc 1.0 (MYCONFIG) 05/05/03')
OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl
MASQUERADE_AS(`mydomain.com')dnl
Now the file myconfig2.mc looks like:
divert(-1)
#
#
divert(0)dnl
VERSIONID(`@(#)myconfig.mc 1.0 (JAW) 05/05/03')
OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl
FEATURE(`access_db')dnl
MASQUERADE_AS(`mydomain.com')dnl
Note the extra FEATURE line to add the access_db feature.
Edit the Makefile to make the new config file as well as the standard main.cf and subsidiary.cf.
run make to make the new custom sendmail config file - this will be called myconfig2.cf
copy the new config file to /etc/mail/sendmail.cf
edit /etc/mail/access to add the hosts that you want to allow relaying for
eg.
1.2.3.4 RELAY
Now we need to make the access table into a map. There are different formats like hash dbm etc. These can be seen by typing 'makemap -l'. The default is type hash which will produce a .db file.
# makemap hash /etc/mail/access < /etc/mail/access
then restart Sendmail. (# /etc/rc2.d/S88sendmail stop; /etc/rc2.d/S88sendmail start
done !