Page 161 - StudyBook.pdf
P. 161

Communication Security: Remote Access and Messaging • Chapter 3  145

                 configuration files to restrict e-mail so that it has to originate or terminate at the
                 local server.The file /etc/sendmail.cf would be reconfigured to look like this:

                 Scheck_rcpt
                  # anything terminating locally is ok
                  R< $+ @ $=w >   $@ OK
                  R< $+ @ $=R >   $@ OK


                  # anything originating locally is ok
                  R$*     $: $(dequote "" $&{client_name} $)
                  R$=w    $@ OK
                  R$=R    $@ OK
                  R$@    $@ OK

                  # anything else is bogus
                  R$*    $#error $: "550 Relaying Denied"

                    The easiest way to prevent SMTP relay is to properly configure and test the
                 server during the build process. If you are not sure if your server is configured
                 properly, there is an easy way to test it.



                 NOTE

                      Do not try this from your internal network, since your server will allow
                      you to relay from the trusted internal domain.





                      1. Open a command prompt window (assuming you are using a Windows
                         OS running against Exchange).
                      2. At the command prompt, type Telnet <servername> 25.This will open
                         up a Telnet session with the SMTP server using SMTP port 25.
                      3. You will receive a response from the e-mail server giving the name of the
                         server, the e-mail software being used, and the date and time usually in the
                         format of 220 mail.fakeserver.com Microsoft ESMTP Mail Service/ Sendmail
                         8.11.6/SuSE Linux Mon, Oct 7, 2002 08:50:00.
                      4. Type HELO test.test.com.You will get a response from the e-mail
                         server, saying “Hello” back to you.



                                                                              www.syngress.com
   156   157   158   159   160   161   162   163   164   165   166