1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redmineのメール連携で"Request was denied by your Redmine server. Make sure that 'WS for incoming emails' is enabled in application settings and that you provided the correct API key."

Posted at

こちらの公式マニュアルのやり方に従ってやってみたら、表題のエラーが出ました。
メールによるチケットの登録


$ echo hello | /usr/local/rbenv/shims/ruby /var/www/redmine/extra/mail_handler/rdm-mailhandler.rb --url https://redmine.example.com/ --key  himitsu --project test
Request was denied by your Redmine server. Make sure that 'WS for incoming emails' is enabled in application settings and that you provided the correct API key.

公式サイトによると、エラーの原因は

設定「受信メール用のWebサービスを有効にする」が有効になっていないか、APIキーが誤っています。

とありますが、設定は有効にしてあるし、APIキーも間違ってないし、おかしいなーと。

原因はWebサーバのIPアドレス制限だった。

redmineを動かしてるサーバでメールを受信してrdm-mailhandler.rb を起動するアーキテクチャにしていたのですが、

よく考えると URLがhttps://redmine.example.com/ となっており、自ホストに対してグローバルIP経由でアクセスしていました。

なので、Webサーバ(この場合はNginx) のIPアドレス制限ではじかれていたようです。

Nginxの設定ファイルを編集して、自ホストのグローバルIPを許可するようにしたら解決しました。

エラーメッセージが不適切なためにハマってしまいましたが、まあフリーソフトウェアなのでしょうがないですね。:(

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?