Linux Network Administrators Guide Prev Chapter 18. Sendmail
Linux Network Administrators Guide Prev Chapter 18. Sendmail Next Some Useful sendmail Configurations There are myriad possible sendmail configurations. In this space we’ll illustrate just a few important types of configuration that will be useful in many sendmail installations. Trusting Users to Set the From: Field It is sometimes useful to overwrite the From: field of an outgoing mail message. Let’s say you have a web-based program that generates email. Normally the mail message would appear to come from the user who owned the web server process. We might want to specify some other source address so that the mail appears to have originated from some other user or address on that machine. sendmail provides a means of specifying which systems users are to be entrusted with the ability to do this. The use_ct_file feature enables the specification and use of a file that lists the names of trusted users. By default, a small number of system users are trusted by sendmail (root, for example). The default filename for this feature is /etc/mail/trusted-users in systems exploiting the /etc/mail/ configuration directory and /etc/sendmail.ct in those that don’t. You can specify the name and location of the file by overriding the confCT_FILE definition. Add FEATURE(use_ct_file) to your sendmail.mc file to enable the feature. Managing Mail Aliases Mail aliases are a powerful feature that enable mail to be directed to mailboxes that are alternate names for users or processes on a destination host. For example, it is common practice to have feedback or comments relating to a World Wide Web server to be directed to webmaster. Often there isn’t a user known as webmaster on the target machine, instead it is an alias of another system user. Another common use of mail aliases is exploited by mailing list server programs in which an alias directs incoming messages to the list server program for handling. The /etc/aliases file is where the aliases are stored. The sendmail program consults this file when determining how to handle an incoming mail message. If it finds an entry in this file matching the target user in the mail message, it redirects the message to wherever the entry describes. Specifically there are three things that aliases allow to happen: l They provide a shorthand or well-known name for mail to be addressed to in order to go to one or more persons. l They can invoke a program with the mail message as the input to the program. l They can send mail to a file. All systems require aliases for Postmaster and MAILER-DAEMON to be RFC-compliant. Always be extremely aware of security when defining aliases that invoke programs or write to programs, since sendmail generally runs with root permissions.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services