Creating issues with email - 422 Unprocessable Entity

Added by Anthony C almost 11 years ago

I'm trying to set up Redmine to create issues when receiving email. Everything appears to be working up to the point that Redmine receives the message from Postfix at which point it gets rejected. My account has the appropriate permissions (issue creation) on the target project so the email shouldn't be rejected for that reason. Here are the errors that get logged:

/var/log/mail.log:

Apr 4 15:18:32 redmine postfix/local14979: A19BC41A4B: to=<>, relay=local, delay=0.33, delays=0.04/0/0/0.3, dsn=5.7.0, status=bounced (permission denied. Command output: Request was denied by your Redmine server. Possible reasons: email is sent from an invalid email address or is missing some information. )

production.log:

Processing MailHandlerController#index (for 127.0.1.1 at 2011-04-04 15:18:32) [POST]
Parameters: {"no_permission_check"=>"", "unknown_user"=>"", "allow_override"=>"", "key"=>"xxxx", "email"=>"From Mon Apr 4 15:18:32 2011\nReturn-Path: <>\nX-Original-To: \nDelivered-To: \nReceived: from xxxx (xxxx [xxxx])\n\tby redmine.xxxx.com (Postfix) with ESMTP id A19BC41A4B\n\tfor <>; Mon, 4 Apr 2011 15:18:32 -0400 (EDT)\nReceived: from xxxx ([xxxx] [xxxx]) by xxxx with ESMTP id BT-MMP-4206852 for ; Mon, 4 Apr 2011 15:20:43 -0400\nX-AuditID: 95084018-b7b9fae000007fd3-c8-4d9a1a0b6e9f\nReceived: from xxxx (xxxx [xxxx])\n\tby xxxx (Symantec Brightmail Gateway) with SMTP id 0F.86.32723.B0A1A9D4; Mon, 4 Apr 2011 15:20:43 -0400 (EDT)\nReceived: from xxxx ([xxxx]) by xxxx with Microsoft SMTPSVC;\n\t Mon, 4 Apr 2011 15:20:43 -0400\nX-MimeOLE: Produced By Microsoft Exchange V6.5\nContent-class: urn:content-classes:message\nMIME-Version: 1.0\nContent-Type: text/plain;\n\tcharset=\"us-ascii\"\nContent-Transfer-Encoding: quoted-printable\nSubject: new issue\nDate: Mon, 4 Apr 2011 15:20:41 -0400\nMessage-Id: <125EADF6C313E348937D3F8EAAF1A102E12ED8@xxxx>\nX-MS-Has-Attach: \nX-MS-TNEF-Correlator: \nThread-Topic: new issue\nThread-Index: AcvvC4CRJ2uq1gwqTs69kZP3DGhXUQAqYSbAAAEhAXAAy8AvYAAEaR/wAAAlaMAAAJNI4AAACf2wAAAIJiA=\nFrom: \"xxxx\" <>\nTo: <>\nX-OriginalArrivalTime: 04 Apr 2011 19:20:43.0399 (UTC) FILETIME=[6452D970:01CBF2FD]\nX-Brightmail-Tracker: AAAAAA==\n\nThis is a new issue testing email\n\nProject: projectid\nTracker: PCR\n\n"}
Completed in 8ms (View: 1, DB: 0) | 422 Unprocessable Entity [https://redmine.xxxx.com/redmine/mail_handler]

Replies (5)

RE: Creating issues with email - 422 Unprocessable Entity - Added by Anthony C almost 11 years ago

Nevermind... I can't spell my own project identifiers.

It would be REALLY nice if Redmine had some more specific error messages here. I was able to figure out the problem by enabling debug logging and noticing that the last SQL query was for projects with the identifier I'd specified in my email. Upon closer inspection I finally realized I'd typo'd the project identifier in the email I was testing with.

If someone can point me to the file that performs this check I can try to patch in some more useful errors.

RE: Creating issues with email - 422 Unprocessable Entity - Added by Etienne Massip almost 11 years ago

Guess that it should be in MailHander#receive (in app/models/mail_handler.rb) called by in MailHandlerController (app/controllers/mail_handler_controller.rb).

RE: Creating issues with email - 422 Unprocessable Entity - Added by Anthony C almost 11 years ago

Looks like app/models/mail_handler.rb#258 is supposed to generate an error if there's a problem with the project identifier, but I was never getting one.

(1-5/5)