FAQ: Error Rebuilding sendmail.cf

"There’s No Such Thing As A Silly Question" -- does the cliche sound familiar? In this part of pimp-my-rig reloaded, technical questions are answered. Mail them to me and I will post the answers here. If you have a better answer, by all means share it with us.

Guides on the net suggest that you do not edit sendmail.cf by hand. First, make changes to sendmail.mc then rebuild sendmail.cf using the command: "m4 sendmail.mc > sendmail.cf". However, this command sometimes fails and before you know it you have unknowingly made changes to sendmail.cf -- the file is now 0 bytes. The error message is below:

[root@host mail]# m4 sendmail.mc > sendmail.cf
sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory

Things are pretty simple if you look at the error.. but it is very deceiving. Take a look at your sendmail.cf.

[root@host mail]# ls -la sendmail.cf
-rw-r--r-- 1 root root 0 Feb 18 10:02 sendmail.cf
Ooppss.. sendmail.cf is now zero bytes. You can rebuild sendmail.cf from sendmail.mc using m4, but you just executed the exact command to re-generate sendmail.cf ending in errors. Re-starting sendmail will make things worse. Sendmail will still work as it read sendmail.cf before the error. Restarting it will re-read the zeroed out sendmail.cf file.

I got stuck in this error before. And a colleague got stuck in it just recently.

The guides either forgot to mention that or assumed that it is installed and you will need to have installed the sendmail-cf rpm. How do you know that sendmail-cf is the required rpm? Take a closer look at the first few lines of sendmail.mc.

[root@host mail]# head sendmail.mc
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     make -C /etc/mail
dnl #

So what you can do now is install sendmail-cf rpm.

[root@host mail]# yum -y install sendmail-cf
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.web.com.ph
 * extras: mirror.web.com.ph
 * updates: mirror.web.com.ph
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sendmail-cf.x86_64 0:8.13.8-8.1.el5_7 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch          Version                  Repository      Size
================================================================================
Installing:
 sendmail-cf        x86_64        8.13.8-8.1.el5_7         updates        306 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 306 k
Downloading Packages:
sendmail-cf-8.13.8-8.1.el5_7.x86_64.rpm                  | 306 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : sendmail-cf                                              1/1

Installed:
  sendmail-cf.x86_64 0:8.13.8-8.1.el5_7

Complete!

Now re-run "m4 sendmail.mc > sendmail.cf" and it will be error free. You can safely make changes to sendmail.mc and generate sendmail.cf from that.

Share:

Subscribe for Latest Update

Popular Posts

Post Labels

100gb (1) acceleration (1) acrobat (1) adblock (1) advanced (1) ahci (1) airdrop (2) aix (14) angry birds (1) article (21) aster (1) audiodg.exe (1) automatic (2) autorun.inf (1) bartpe (1) battery (2) bigboss (1) binance (1) biometrics (1) bitcoin (3) blackberry (1) book (1) boot-repair (2) calendar (1) ccleaner (3) chrome (5) cloud (1) cluster (1) compatibility (3) CPAN (1) crypto (3) cydia (1) data (3) ddos (1) disable (1) discount (1) DLNA (1) dmidecode (1) dns (7) dracut (1) driver (1) error (10) esxi5 (2) excel (1) facebook (1) faq (36) faucet (1) firefox (17) firewall (2) flash (5) free (3) fun (1) gadgets (4) games (1) garmin (5) gmail (3) google (4) google+ (2) gps (5) grub (2) guide (1) hardware (6) how (1) how-to (45) huawei (1) icloud (1) info (4) iphone (7) IPMP (2) IPV6 (1) iscsi (1) jailbreak (1) java (3) kodi (1) linux (28) locate (1) lshw (1) luci (1) mafia wars (1) malware (1) mapsource (1) memory (2) mikrotik (5) missing (1) mods (10) mouse (1) multipath (1) multitasking (1) NAT (1) netapp (1) nouveau (1) nvidia (1) osmc (1) outlook (2) p2v (2) patch (1) performance (19) perl (1) philippines (1) php (1) pimp-my-rig (9) pldthomedsl (1) plugin (1) popcorn hour (10) power shell (1) process (1) proxy (2) pyspark (1) python (13) qos (1) raspberry pi (7) readyboost (2) reboot (2) recall (1) recovery mode (1) registry (2) rename (1) repository (1) rescue mode (1) review (15) right-click (1) RSS (2) s3cmd (1) salary (1) sanity check (1) security (15) sendmail (1) sickgear (3) software (10) solaris (17) squid (3) SSD (3) SSH (9) swap (1) tip (4) tips (42) top list (3) torrent (5) transmission (1) treewalk (2) tunnel (1) tweak (4) tweaks (41) ubuntu (4) udemy (6) unknown device (1) updates (12) upgrade (1) usb (12) utf8 (1) utility (2) V2V (1) virtual machine (4) VirtualBox (1) vmware (14) vsphere (1) wannacry (1) wifi (4) windows (54) winpe (2) xymon (1) yum (1) zombie (1)

RANDOM POSTS