Issues with rich formatted mails

Hi

I’ve tried using the SetTicketPropertiesViaMail, in a slightly modified version. After a bit of troubleshooting, I found that it has serious issues with rich formatted texts.
$self->TransactionObj->Attachments->First->Content doesn’t return any text if it’s a rich format email. How would I go about fixing this?

Thanks in advance :slight_smile:

Best regards

Bjørn Skovlund Rydén
System- and Networkadministration
24-7 MusicShop

What is “rich formatted” text? Is it html? Or .rtf attachment? Does
email source have text/plain alternative part of the “rich formatted”
part?On 8/31/05, Bjørn Skovlund Rydén bjorn@247ms.com wrote:

Hi

I’ve tried using the SetTicketPropertiesViaMail, in a slightly modified version. After a bit of troubleshooting, I found that it has serious issues with rich formatted texts.
$self->TransactionObj->Attachments->First->Content doesn’t return any text if it’s a rich format email. How would I go about fixing this?

Thanks in advance :slight_smile:

Best regards

Bjørn Skovlund Rydén
System- and Networkadministration
24-7 MusicShop


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Buy your copy of our new book, RT Essentials, today!

Download a free sample chapter from http://rtbook.bestpractical.com

Best regards, Ruslan.

-----Original Message-----
From: Ruslan Zakirov [mailto:ruslan.zakirov@gmail.com]

What is “rich formatted” text? Is it html? Or .rtf
attachment?

HTML from Outlook or “Rich text” from gmail. Haven’t tried other options.

Does email source have text/plain alternative
part of the “rich formatted”
part?

Hmm… Not sure. I would say it does, atleast RT has a plain text alternative stored as a downloadable item.> On 8/31/05, Bjørn Skovlund Rydén bjorn@247ms.com wrote:

Hi

I’ve tried using the SetTicketPropertiesViaMail, in a
slightly modified version. After a bit of troubleshooting, I
found that it has serious issues with rich formatted texts.
$self->TransactionObj->Attachments->First->Content doesn’t
return any text if it’s a rich format email. How would I go
about fixing this?

-----Original Message-----
From: Ruslan Zakirov [mailto:ruslan.zakirov@gmail.com]

What is “rich formatted” text? Is it html? Or .rtf
attachment?

HTML from Outlook or “Rich text” from gmail. Haven’t tried other options.

Does email source have text/plain alternative
part of the “rich formatted”
part?

Hmm… Not sure. I would say it does, atleast RT has a plain text alternative stored as a downloadable item.
So you need something like:

my $attachs = $self->TransactionObj->Attachments;
my $attach;
while( my $a = attachs->Next ) {
if( $a->ContentType eq ‘text/plain’ ) { $attach = $a; last }
}
return( 0, “Couldn’t find text attachment” ) unless $attach;

in this code you should use $attach->Content as message content.

I didn’t test this code, but something like this should work.

Hi

I’ve tried using the SetTicketPropertiesViaMail, in a
slightly modified version. After a bit of troubleshooting, I
found that it has serious issues with rich formatted texts.
$self->TransactionObj->Attachments->First->Content doesn’t
return any text if it’s a rich format email. How would I go
about fixing this?

Best regards, Ruslan.

-----Original Message-----
From: Ruslan Zakirov [mailto:ruslan.zakirov@gmail.com]

So you need something like:

my $attachs = $self->TransactionObj->Attachments;
my $attach;
while( my $a = attachs->Next ) {
if( $a->ContentType eq ‘text/plain’ ) { $attach = $a; last
} } return( 0, “Couldn’t find text attachment” ) unless $attach; …
in this code you should use $attach->Content as message content.

This helped me find the right solution. When I did it just like this, it wouldnt take non-rich mails, but I combined with the way I did it earlier that didnt work with rich texts.

I have added my scrip in the bottom of this page: Request Tracker Wiki

Cheers and thanks, Bjorn