how to stop Mail Relay in sendmail?

Posted on 2009-02-23
Last Modified: 2013-12-16
I have configured sendmail in RHEL 5 and working fine but someone is using this server as Mail Relay and sending too many mail to other domain.

Please suggest me How to stop this?
Question by:aloknet21
    LVL 8

    Expert Comment

    Hello mate!
     You can configure domains which will be allowed for relay.
     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.,; in general, however, this should not be necessary. Here is the content of the file relay-domains:

    Please read more detailed explanation on page:

    Kind regards,
    LVL 1

    Author Comment

    Now mail relay is stoped but i am not able to receive any mail from other domain like from gmail when i am sending mail it is giving me error like:

    I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

    For further assistance, please send mail to <postmaster>

    If you do so, please include this problem report. You can delete your own text from the attached returned message.

                       The mail system

    <>: host[] said: 550 5.7.1
        <>... Relaying denied. Proper authentication required. (in
        reply to RCPT TO command)
    LVL 8

    Expert Comment

    What have you done so far?
    Have you put domains allowed for relay?
    Have you described your local hosts in your local domain in DNS?
    It seems your mail server replies as it can deliver emails but does look like those domains are local not relay for sender.

    LVL 40

    Accepted Solution


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
    Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now