Project

General

Profile

Actions

Defect #16933

open

mail messages being retrieved from davmail are incomplete

Added by George Sakhnovsky over 10 years ago. Updated over 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Our setup:

redmine 2.5.0 -> davmail 4.4.1-2225 -> exchange 2010

We process mail messages via rake like so:

rake -f /usr/local/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=xxx port=xxx username=xxx password=xxx project=pickle unknown_user=accept allow_override=project no_permission_check=1

Example of a test e-mail msg:

Subject: test email bug 1

Test message 1 body

Project: project1
Tracker: Bug
Priority: Urgent

After the rake is run, issues are created, however none of the fields are populated.

Looking at mail_handler.rb, we should have the complete email object @ line 74:

def receive(email)
@email = email

Dumping @email.inspect to logger, I see the following quite incomplete msg:

#<Mail::Message:70045583405560, Multipart: false, Headers: <Date: Tue, 20 May 2014 16:36:48 -0400>, <Message-ID: <537bbce0d8a9b_2d6b43fb4c02b7e8889470@xxx>>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>>

Thinking that maybe this is connected to our local mail encoding, I tried sending plain text mail from gmail, but saw the same results.

My next thought was that something is off on the davmail -> exchange side, but retrieving the mail body via imap seems to work fine. (imap retrieval log attached).

Is it possible that there's a Redmine bug causing incomplete email msg retrieval?


Files

redmine_imap.txt (3.15 KB) redmine_imap.txt imap msg retrieval George Sakhnovsky, 2014-05-20 23:35
Actions #2

Updated by George Sakhnovsky over 10 years ago

I had a chance to dig a little deeper.

It seems that Net::IMAP's fetch() breaks when retrieving a uid with attr RFC822 from davmail. Changing line 33 of lib/redmine/imap.rb from

msg = imap.uid_fetch(uid,'RFC822')[0].attr['RFC822']

to

msg = imap.uid_fetch(uid,'BODY[]')[0].attr['BODY[]']

resolves the issue for me.

Actions #3

Updated by Toshi MARUYAMA over 10 years ago

  • Subject changed from mail messages being retrieved by redmine are incomplete to mail messages being retrieved from davmail are incomplete
Actions

Also available in: Atom PDF