Tags:
create new tag
view all tags

Question

I have MailInContrib running and working for messages with no attachments. For messages with attachements, the attachment is appended to the message as text instead of being attached to the TWiki topic. I get the following output from running mailincron:

aimsnet:/home/httpd/twiki/bin# ../tools/mailincron
Received mail from Chris Purves <pchris@****.com> for Sandbox.TestMail
[Thu Aug 23 14:29:18 2007] mailincron: Use of uninitialized value in pattern match (m//) at /usr/share/perl5/Email/MIME/ContentType.pm line 24.
[Thu Aug 23 14:29:18 2007] mailincron: Use of uninitialized value in pattern match (m//) at /usr/share/perl5/Email/MIME/ContentType.pm line 24.
Received mail from Chris Purves <pchris@****.com> for Sandbox.TestMail
aimsnet:/home/httpd/twiki/bin#

It appears to me that the MIME type is not identified and so it is not treated as an attachment.

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, MailInContrib
Server OS: Debian Linux Etch, kernel 2.6.18
Web server: Apache 2.2.3
Perl version: 5.8.8
Client OS: MS Windows XP
Web Browser: Opera 9.2
Categories: Plugins

-- ChrisPurves - 23 Aug 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

From the error messages above, it looks like your attachments may have no content type associated with them, which is banjaxing the Email::MIME module. It would help to see the full text (including headers!) of a mail with attachments that failed. Note that if Content-Disposition is inline, I would expect the attachment to be included inline.

-- CrawfordCurrie - 25 Aug 2007

I sent the same e-mail from the same browser to a different account in order to get the full text:

Return-path: <pchris@******.com>
Envelope-to: chris@northfolk.ca
Delivery-date: Mon, 27 Aug 2007 10:08:25 -0600
Received: from mx01.telus.net ([204.209.205.52])
   by mail.northfolk.ca with esmtp (Exim 4.63)
   (envelope-from <pchris@****.com>)
   id 1IPh8T-0000fw-An
   for chris@northfolk.ca; Mon, 27 Aug 2007 10:08:24 -0600
Received: from priv-edmwaa06.telusplanet.net ([199.126.250.208])
          by priv-edmwes24.telusplanet.net
          (InterMail vM.7.08.02.00 201-2186-121-20061213) with ESMTP
          id <20070827160814.CCXV19249.priv-edmwes24.telusplanet.net@priv-edmwaa06.telusplanet.net>
          for <chris@northfolk.ca>; Mon, 27 Aug 2007 10:08:14 -0600
Received: from aims-03.ab.hsia.telus.net (d199-126-250-208.abhsia.telus.net [199.126.250.208])
   by priv-edmwaa06.telusplanet.net (BorderWare MXtreme Infinity Mail Firewall) with ESMTP id F1DEH9APN7
   for <chris@northfolk.ca>; Mon, 27 Aug 2007 10:08:12 -0600 (MDT)
To: chris@northfolk.ca
Subject: Sandbox.TestMail: png attachment
From: "Chris Purves" <pchris@******.com>
Organization: ********* Ltd.
Content-Type: multipart/mixed; boundary=----------24NBZKqCMOMXPzcF1Q8aV9
MIME-Version: 1.0
Date: Mon, 27 Aug 2007 10:10:15 -0600
Message-ID: <op.txp67dzwetxtig@aims-03.ab.hsia.telus.net>
User-Agent: Opera Mail/9.20 (Win32)
X-Virus-Scanned: ClamAV 0.91.2/4076/Mon Aug 27 08:15:54 2007 on mail.northfolk.ca
X-Spam-Flag: NO
X-Spam-Level: /
X-Spam-Status: No, score=-0.6 required=5.0 autolearn=no version=3.1.7-deb host=aurora.northfolk.ca
   *  0.1 FORGED_RCVD_HELO Received: contains a forged HELO
   *  0.0 DK_POLICY_SIGNSOME Domain Keys: policy says domain signs some mails
   *  1.0 DC_IMG_TEXT_RATIO BODY: Low body to pixel area ratio
   * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1%
   *      [score: 0.0000]
   *  1.0 DC_IMG_HTML_RATIO RAW: Low rawbody to pixel area ratio
   * -0.2 AWL AWL: From: address is in the auto white-list

------------24NBZKqCMOMXPzcF1Q8aV9
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
Content-Transfer-Encoding: 7bit



-- 
Chris Purves
Process Development Scientist
****** Ltd.
****
**** Street
Edmonton, AB
Canada

Tel: (***) *******
------------24NBZKqCMOMXPzcF1Q8aV9
Content-Disposition: attachment; filename=aims_lab_floor_plan.png
Content-Type: image/png; name=aims_lab_floor_plan.png
Content-Transfer-Encoding: Base64

iVBORw0KGgoAAAANSUhEUgAACAAAAARmCAIAAAAkyMJUAAAACXBIWXMAAAgAAAAH
...
AIIEAAAAAAAACPoAbItgwxJiA64AAAAASUVORK5CYII=

------------24NBZKqCMOMXPzcF1Q8aV9--

-- ChrisPurves - 27 Aug 2007

From running with debug option:

[Thu Aug 30 09:46:27 2007] mailincron: Use of uninitialized value in pattern mat
ch (m//) at /usr/share/perl5/Email/MIME/ContentType.pm line 24.
[Thu Aug 30 09:46:27 2007] mailincron: Use of uninitialized value in pattern mat
ch (m//) at /usr/share/perl5/Email/MIME/ContentType.pm line 24.
Message from Chris Purves <pchris@******.com>: Sandbox.TestMail: png attachmen
t
User ChrisPurves/Main.ChrisPurves
Topic Sandbox.TestMail
Save topic Sandbox.TestMail:

   * *doc attachment*: doc attachment

It looks like it thinks the document type is .doc when it is .png.

-- ChrisPurves - 30 Aug 2007

Success! I was able to resolve the problem by replacing the following perl modules packaged by Debian with CPAN modules:

  • libemail-mime-perl 1.857
  • libemail-mime-contenttype-perl 1.01
  • libemail-mime-encodings-perl 1.3
  • libmime-types-perl 1.18

  • Email::MIME Version 1.860
  • Email::MIME::ContentType Version 1.014
  • Email::MIME::Encodings Version 1.311
  • MIME::Types Version 1.20

I don't know out of those four, which was the culprit, but I have tested with .png and .doc attachements and they are properly identified and saved with no errors reported. The Debian packages did not require test::pod, but the CPAN modules did. Perhaps that is what was missing the first time around.

-- ChrisPurves - 30 Aug 2007

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2007-08-30 - ChrisPurves
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.