Open relays are insecure mail servers that allow third-party domains to use them without authorization. They are abused by spammers and phishers and they present a serious risk to organizations because public spam blacklists may add them and affect the entire organization, which depends on e-mails reaching its destination.
This recipe shows how to detect open relays by using Nmap.
Open your terminal and enter the following command:
$ nmap -sV --script smtp-open-relay -v <target>
The output returns the number of tests that passed, and the command combination used:
Host script results: | smtp-open-relay: Server is an open relay (1/16 tests) |_MAIL FROM:<[email protected]> -> RCPT TO:<[email protected]>