In this example, we show the configuration for the well
known MTA (Message Transfer Agent) sendmail DNS Configuration on DNS-Server The relay host, the mailbox host and all hosts in DMZ must be inserted in the DNS for the domain ARKUM.CH. Besides this, it's very important to insert the Firewall (NAT Address) in the DNS, or Sendmail will complain about relay problems. As a rule of thumb, all Hosts or IP-Adresses which will use the Relay-Host must be inserted in Sendmail's DNS or you may encounter relaying problems. The configuration files for DNS can be found in /var/named for RedHat Linux. ;--------------------------------------------------------- Please note, that the MX record for the mailbox host paragon points to itself. DNS Configuration on Relay Host The sendmail MTA on the relay host needs access to the DNS Server. This must be setup in the file /etc/resolv.conf search arkum.com arkum.ch Firewall Configuration Port 25 (SMTP) must be opened between the Relay Host on the DMZ and the Mailbox Host in the HSZ. Ask your firewall administrator to accomplish this task. Enable Relaying for all hosts in ARKUM.CH Relaying (transmission of messages from a site outside your domain to another site outside your domain) is denied by default. Note that this changed in sendmail 8.9; previous versions allowed relaying by default. Relaying is a feature (not a bug) to prevent E-Mail spamming. You have to configure relaying or you will get the error message: 550 Requested action not taken: relaying denied. Configure Relaying Using /etc/mail/relay-domains You need to add the fully-qualified host name and/or IP address of each client to class R, the set of relay-allowed domains. For version for 8.9.X, it is typically /etc/mail/relay-domains Note: if your DNS is problematic, you should list the IP address (e.g., 1.2.3.4); in general, however, this should not be necessary. Here is the content of the file relay-domains: akadia.com Using /etc/mail/access An "access'' database can be created to accept or reject mail from selected domains. For example, you may choose to reject all mail originating from known spammers. To enable such a database, use the file /etc/mail/access. Remember, since /etc/mail/access is a database, after creating the text file as described below, you must use makemap to create the database map. For example: makemap hash /etc/mail/access < /etc/mail/access The table itself uses e-mail addresses, domain names, and
network numbers as keys. spammer@aol.com REJECT would refuse mail from spammer@aol.com, any user from
cyberspammer.com The value part of the map can contain:
For example: cyberspammer.com
550 We don't accept mail from spammers Would accept mail from okay.cyberspammer.com, but would reject mail from all other hosts at cyberspammer.com with the indicated message.It would allow accept mail from any hosts in the sendmail.org domain, and allow relaying for the 128.32.*.* network. We use the following entries in /etc/mail/access, so all hosts within the domain ARKUM.CH or within the HSZ 192.168.138.x can use the Relay Host without "550 Requested action not taken: relaying denied." localhost RELAY Compile the entries with: makemap hash /etc/mail/access < /etc/mail/access More information can be found in the README.cf file of sendmail. How to deliver local mails if DNS- and Mail-Server is the same machine ? If your DNS-Server and E-Mail Relay Host is the same machine you may encounter the following error message: 554 MX list for akadia.ch points
back to rabbit.akadia.ch The Mail Exchanger (MX Records) in the DNS configuration is just an ordered list of destinations that tells mailers where to send messages if they want to reach a given domain. The preference value tells them how desirable it is to use that destination. That's the basic idea behind MX records and mail exchangers, but there are a few more wrinkles you should know about. Here is the output of a typical MX entry in the DNS configuration for ARKUM.CH What happens if a mailer finds itself at the highest preference, and has to discard the whole MX list as shown below ? IN MX 10 rabbit.arkum.ch. Some mailers attempt delivery directly to the destination host's IP address, as a last-ditch effort. In most mailers however , it's an error. It may indicate that DNS thinks the mailer should be processing (not just forwarding) mail for the destination, but the mailer hasn't been configured to know that. Or it may indicate that the administrator has ordered the MX records incorrectly by using the wrong preference values. Then it will bounce the mail with the familiar error Many versions of sendmail use class w or file class w as the list of local destinations. The sendmail configuration on RedHat Linux offers the file /etc/sendmail.cw. Enter the local domains in this file and the local delivery together with MX records will work. arkum.ch Note again, that this task must not be done, if the DNS Server and Mail Server are two different machines. Enable local Mail Forwarding from the DMZ to the HSZ Local Mail must be forwarded from the Relay Host on the DMZ to the Mailbox Host on the HSZ. Sendmail offers this feature using the Macros DR and DM in /etc/sendmail.cf. Enter the Mailbox Host for both Macros, besides this the domain name ARKUM.CH must be masqueraded with the macro DM. Here are the necessary entries in /etc/sendmail.cf # Who I send unqualified names to (null means deliver
locally) Test the Configuration Stop and Start Sendmail Daemon /etc/rc.d/init.d/sendmail stop Test the internet delivery Create a testfile to_internet for internet delivery with the following content: To: martin.zahn@plenaxx.ch Test the internet delivery cat to_internet | /usr/lib/sendmail -bm -t -v martin.zahn@plenaxx.ch. Connecting to nt-mail1.plenaxx.ch. esmtp... If you get an output similar to the above, your internet delivery is working perfectly ! Test the Mail Forwarding Create a testfile to_arkum for local delivery with the following content: To: martin.zahn@arkum.ch Test the local delivery cat to_internet | /usr/lib/sendmail -bm -t -v martin.zahn@arkum.ch... Connecting to paragon.arkum.ch. via relay... If you get an output similar to the above, your local delivery is working perfectly ! Debug the Configuration If you encounter troubles with the sendmail configuration, here are some tests to find out what happens. Show Delivery Agent (Mailer) $ /usr/lib/sendmail -d0.12 -bt < /dev/null Version 8.9.3 Show Macros without $u, $M which will be set when mail is already delivered $ /usr/lib/sendmail -d35.9 -bt define(* as $*) Show Sendmail Queue $ /usr/lib/sendmail -bp Mail Queue (2 requests) Test the MX-Record readed by Sendmail from DNS $ /usr/lib/sendmail -bt > /mx arkum.ch If you have still troubles consult our sendmail guide or visit http://www.sendmail.org |