From 94ae2c5a2bdacc2fbbd50d6589c60b6b261f38d0 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 30 Oct 2015 09:58:39 +0000 Subject: [PATCH] Small change to the inbound email script to catch more attachments properly git-svn-id: svn://192.168.202.10@2404 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/AST_inbound_email_parser.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/agc_2-X/trunk/bin/AST_inbound_email_parser.pl b/agc_2-X/trunk/bin/AST_inbound_email_parser.pl index 6024cf9c..60b834d4 100644 --- a/agc_2-X/trunk/bin/AST_inbound_email_parser.pl +++ b/agc_2-X/trunk/bin/AST_inbound_email_parser.pl @@ -60,6 +60,7 @@ use MIME::QuotedPrint; # 140313-0905 - Added Debug options when --debugX for both IMAP and POP3 # 140422-1912 - Added 'related' content type # 150513-2310 - Added pop3_auth_mode +# 151030-0557 - Small change to catch more attachments properly # # default path to astguiclient configuration file: @@ -417,9 +418,10 @@ while (@row=$rslt->fetchrow_array) { if ($sub_content_disposition=~/attachment/) { $attachment_fulltype=""; $attachment_filename=""; + ## Check to see if attachment is an accepted filetype - $sub_content_type=~/Content-Type\:\s+[^\;]+\;/i; $attachment_type=$&; - $attachment_type=~s/(^Content-Type\:\s+|\;$)//gi; + $sub_content_type=~/Content-Type\:\s+[^\;]+(\;.*)?$/i; $attachment_type=$&; + $attachment_type=~s/(^Content-Type\:\s+|(\;.*)?$)//gi; $attachment_type=~s/[\r\n]//g; switch ($attachment_type) { @@ -746,8 +748,8 @@ while (@row=$rslt->fetchrow_array) { $attachment_fulltype=""; $attachment_filename=""; ## Check to see if attachment is an accepted filetype - $sub_content_type=~/Content-Type\:\s+[^\;]+\;/i; $attachment_type=$&; - $attachment_type=~s/(^Content-Type\:\s+|\;$)//gi; + $sub_content_type=~/Content-Type\:\s+[^\;]+(\;.*)?$/i; $attachment_type=$&; + $attachment_type=~s/(^Content-Type\:\s+|(\;.*)?$)//gi; $attachment_type=~s/[\r\n]//g; switch ($attachment_type) {