Server Administration
  Home arrow Server Administration arrow Page 2 - sendmail Security Options
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SERVER ADMINISTRATION

sendmail Security Options
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-05-15

    Table of Contents:
  • sendmail Security Options
  • 4.8.2.3 The TrustedUser option (V8.10 and above)
  • 4.8.2.6 The PostmasterCopy option
  • 4.8.3 The /etc/shells File
  • 4.9 Other Security Information
  • 4.10 Pitfalls

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    sendmail Security Options - 4.8.2.3 The TrustedUser option (V8.10 and above)


    (Page 2 of 6 )

     

    The TrustedUser option (§24.9.122 on page 1112) defines the user that can administer sendmail. If set, this user will own database map files (such as aliases), and will also own the control socket (§24.9.25 on page 990). Even though only root can start sendmail, this user can stop and restart the sendmail daemon.

    By setting this option, you can employ a user other than root to administer sendmail. But if you have been administering sendmail as root, you cannot simply set this option and be done. Instead, you need to shut down sendmail, make a few changes and then restart.

    • The first change is needed to ensure that this trusted user can edit the source files for database files created by sendmail (the aliases database).
    • The second change is needed to remove the control socket (if you use one) so that sendmail can create it with the proper ownerships.

    With these simple changes in place, you can add the following line to your mc configuration file, and build and install a new configuration file from it:

      define(`confTRUSTED_USER´,`user´)

    Here, user is a user login name, or a user ID number.

    When you restart sendmail with this new trusted user in place, you can thereafter routinely employ that user to administer sendmail.

    4.8.2.4   The ForwardPath option

    The ForwardPath option (§24.9.52 on page 1034) lists a series of directories that sendmail will search for user ~/.forward files. At most sites, there are users who are savvy and able to correctly administer their own ~/.forward files, but there are others who are untrained or careless. You can allow experienced users to use the ~/.forward facility, while denying this ability to the others with the ForwardPath option:

      O ForwardPath=/usr/local/etc/forwards/$u.forward:$z/.forward

    Here, sendmail will first search the /usr/local/etc/forwards directory to find a file that begins with the user’s login name (the$u, §21.9.96 on page 848) followed by a .forward. If you set up such a file for the untrained user—say, bob:

      -rw-r--r--  1 root  system  0 Dec 13 2002 /usr/local/etc/forwards/bob.forward

    and if that file is empty, bob’s mail will always be delivered locally, regardless of what bob puts in his ~/.forward file. For experienced users, you can omit their files from the /usr/local/etc/forwards directory, thus enabling them to use their own ~/.forward files.

    4.8.2.5   The LogLevel option

    The sendmail program normally logs a great deal of useful information via syslog (§14.3.1 on page 514). There will be times, however, when the normal amount of information is insufficient. Consider, for example, that some outsider is using your site to forge mail. Because this is done over an SMTP connection, it would be handy to have both sides of all SMTP conversations logged. You can do this with the LogLevel option (§24.9.61 on page 1040):

      O LogLevel=12      ←V8.8 and above configuration file

      define(`confLOG_LEVEL´, 12)   ←V8.8 and above mc configuration

    Beginning with V8.8 sendmail, a level of 12 causes both sides of every SMTP conversation to be logged. That logging looks very similar to the logging produced by verbose mode (§1.7.6 on page 24).

    Note that after changing the log level in your configuration file, you will need to restart the daemon. With V8.7 and above sendmail you restart the daemon like this:

      # kill -HUP `head -1 /etc/sendmail.pid`

    Be aware that a log level of 12 produces a huge amount of output. Be prepared to prune your logfiles more often than usual while running at this higher logging level.

    More Server Administration Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "sendmail, fourth edition," published by...
     

    Buy this book now. This article is excerpted from chapter four of sendmail, fourth edition, written by Bryan Costales, Claus Assmann, George Jansen and Gregory Shapiro (O'Reilly, 2007; ISBN: 0596510292). Check it out today at your favorite bookstore. Buy this book now.

    SERVER ADMINISTRATION ARTICLES

    - Processes in the UNIX Shell
    - Migrating from Windows to Wine
    - Wine: Not Another Emulator
    - Preventive Measures to Block SSH Attacks
    - Monitoring Temperatures with Cacti
    - Cacti: RRDTool-based Graphing Solution
    - Network Magic 5.0 Review
    - Netfilter and Iptables Overview
    - Installing and Configuring Squid
    - Clickfree PC Backup Systems Compared
    - Squid, the Caching Proxy
    - Regular Expressions in the Unix Shell
    - Source Code Version Control Solutions
    - OTRS: Open Source Ticket Request System
    - Clonezilla: Free Mass Disk-Cloning Utility





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek