Linux Network Administrators Guide Prev Chapter 18. Sendmail Next Overview of Configuration Files Traditionally, sendmail was set up through a system configuration file (typically called /etc/mail/sendmail.cf, or in older distributions, /etc/sendmail.cf, or even /usr/lib/sendmail.cf ) that is not anything close to any language you’ve seen before. Editing the sendmail.cf file to provide customized behavior can be a humbling experience. Today sendmail makes all configuration options macro driven with an easy-to-understand syntax. The macro method generates configurations to cover most installations, but you always have the option of tuning the resultant sendmail.cf manually to work in a more complex environment. Prev Home Next Installing sendmail Up The sendmail.cf and sendmail.mc Files
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services
Linux Network Administrators Guide Prev Chapter 18. Sendmail Next Installing sendmail The sendmail mail transport agent is included in prepackaged form in most Linux distributions. Installation in this case is relatively simple. Despite this fact, there are some good reasons to install sendmail from source, especially if you are security conscious. The sendmail program is very complex and has earned a reputation over the years for containing bugs that allow security breaches. One of the best known examples is the RTM Internet worm that exploited a buffer overflow problem in early versions of sendmail. We touched on this briefly in Chapter 9. Most security exploits involving buffer overflows rely on all copies of sendmail on different machines being identical, as the exploits rely on data being stored in specific locations. This, of course, is precisely what happens with sendmail installed from Linux distributions. Compiling sendmail from source yourself can help reduce this risk. Modern versions of sendmail are less vulnerable because they have come under exceedingly close scrutiny as security has become a more widespread concern throughout the Internet community. The sendmail source code is available via anonymous FTP from ftp.sendmail.org. Compilation is very simple bceause the sendmail source package directly supports Linux. The steps involved in compiling sendmail are: # cd /usr/local/src # tar xvfz sendmail.8.9.3.tar.gz # cd src # ./Build You need root permissions to complete the installation of the resulting binary files using: # cd obj.Linux.2.0.36.i586 # make install You have now installed the sendmail binary into the /usr/sbin directory. Several symbolic links to the sendmail binary will be installed into the /usr/bin/ directory. We’ll talk about those links when we discuss common tasks in running sendmail. Prev Home Next Sendmail Up Overview of Configuration Files
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services
How Does Mail Routing Work? Up Sendmail
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services
Linux Network Administrators Guide Prev Chapter 18. Sendmail Next The sendmail.cf and sendmail.mc Files The m4 macro processor program generates the sendmail.df file when it processes the macro configuration file provided by the local system administrator. Throughout the remainder of this chapter we will refer to this configuration file as the sendmail.mc file. The configuration process is basically a matter of creating a suitable sendmail.mc file that includes macros that describe your desired configuration. The macros are expressions that the m4 macro processor understands and expands into the complex sendmail.cf syntax. The macro expressions are made up of the macro name (the text in capital letters at the start), which can be likened to a function in a programming language, and some parameters (the text within brackets) that are used in the expansion. The parameters may be passed literally into the sendmail.cf output or may be used to govern the way the macro processing occurs. A sendmail.mc file for a minimal configuration (UUCP or SMTP with all nonlocal mail being relayed to a directly connected smart host) can be as short as 10 or 15 lines, excluding comments. Two Example sendmail.mc Files If you’re an administator of a number of different mail hosts, you might not want to name your configuration file sendmail.mc. Instead, it is common practice to name it after the host vstout.m4 in our case. The name doesn’t really matter as long as the output is called sendmail.cf. Providing a unique name for the configuration file for each host allows you to keep all configuration files in the same directory and is just an administrative convenience. Let’s look at two example macro configuration files so we know where we are heading. Most sendmail configurations today use SMTP only. It is very simple to configure sendmail for SMTP. Example 18-1 expects a DNS name server to be available to resolve hosts and will attempt to accept and deliver all mail for hosts using just SMTP. Example 18-1. Sample Configuration File vstout.smtp.m4
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services
Linux Network Administrators Guide Prev Chapter 18. Sendmail Next Overview of Configuration Files Traditionally, sendmail was set up through a system configuration file (typically called /etc/mail/sendmail.cf, or in older distributions, /etc/sendmail.cf, or even /usr/lib/sendmail.cf ) that is not anything close to any language you’ve seen before. Editing the sendmail.cf file to provide customized behavior can be a humbling experience. Today sendmail makes all configuration options macro driven with an easy-to-understand syntax. The macro method generates configurations to cover most installations, but you always have the option of tuning the resultant sendmail.cf manually to work in a more complex environment. Prev Home Next Installing sendmail Up The sendmail.cf and sendmail.mc Files
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services
Linux Network Administrators Guide Prev Chapter 18. Sendmail Next Installing sendmail The sendmail mail transport agent is included in prepackaged form in most Linux distributions. Installation in this case is relatively simple. Despite this fact, there are some good reasons to install sendmail from source, especially if you are security conscious. The sendmail program is very complex and has earned a reputation over the years for containing bugs that allow security breaches. One of the best known examples is the RTM Internet worm that exploited a buffer overflow problem in early versions of sendmail. We touched on this briefly in Chapter 9. Most security exploits involving buffer overflows rely on all copies of sendmail on different machines being identical, as the exploits rely on data being stored in specific locations. This, of course, is precisely what happens with sendmail installed from Linux distributions. Compiling sendmail from source yourself can help reduce this risk. Modern versions of sendmail are less vulnerable because they have come under exceedingly close scrutiny as security has become a more widespread concern throughout the Internet community. The sendmail source code is available via anonymous FTP from ftp.sendmail.org. Compilation is very simple bceause the sendmail source package directly supports Linux. The steps involved in compiling sendmail are: # cd /usr/local/src # tar xvfz sendmail.8.9.3.tar.gz # cd src # ./Build You need root permissions to complete the installation of the resulting binary files using: # cd obj.Linux.2.0.36.i586 # make install You have now installed the sendmail binary into the /usr/sbin directory. Several symbolic links to the sendmail binary will be installed into the /usr/bin/ directory. We’ll talk about those links when we discuss common tasks in running sendmail. Prev Home Next Sendmail Up Overview of Configuration Files
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services
How Does Mail Routing Work? Up Sendmail
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Unix Web Hosting services
example, using French accents or German umlauts. elm supports these characters to some extent. The character set used by Linux internally to represent characters is usually referred to as ISO-8859-1, which is the name of the standard it conforms to. It is also known as Latin-1. Any message using characters from this character set should have the following line in its header: Content-Type: text/plain; charset=iso-8859-1 The receiving system should recognize this field and take appropriate measures when displaying the message. The default for text/plain messages is a charset value of us-ascii. To be able to display messages with character sets other than ASCII, elm must know how to print these characters. By default, when elm receives a message with a charset field other than us-ascii (or a content type other than text/plain, for that matter), it tries to display the message using a command called metamail. Messages that require metamail to be displayed are shown with an M in the very first column in the overview screen. Since Linux’s native character set is ISO-8859-1, calling metamail is not necessary to display messages using this character set. If elm is told that the display understands ISO-8859-1, it will not use metamail, but will display the message directly instead. This can be enabled by setting the following option in the global elm.rc: displaycharset = iso-8859-1 Note that you should set this option even when you are never going to send or receive any messages that actually contain characters other than ASCII. This is because people who do send such messages usually configure their mailer to put the proper Content-Type: field into the mail header by default, whether or not they are sending ASCII-only messages. However, setting this option in elm.rc is not enough. When displaying the message with its built-in pager, elm calls a library function for each character to determine whether it is printable. By default, this function will only recognize ASCII characters as printable and display all other characters as ^?. You may overcome this function by setting the environment variable LC_CTYPE to ISO-8859-1, which tells the library to accept Latin-1 characters as printable. Support for this and other features have been available since Version 4.5.8 of the Linux standard library. When sending messages that contain special characters from ISO-8859-1, you should make sure to set two more variables in the elm.rc file: charset = iso-8859-1 textencoding = 8bit This makes elm report the character set as ISO-8859-1 in the mail header and send it as an 8-bit value (the default is to strip all characters to 7-bit). Of course, all character set options we’ve discussed here may also be set in the private elmrc file instead of the global one so individual users can have their own default settings if the global one doesn’t suit them. Prev Home Next
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services
Linux Network Administrators Guide Prev Chapter 17. Electronic Mail Next Configuring elm elm stands for electronic mail and is one of the more reasonably named Unix tools. It provides a full-screen interface with a good help feature. We won’t discuss how to use elm here, but only dwell on its configuration options. Theoretically, you can run elm unconfigured, and everything works well if you are lucky. But there are a few options that must be set, although they are required only on occasion. When it starts, elm reads a set of configuration variables from the elm.rc file in /etc/elm. Then it attempts to read the file .elm/elmrc in your home directory. You don’t usually write this file yourself. It is created when you choose Save new options from elm’s options menu. The set of options for the private elmrc file is also available in the global elm.rc file. Most settings in your private elmrc file override those of the global file. Global elm Options In the global elm.rc file, you must set the options that pertain to your host’s name. For example, at the Virtual Brewery, the file for vlager contains the following: # # The local hostname hostname = vlager # # Domain name hostdomain = .vbrew.com # # Fully qualified domain name hostfullname = vlager.vbrew.com These options set elm’s idea of the local hostname. Although this information is rarely used, you should set the options. Note that these particular options only take effect when giving them in the global configuration file; when found in your private elmrc, they will be ignored. National Character Sets A set of standards and RFCs have been developed that amend the RFC-822 standard to support various types of messages, such as plain text, binary data, PostScript files, etc. These standards are commonly referred to as MIME, or Multipurpose Internet Mail Extensions. Among other things, MIME also lets the recipient know if a character set other than standard ASCII has been used when writing the message, for
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services
logged-in user that calls it, but for a UUCP batch we want the senders to be taken from the incoming messages. Exim will do this if the process that calls it is running as a trusted user. If you arrange for incoming UUCP to be handled by a user called uucp, for example, you need to specify: trusted_users = uucp in the Exim configuration file to ensure that sender addresses are correctly handled. Prev Home Next Protecting Against Mail Spam Up Netnews
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services