How do I restart Sendmail

5 Install sendmail

In the SuSE distribution, sendmail is included in series n, so it is easiest to install via YaST:

Set / start installation ->
Change / create configuration ->
Network support

After the installation, sendmail can be provided with its configuration file (sendmail.cf) again via YaST. To do this, call the menu in YaST

Administration of the system ->
Configure network ->
Configure Sendmail

on.

Select Configuration with access via a name server to allow sendmail to access the provider via a ppp connection. If the server is only operated locally, the selection is arbitrary, but it can be changed at any time in the event of a later INTERNET connection. The configuration file is now created in the / etc directory. The installation also writes the start / stop script sendmail to the directory /sbin/init.d and creates the symbolic links S20sendmail and K20sendmail in /etc/rc.d/rc2.d. To start sendmail now, enter the command on the command line

root @ linux ~ # sh /etc/rc.d/sendmail start

a. The ps command should now give us the following output:

root @ linux ~ # ps ax | grep sendmail
22432? S 0:00 sendmail: accepting connections on port 25

As you can see, sendmail now uses port 25 (SMTP) for incoming and outgoing connections. A sh /etc/rc.d/sendmail reload is sufficient to restart the service during operation


5.1 Entries in /etc/rc.config

The behavior of sendmail can be influenced, as is customary in UNIX, using command line parameters. For this purpose, SuSE has included variables in the start / stop script, which are set in the /etc/rc.config file.
These are:

-SENDMAIL_TYPE = "yes"

specifies that sendmail.cf should be configured using rc.config and YaST. With `` no '' we have to edit it ourselves.

-SENDMAIL_SMARTHOST = ""

When connecting via UUCP, the so-called `` smarthost '' (the communication partner) is entered here.

-SENDMAIL_LOCALHOST = "localhost"

The names listed here are regarded as aliases for your own computer. The DNS request is omitted!

-SENDMAIL_RELAY = ""

Sendmail does not deliver messages locally, but forwards them to the relay. This enables a relay network to be set up.

-SENDMAIL_ARGS = "- bd -q30m -om"

This is where sendmail's start parameters are passed. The complete list is obtained with man sendmail, the values ‚Äč‚Äčlisted here mean: -bd: sendmail starts as a daemon and goes into the background -q30m: the messages in the queue are processed every 30 minutes -om: the option `` m '' is set (see installation and operating manual ;-))

SENDMAIL_EXPENSIVE = "yes"

With this setting, sendmail only writes the messages to its message queue and does not deliver them until sendmail -q is called. This is required if you have connected the server to the INTERNET using an ISDN dial-up connection and you do not want every outgoing mail to establish a connection to the provider. Instead, you call sendmail -q via crontab, e.g. at night, and get or send the mail in one go (polling). Alternatively, the entry can also be included in the PPP start script so that a mail exchange takes place every time a connection is established

SENDMAIL_NOCANONIFY = "no"

Sendmail no longer tries to resolve the full name of the mail address via DNS for every mail. This setting is also important for ISDN dial-up connections to prevent local addresses from being resolved via the provider's DNS. Alternatively, a local DNS can prevent this (see Structure of a DNS server)

5.2 A quick look at sendmail.cf

To understand why sendmail is considered a `` configuration monster '', here is a small excerpt from the sendmail.cf file:

sendmail.cf
Cwlocalhost # my official domain name # ... define this only if sendmail cannot automatically determine your domain # Dj $ w.Foo.COM CP. # "Smart" relay host (may be null) DS # place to which unknown users should be forwarded #Kuser user -m -a <> #DLname_of_luser_relay # operators that cannot be in local usernames (i.e., network indicators) CO @%! # a class with just dot (for identifying canonical names) C .. # a class with just a left bracket (for identifying domain literals) C [[# Mailer table (overriding domains) Kmailertable hash -o / etc / mail / mailertable. db # Domain table (adding domains) #Kdomaintable dbm / etc / domaintable # Generics table (mapping outgoing addresses) Kgenerics hash -o /etc/mail/genericstable.db

5.3 mailertable

The mailertable file defines how the mail is to be delivered to certain target systems. It is not created by default at SuSE, which can lead to problems if you do not install the rpm package supplied by SuSE, but compile sendmail yourself from the sources. It is best to place the file with the command

root @ linux ~ # touch / etc / mailertable

and leaves it empty. However, if you want to use it, it has the following structure:

/ etc / mailertable
# / etc / mailertable # Defines how a host can be reached # First the delivery in the own domain via smtp. #% 1 is replaced by the email address of the recipient # Note: The domain name must be resolvable! .my.domain smtp:% 1 my.domain smtp:% 1 # The computer somebody can be reached via relay.my.domain somebody smtp: [relay.my.domain] # DNS should not be used for the computer number number smtp: [192.168.1.56]

In order to make this mailertable known to the sendmail program, it must be translated into a DBM format using the makemap command. Don't forget to restart sendmail!


5.4 aliases

The / etc / aliases file enables various pseudonyms to be assigned to a real email address. For example, your alias for the person responsible for the system usually exists on web servers as [email protected], the NetNews system uses the synonym [email protected] to deliver error messages. In order not to have to create real accounts for each of these IDs, these can be assigned to one or more user accounts.

/ etc / aliases
# / etc / aliases # Assignment of aliases to real accounts # First the system IDs: news: pmeier, \ news newsadmin: pmeier newsadm: pmeier webmaster: rschulz postmaster: sschmidt mail: sschmidt root: nkrueger, \ root # `` speaking '' Aliases for the accounts pmeier: peter.meier rschulz: robert.schulz sschmidt: stefan.schmidt nkrueger: norbert.krueger

The syntax is therefore quite obvious, the entries news: pmeier, \ news and root: nkrueger, \ root are interesting. This ensures that the messages addressed to the news and root IDs are not only delivered to the real user pmeier, but also to the news and root system IDs. This creates a kind of mail archive for these IDs and you can also search for messages in it if nkrueger has already deleted them in its inbox.

In the second half of the file, the email addresses in the form [email protected], which are quite common today, are generated. However, this section needs to be maintained on a productive system with frequently changing accounts!
Before the alias names can be used, a DBM file must first be generated again with the newaliases command. Again, it doesn't hurt to restart sendmail!