Mailgun和Heroku错误"永久服务器响应:301永久移动"

Kla*_*aha 5 redirect ruby-on-rails heroku cloud9-ide mailgun

希望你们能帮助我:)

我有一个heroku应用程序并集成了Mailgun.我已经设置了Mailgun,我的heroku repo已更新.

当我通过Mailgun收到邮件时,它应该收到所有发送的电子邮件并将其直接发送到我的应用程序,在那里它将点击/传入URL并登陆与之相关的任何操作.

问题是,每当我发送电子邮件到我的mailgun smtp登录时; 邮件已发送但我的日志中出现此错误:

将600秒后重新尝试:→交通klaha.77@gmail.com http://jm-blocmarks.herokuapp.com/incoming "测试3"移到永久服务器响应:301永久移动

这些是我的邮件设置:

Mailgun路线

Filter: catch_all()
forward("http://jm-blocmarks.herokuapp.com/incoming")
Run Code Online (Sandbox Code Playgroud)

配置/ routes.rb中

post :incoming, to: 'incoming#create'
Run Code Online (Sandbox Code Playgroud)

控制器/ incoming_controller.rb

class IncomingController < ApplicationController

  # http://stackoverflow.com/questions/1177863/how-do-i-ignore-the-authenticity-token-for-specific-actions-in-rails
  skip_before_action :verify_authenticity_token, only: [:create]

  def create
    # Take a look at these in your server logs
    # to get a sense of what you're dealing with.
    puts "INCOMING PARAMS HERE: #{params}"

    # You put the message-splitting and business
    # magic here. 

    # Assuming all went well. 
    head 200
  end
end
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

非常感谢!