0

I'm trying to get ActionMailer to send email through my MS Exchange server. I am able to use a mail client (on the same machine) to send/receive mail through the Exchange server.

One thing I had to do with the mail client is set the "mail account" to use the "mapi" protocol.

When I try to send email with ActionMailer it times out.

Any ideas?

recursive_acronym
  • 2,981
  • 6
  • 40
  • 59

3 Answers3

1

Did you try this?

http://www.breckenedge.com/2011/07/configuration-of-ruby-on-rails-actionmailer-for-microsoft-exchange-smtp/

Or you have this answer, it can help you:

ActionMailer and Exchange

Community
  • 1
  • 1
Sebastien
  • 6,640
  • 14
  • 57
  • 105
1

If you are experiencing a timeout, I'd starting looking at a possible network issue. You say you're using a mail client on the same machine, but it may be using a different port/protocol.

I'd log into the box running the ruby on rails app, and try telnet'ing to port 25. You may find out that you can't connect. If you can, try talking SMTP to send a message:

$ telnet mail.example.com 25

220 mail.example.com Microsoft ESMTP MAIL Service, Version: x.x.xxxx.xxxx ready at  Thu, 12 Apr 2012 14:55:10 -0400

HELO yourfqdn.example.com 
MAIL FROM: youruser@example.com
RCPT TO: user@example.com
DATA
(enter message)
.

If you can't connect, or exchange spits back an error while trying to submit a message, your issue doesn't revolve around code at all.

Lynn Crumbling
  • 12,985
  • 8
  • 57
  • 95
  • That makes sense. It feels like a protocol issue. telnet times out. The gui client is using a protocol it called "exchange mapi" – recursive_acronym Apr 12 '12 at 19:28
  • 1
    See if Windows Firewall is enabled on the exchange box. If it is, and you can disable it temporarily for testing purposes, try it. (Don't forget to reenable!) That would block access to 25. – Lynn Crumbling Apr 12 '12 at 19:34
  • The exchange box is far beyond my control. – recursive_acronym Apr 12 '12 at 19:44
  • 1
    Can you verify that exchange is definitely running smtp? Do you have any other boxes that you know for sure that you can connect to port 25 from? I'm trying to think of anything else that I could do to help, since it seems like the answer for sure is, "it's a network/host access issue, not code/web app config." – Lynn Crumbling Apr 12 '12 at 19:49
1

MAPI != SMTP

An Exchange server can implement several protocols. If you cannot telnet to port 25 on the server, than the SMTP protocol is not enabled on that server. SMTP is typically enabled only on perimeter servers that communicates with the rest of the world.

qux
  • 1,155
  • 7
  • 17