email:test_open_relay
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
email:test_open_relay [2016/07/05 00:44] – [Preventing message relaying with MS Exchange] peter | email:test_open_relay [2019/11/27 22:14] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Email - Test Open Relay ====== | ||
- | |||
- | An outside individual who uses your mail server to deliver email using a false email address is considered relaying mail via your server. | ||
- | |||
- | Tracking down a spammer who uses mail servers open to relaying is difficult. | ||
- | |||
- | ===== Email Relay Test ===== | ||
- | |||
- | How do you check your server for relaying? | ||
- | |||
- | In the following examples, mail.example.com is the mail server you are checking, sender@example.com is a valid email account at mail.example.com (or a fake email address – try both), and youremail@outsideaddress.com is the email account you want this message to go to. | ||
- | |||
- | ===== An example of a mail server that does NOT allow relaying ===== | ||
- | |||
- | You type this text: | ||
- | |||
- | <code bash> | ||
- | telnet mail.example.com 25 | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | Trying 10.10.10.1. | ||
- | Connected to mail.example.com. | ||
- | |||
- | Escape character is ‘^]’. | ||
- | 220 mail.example.com | ||
- | </ | ||
- | |||
- | You should type: | ||
- | |||
- | <code bash> | ||
- | HELO mail.example | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | < | ||
- | 250 OK | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | MAIL FROM:< | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | 250 OK – Mail from < | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | RCPT TO:< | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | 550 Relaying is prohibited | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | QUIT | ||
- | </ | ||
- | |||
- | The server should reply with: | ||
- | |||
- | <code bash> | ||
- | 221 Closing connect, good bye | ||
- | </ | ||
- | |||
- | |||
- | ===== An example of a mail server that DOES allow relaying ===== | ||
- | |||
- | You type this text: | ||
- | |||
- | <code bash> | ||
- | telnet mail.example.com 25 | ||
- | </ | ||
- | |||
- | Server should respond with: | ||
- | |||
- | <code bash> | ||
- | Trying 10.10.10.1. | ||
- | Connected to mail.example.com. | ||
- | Escape character is ‘^]’. | ||
- | 220 mail.example.com | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | HELO mail.example | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | 250 OK | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | MAIL FROM:< | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | 250 OK – Mail from < | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | RCPT TO:< | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | 250 OK | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | DATA | ||
- | </ | ||
- | |||
- | The server should respond with: | ||
- | |||
- | <code bash> | ||
- | 354 End data with < | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | From: sender@example.com | ||
- | To: youremail@outsideaddress.com | ||
- | |||
- | Subject: Relay test | ||
- | |||
- | This is a relay test and only a test. | ||
- | (type < | ||
- | </ | ||
- | |||
- | The server should respond: | ||
- | |||
- | <code bash> | ||
- | 250 OK: Queued as T22122A5 | ||
- | </ | ||
- | |||
- | You should enter: | ||
- | |||
- | <code bash> | ||
- | QUIT | ||
- | </ | ||
- | |||
- | The server should respond: | ||
- | |||
- | <code bash> | ||
- | 221 Closing connect, good bye | ||
- | </ | ||
- | |||
- | ===== Preventing message relaying with MS Exchange ===== | ||
- | |||
- | Before you start, check which version you are running – you must be running Microsoft Exchange Server 5.5 or greater, then follow these 7 steps. | ||
- | |||
- | - Go to the Internet Mail Service Properties dialog box in Microsoft Exchange | ||
- | - Select the Routing tab at the top. | ||
- | - Select the option Reroute incoming SMTP mail (required for POP3/IMAP4 support). | ||
- | - Reroute incoming SMTP mail. | ||
- | - For each domain you host, you need an entry in the Routing section. | ||
- | - Click the Routing Restrictions button. | ||
- | - Make sure Hosts and clients with these IP addresses is checked. Leave the list of IP addresses blank. | ||
- | |||
- | |||
- | |||
- | ===== Manually testing all relay types ===== | ||
- | |||
- | You can use the steps outlined above but substitute the “from:” and “to:” below to more thoroughly check your server for different types of relay. | ||
- | |||
- | ==== Standard relay ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender domain is long ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender’s domain is localhost ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender address without domain (a local user) ==== | ||
- | |||
- | mail from: < | ||
- | |||
- | ==== Sender address is null (like from Mailer-Daemon) ==== | ||
- | |||
- | mail from: <> | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender address uses local hostname ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender address using literal domain address (of local host) ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender address uses local hostname and recipient uses percent hack ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender address uses local hostname and recipient uses percent hack with domain literal ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Quoted ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Quoted string and percent hack ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Quoted string and percent hack and domain literal “x@y”[IP] arbitrary non-local, source-routed destinations ==== | ||
- | RCPT TO:< | ||
- | |||
- | ==== Sender uses IP rather than FQDN ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Recipient uses IP rather than FQDN ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Recipient uses both FQDN and IP ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender uses domain literal and recipient uses source routing ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender uses local domain and recipient uses source routing with a domain literal ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Recipient address uses UUCP-like destination (“bang path”) ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Reciepient uses UUCP-like destination and IP ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
- | |||
- | ==== Sender is a known local user from local host; and some mail servers are configured to always allow mail from “postmaster” ==== | ||
- | |||
- | mail from: < | ||
- | rcpt to: < | ||
email/test_open_relay.1467679490.txt.gz · Last modified: 2020/07/15 09:30 (external edit)