1

I am trying to pragmatically send e-mail to external user with Exchange.

Now I know if Relay is not Enabled in Exchange Server then e-mail relay will not work.

Now, if I send e-mail from my Outlook I can send e-mails to, say, hotmail.

But when I am trying to send the same e-mail via manually connecting to port 25 (SMTP) it says

550 5.7.1 Unable to relay for dork@hotmail.com

I have made sure I am authenticated before trying to send the e-mail. This is what I did:

Trying 10.10.50.164...
Connected to kamail.roshan.af (10.10.50.164).
Escape character is '^]'.
220 foo.bar.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at  Wed, 3 Oct 2012 22:16:50 +0430 
EHLO RADB
250-foo.bar.com Hello [10.10.50.53]
250-TURN
250-SIZE
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
AUTH LOGIN
334 VXNlcm5hbWU6
Zm9vQGJhci5jb20=
334 UGFzc3dvcmQ6
aGVsbG8=
235 2.7.0 Authentication successful.
MAIL FROM: foo@bar.com
250 2.1.0 foo@bar.com....Sender OK
RCPT TO: dork@hotmail.com
550 5.7.1 Unable to relay for dork@hotmail.com
QUIT

I am wondering, what am I doing wrong! And how does Outlook send the e-mail with the recipient. I even tried to login to IMAP when trying to send mail with SMTP

Some insight about the above would be very helpful.

  • To use the server you basically need the from address to be on the server (with authentication) *or* the to address to be on the server (no authentication required). To use it to send from someone else to someone else makes it rip for the spamming. Why not mail it from the bar.com SMTP server? –  Oct 03 '12 at 18:48
  • Erik - I don't think this is a Configuration issue. –  Oct 03 '12 at 18:58
  • @Rudu - **foo.bar.com** is the **MX** for bar.com, it is running **Microsoft Exchange**, but the is not the question. My question is, 1. I can send mail to external emails from Outlook which is using **foo.bar.com** 2. I can check email pragmatically via IMAP (143) 3. I can send mails pragmatically to local via SMTP (25) Now if that works, why can't I send mail to external problematically? Whats the difference between telnet and outlook client? –  Oct 03 '12 at 19:03
  • Are you saying `kamail.roshan.af` is masquerading for `foo.bar.com`? Because those connection headers show you're claiming to be foo.bar.com when connecting, but the SMTP server isn't believing you. –  Oct 03 '12 at 19:05

1 Answers1

2

Having a valid mailbox on the Exchange server does not guarantee you'll be able to send messages to esternal recipients using SMTP; this depends on the Exchange configuration, which may very well be configured to not allow SMTP relay, regardless of authentication. Exchange treats MAPI clients (Outlook) and SMTP clients as two completely different things, and can give different permissions to them, even if they use the same user account and Exchange mailbox.

You should ask the Exchange administrator to have a look into this issue.

Massimo
  • 70,200
  • 57
  • 200
  • 323