Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




22.5. Build and Tweak Sendmail

Now that our macro configuration file is created, we can build the sendmail configuration file from these statements with the following commands:
           [root@deep] /# cd /var/tmp/sendmail-version/cf/cf/
           [root@deep ]/cf# m4 ../m4/cf.m4 > /etc/mail/

Note: Here, the ../m4/cf.m4 tells m4 program where to look for its default configuration file information.

22.5.1. The file

Since our local clients machines never receive mail directly from the outside world, and relay, send all their mail through the Mail Hub server, we will create a special file called which, when later processed, will create a customized configuration file that responds to this special setup for our neighbour or local server client machines. This m4 macro file is simple to create and configure because it doesn't need a lot of features, as the configuration file, for the Central Mail Hub server did.


The file is for the local or neighbour client and server machines only

  1. Create the file, touch /var/tmp/sendmail-version/cf/cf/ and add the following lines:
                 OSTYPE(`linux')dnl                        (1)
               DOMAIN(`generic')dnl                        (2)
               FEATURE(`nullclient',`')dnl  (3)
               undefine(`ALIAS_FILE')dnl                   (4)

    This configuration option specifies the default operating system Sendmail will be running on, in our case, the linux system. This item is one of the minimal pieces of information required by the mc file.
    This configuration option will specify and describe a particular domain appropriated for your environment.
    This m4 macro sets your clients machines to never receive mail directly, to send their mail to a Central Mail Hub, and relay all mail through that server rather than sending directly. This feature creates a stripped down configuration file containing nothing but support for forwarding all mail to a Mail Hub via a local SMTP-based network. The argument `' included in this feature is the canonical name of that Mail Hub. You should, of course, change this canonical name to reflect your Mail Hub Server for example: FEATURE(`nullclient',`').
    This configuration option prevents the nullclient version of Sendmail from trying to access /etc/mail/aliases and /etc/mail/aliases.db files. With the adding of this line in the .mc file, you don't need to have an aliases file on all your internal neighbor client Sendmail machines. Aliases files are required only on the Mail Hub Server for all server and client aliases on the network.

    Tip: We advice that with this kind of configuration, no mailers should be defined, and no aliasing or forwarding is done.

  2. Now that our macro configuration file is created, we can build the Sendmail configuration file from these statements in all our neighbor servers, and client machines with the following commands:
               [root@deep] /# cd /var/tmp/sendmail-version/cf/cf/
               [root@deep ]/cf# m4 ../m4/cf.m4 > /etc/mail/

  3. No mail should ever again be delivered to your local machine. Since there will be no incoming mail connections, you no longer needed to run a Sendmail daemon on your neighbor or local server, client machines. To stop the Sendmail daemon from running on your neighbor or local server, or client machines, edit or create the /etc/sysconfig/sendmail file and change/add the lines that read:
               To read:

    Note: The QUEUE=1h under /etc/sysconfig/sendmail file causes Sendmail to process the queue once every 1 hour. We leave that line in place because Sendmail still needs to process the queue periodically in case the Mail Hub is down.

  4. Remove the following files from your system, use the following command:
               [root@client /]# rm  -f  /usr/bin/newaliases
               [root@client /]# rm  -f  /usr/man/man1/newaliases.1
               [root@client /]# rm  -f  /usr/man/man5/aliases.5

    Note: Local machines never use aliases, access, or other maps database. Since all map file databases are located and used on the Central Mail Hub Server for all local machines we may have on the network, we can safety remove the following commands and man pages from all our local machines.

    • /usr/bin/newaliases

    • /usr/man/man1/newaliases.1

    • /usr/man/man5/aliases.5

  5. Remove the unnecessary Procmail program from your entire local Sendmail server or client. Since local machines send all internal and outgoing mail to the mail Hub Server for future delivery, we don't need to use a complex local delivery agent program like Procmail to do the job. Instead we can use the default /bin/mail program. To remove Procmail from your system, use the following command:
               [root@client ]# rpm -e procmail

  Published under the terms of the Open Publication License Design by Interspire