Sendmail Upgrade

Posted on 2005-04-19
Medium Priority
Last Modified: 2013-12-16
Trying to upgrade sendmail!!!
I've got SuSE Linux 8.0 with sendmail-8.12.11 i would like  to upgrade to sendmail-8.13.4
but i really don't know the way to do that!
since the sendmail installation is done from source code!

could someone give some help!
I've tried google but no luck


Question by:karj
  • 5
  • 2

Accepted Solution

Darshan_Jadav earned 240 total points
ID: 13814286
PLz read Sendmail's RELEASE_NOTES and INSTALL files for any special configuration and installation steps.

1. Uncompress the new Sendmail tarball.
gzip -cd sendmail-8.13.4.tar.gz | tar xvf -

2. Copy site.config.m4 (if applicable) and Sendmail macro configuration (mc) file from your previous Sendmail source tree. In this  the name of the Sendmail macro configuration file is sendmail.mc.
cp sendmail-8.12.11/devtools/Site/site.config.m4 sendmail-8.12.11/devtools/Site/site.config.m4
cp sendmail-8.12.11/cf/cf/sendmail.mc sendmail-8.12.11/cf/cf/sendmail.mc

3. Build Sendmail.
cd sendmail-8.12.11
./Build -c

4. Backup the old Sendmail mail transport agent (MTA) and message submission agent (MSA) files; build the new Sendmail configuration files.
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.`date +%m.%d.%y`
cp /etc/mail/submit.cf /etc/mail/sendmail.cf.`date +%m.%d.%y`
cd cf/cf
./Build install-cf
cd ../..

5. Install Sendmail, install the new configuration file, and restart Sendmail. For minimal Sendmail downtime, run the following chain of commands. Each command will proceed only if the previous command was successful (i.e. the previous command returned an exit status of 0).
/etc/init.d/sendmail stop && ./Build install && cp cf/cf/config.cf /etc/mail/sendmail.cf && cp cf/cf/submit.cf /etc/mail/submit.cf && /etc/init.d/sendmail stop && /etc/init.d/sendmail start

Note: you may want to rebuild your Sendmail database files, although they are likely compatible between minor and patch releases.

Here is a shell script I wrote named upgrade_sendmail to automate the process. I have successfully upgraded Sendmail 8.12.11 to Sendmail 8.13.0 using this script. You should only use a similar process once you are comfortable upgrading Sendmail manually.

Script usage:
upgrade_sendmail path_to_old_Sendmail_source_tree path_to_new_Sendmail_source_tree

upgrade_sendmail /usr/src/sendmail-8.12.10 /usr/src/sendmail-8.13.4


printUsage() {
   echo "  Usage: `basename $0` old_source_tree new_source_tree"
   echo "Example: `basename $0` sendmail-8.12.10 sendmail-8.13.4"
   exit 1

compareVersions() {
   OLD_VERSION=`echo $OLD_SENDMAIL | sed 's/.*sendmail-//'`
   NEW_VERSION=`echo $NEW_SENDMAIL | sed 's/.*sendmail-//'`
   OLD_VERSION_MAJOR=`echo $OLD_VERSION | cut -d\. -f1`
   OLD_VERSION_MINOR=`echo $OLD_VERSION | cut -d\. -f2`
   OLD_VERSION_PATCH=`echo $OLD_VERSION | cut -d\. -f3`
   NEW_VERSION_MAJOR=`echo $NEW_VERSION | cut -d\. -f1`
   NEW_VERSION_MINOR=`echo $NEW_VERSION | cut -d\. -f2`
   NEW_VERSION_PATCH=`echo $NEW_VERSION | cut -d\. -f3`
   if [ "$NEW_VERSION_MAJOR" -gt "$OLD_VERSION_MAJOR" ] ; then
   elif [ "$NEW_VERSION_MAJOR" -eq "$OLD_VERSION_MAJOR" ] && \
        [ "$NEW_VERSION_MINOR" -gt "$OLD_VERSION_MINOR" ] ; then
   elif [ "$NEW_VERSION_MAJOR" -eq "$OLD_VERSION_MAJOR" ] && \
        [ "$NEW_VERSION_MINOR" -eq "$OLD_VERSION_MINOR" ] && \
        [ "$NEW_VERSION_PATCH" -gt "$OLD_VERSION_PATCH" ] ; then
   elif [ "$NEW_VERSION_MAJOR" -eq "$OLD_VERSION_MAJOR" ] && \
        [ "$NEW_VERSION_MINOR" -eq "$OLD_VERSION_MINOR" ] && \
        [ "$NEW_VERSION_PATCH" -eq "$OLD_VERSION_PATCH" ] ; then
      echo "Version $OLD_VERSION is the same as ${NEW_VERSION}.\n"
      echo "Version $OLD_VERSION is newer than ${NEW_VERSION}.\n"

# Command-line arguments
# $1 is the path to the old Sendmail source tree.
# $2 is the path to the new Sendmail source tree.

# If two command-line arguments were not provided, print usage and exit
[ $# -ne 2 ] && printUsage

# If either of the source directories are not accessible, exit.
if [ ! -d "$1" ] || [ ! -d "$2" ] ; then
   echo "Problem accessing old or new Sendmail source directory. Exiting."
   exit 1

# Compare command-line arguments to ensure that $NEW_SENDMAIL
# is a newer version than $OLD_SENDMAIL


# Copy configuration information from previous Sendmail version
[ -s ${OLD_SENDMAIL}/devtools/Site/site.config.m4 ] && \
cp ${OLD_SENDMAIL}/devtools/Site/site.config.m4 \

if [ ! -s ${OLD_SENDMAIL}/cf/cf/sendmail.mc ] ; then
   echo "${OLD_SENDMAIL}/cf/cf/sendmail.mc not found. Exiting."
   exit 1

cp ${OLD_SENDMAIL}/cf/cf/sendmail.mc \

# Build Sendmail
echo "Building Sendmail $NEW_VERSION...\n"
PATH=$PATH:/usr/ccs/bin ./Build -c
if [ $? -eq 1 ] ; then
   echo "\nSendmail $NEW_VERSION build failed. Exiting."
   exit 1

# Build new sendmail.cf file
cd cf/cf
echo "\nBuilding Sendmail $NEW_VERSION sendmail.cf configuration file...\n"
PATH=$PATH:/usr/ccs/bin ./Build sendmail.cf
if [ $? -eq 1 ] ; then
   echo "\nSendmail $NEW_VERSION sendmail.cf configuration file build failed. Ex
   exit 1

# Build new submit.cf
echo "\nBuilding Sendmail $NEW_VERSION submit.cf configuration file...\n"
PATH=$PATH:/usr/ccs/bin ./Build submit.cf
if [ $? -eq 1 ] ; then
   echo "\nSendmail $NEW_VERSION submit.cf configuration file build failed. Exit
   exit 1

cd ../..

echo "\nThe root password is required to complete Sendmail $NEW_VERSION \

/bin/su root -c 'echo "\nInstalling Sendmail ${NEW_VERSION}...\n"; \
   /etc/init.d/sendmail stop && \
   PATH=$PATH:/usr/ccs/bin ./Build install && \
   cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.`date +%m.%d.%y` && \
   cp /etc/mail/submit.cf /etc/mail/submit.cf.`date +%m.%d.%y` && \
   cd cf/cf && \
   cp sendmail.cf /etc/mail/sendmail.cf && \
   cp submit.cf /etc/mail/submit.cf && \
   /etc/init.d/sendmail stop && \
   /etc/init.d/sendmail start'
[ $? -eq 1 ] && echo "\nSendmail $NEW_VERSION installation failed." && \
   exit 1

echo "\nUpgrade from Sendmail $OLD_VERSION to Sendmail $NEW_VERSION complete."

Hope this helps ..

Expert Comment

ID: 13814311
2. Copy site.config.m4 (if applicable) and Sendmail macro configuration (mc) file from your previous Sendmail source tree. In this  the name of the Sendmail macro configuration file is sendmail.mc.
cp sendmail-8.12.11/devtools/Site/site.config.m4 sendmail-8.13.4/devtools/Site/site.config.m4
cp sendmail-8.12.11/cf/cf/sendmail.mc sendmail-8.13.4/cf/cf/sendmail.mc

3. Build Sendmail.
cd sendmail-8.13.4
./Build -c

sorry typo mistakes ;-)

Expert Comment

ID: 13828373
SuSE is an RPM based distribution of Linux.

RPM is a package format developed by RedHat that allows software developers, vendors, etc. package their program into one or more RPM files, which can then be installed in an automated manner using the "rpm" command-line tool, or various graphical tools that may be available.

Distributions that are based on RPM packages have all of the included software built into an RPM package.  Each RPM package contains the needed files, as well as built-in instructions on how the software should be installed, what it needs (other packages), what it provides, etc.  This lends some intelligence to the installation of software, and takes much of the pain out of it.  It's comparable in use to the "Add/Remove Programs" interface of Windows in purpose, but typically works much better, at the expense of more interaction.

SuSE has spent a great deal of time packaging all the software so that it works cleanly together, works with their configuration tools, etc.  Whenever possible, I would recommend continuing with the SuSE packages.  It is possible to compile from source and install newer versions of software than is available from SuSE, but you will lose the benefit of their configuration tools, the RPM "intelligence" (if it's not installed via RPM, then RPM doesn't know it exists), etc.  In other words, building from source is "the hard way", and I wouldn't recommend it unless you're familiar with this already.  sendmail is not a good place to start that learning process.

The latest version of sendmail that SuSE offers for 8.0 is sendmail 8.12.3 (78).  It can be found at ftp://ftp.suse.com/pub/suse/discontinued/i386/update/8.0/n1/sendmail-8.12.3-78.i386.rpm

The 78 is probably a SuSE patch-level.  Many major vendors, such as RedHat and SuSE, will backport bugfixes and features to older versions of software.  This allows you to continue using tested and compatible software without suffering a lack of fix or feature.  I would recommend upgrading to this version of sendmail first, and see if it satisfies your needs.  You may also wish to look at postfix, which is a considerably "lighter" MTA than sendmail, but offers a variety of commonly needed features and an excellent choice for production mail servers.

Other versions of sendmail available include sendmail-8.12.6-159.i586.rpm from SuSE 8.1 (may be able to install, possibly requiring other packages to be updated), sendmail-8.12.7-77.i586.rpm from SuSE 8.2, sendmail-8.12.10-15.i586.rpm from SuSE 9.0 (probably wont work without significant upgrades to other packages), sendmail-8.12.10-158.i586.rpm from SuSE 9.1, and sendmail-8.13.1-5.1.i586.rpm from SuSE 9.2.

If you're stuck on sendmail 8.13, but the specific rev isn't important, I'd recommend looking at a full upgrade to SuSE 9.2 if the primary purpose is a mail server.  I will warn you, however, that SuSE has changed a lot from 7 to 8 to 9... personally, I prefer the older versions.  There's also the SuSE Enterprise Linux stuff, which has allowed them to make their "mainstream" distro more suited to desktop use than servers.  On an unrelated note, Novell has since acquired SuSE and changed their name to SUSE (no mixed case), which is likely to have a significant effect on their business model, etc.
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks


Author Comment

ID: 13857698
If i put the rpm should i have to reconfigure
the sendmail???
what i mean is that in /etc/mail/
i've got
i also have sendmail.cf sumbit.cf .......
the question is,
the rpm affects only the executable
or replaces also
those files????


Expert Comment

ID: 13857864
it will save the files as rpm.save, later u can again replace them with orginal names, --

Assisted Solution

macker- earned 360 total points
ID: 13860612
If you upgrade with the RPM from SUSE, then sendmail should be reconfigured by SUSE to match the correct configuration.  This is one of the advantages of distributions like SUSE that rebuild config files for you.  However, if you upgrade to a version of sendmail from a newer release of SUSE, this may affect how it rebuilds the config file; it may or may not work correctly.  However, the time it takes to upgrade an RPM vs. the time it takes to build from source, is significant.

I would try the RPM first, and be ready to do a source-based rebuild if necessary to meet your needs, or to downgrade using "rpm -U --force older-package-here".  -U is for Upgrade mode, but by supplying --force, it will also downgrade.

Expert Comment

ID: 13864538
U have the advantages and disadvantages of both the ways with u, from RPM based and Source uprade, define a process which u can follow up and the best way is to carry on with it, for some things there nuthin like upgrade/sticking with the source and sometimes, nuhtin like simplicity of an RPM upgrade ( provided the vendor release the RPM on time ) .. as an personal opinon " may the source be with u ;-) "

Expert Comment

ID: 13866384
Thanks :-)

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month15 days, left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question