Attachments

If the user sends their email as a text+html (2 attachments) you don’t get
any content from the “Correspodence” template.

Is it possible to include the first (Or any) text/plain attachments in the
content?

Of is there something I can shove in a template to do that?

Jason

Jason Slagle - CCNP - CCDP
Network Administrator - Toledo Internet Access - Toledo Ohio

  • raistlin@tacorp.net - jslagle@toledolink.com - WHOIS JS10172
    /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    \ / ASCII Ribbon Campaign . If dreams are like movies then memories
    X - NO HTML/RTF in e-mail . are films about ghosts…
    / \ - NO Word docs in e-mail . - Adam Duritz - Counting Crows

You can definitely put a bit of code into a template
to itterate through all Attachments to the Transaction
and include them if they’re of type text.

The fact that Message->First->Content doesn’t do the right thing here
is a bug that will get fixed for ~2.2

    -jOn Wed, Jun 06, 2001 at 09:31:53AM -0400, Jason Slagle wrote:

If the user sends their email as a text+html (2 attachments) you don’t get
any content from the “Correspodence” template.

Is it possible to include the first (Or any) text/plain attachments in the
content?

Of is there something I can shove in a template to do that?

Jason


Jason Slagle - CCNP - CCDP
Network Administrator - Toledo Internet Access - Toledo Ohio

  • raistlin@tacorp.net - jslagle@toledolink.com - WHOIS JS10172
    /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    \ / ASCII Ribbon Campaign . If dreams are like movies then memories
    X - NO HTML/RTF in e-mail . are films about ghosts…
    / \ - NO Word docs in e-mail . - Adam Duritz - Counting Crows

Rt-devel mailing list
Rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

A REAL sysadmin challenge is “resurrect five dead mailserver while so ripped
to the gills on mdma that you can’t focus on any given line of text for more
than 10 seconds continuously.”
-Nathan Mehl

So the templates just take perl?

What would such a piece of code look like :smiley:

Jason

Jason Slagle - CCNP - CCDP
Network Administrator - Toledo Internet Access - Toledo Ohio

  • raistlin@tacorp.net - jslagle@toledolink.com - WHOIS JS10172
    /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    \ / ASCII Ribbon Campaign . If dreams are like movies then memories
    X - NO HTML/RTF in e-mail . are films about ghosts…
    / \ - NO Word docs in e-mail . - Adam Duritz - Counting CrowsOn Wed, 6 Jun 2001, Jesse wrote:

You can definitely put a bit of code into a template
to itterate through all Attachments to the Transaction
and include them if they’re of type text.

The fact that Message->First->Content doesn’t do the right thing here
is a bug that will get fixed for ~2.2

    -j

On Wed, Jun 06, 2001 at 09:31:53AM -0400, Jason Slagle wrote:

If the user sends their email as a text+html (2 attachments) you don’t get
any content from the “Correspodence” template.

Is it possible to include the first (Or any) text/plain attachments in the
content?

Of is there something I can shove in a template to do that?

Jason


Jason Slagle - CCNP - CCDP
Network Administrator - Toledo Internet Access - Toledo Ohio

  • raistlin@tacorp.net - jslagle@toledolink.com - WHOIS JS10172
    /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    \ / ASCII Ribbon Campaign . If dreams are like movies then memories
    X - NO HTML/RTF in e-mail . are films about ghosts…
    / \ - NO Word docs in e-mail . - Adam Duritz - Counting Crows

Rt-devel mailing list
Rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

So the templates just take perl?

Yes. They’re Text::Template templates.

What would such a piece of code look like :smiley:

Unfortunately, I really don’t have the time to write this code just now.
I’m just a little overly hosed. You wanna look at iterating over
the Attachments in Transaction->Message.

    -j

Jason


Jason Slagle - CCNP - CCDP
Network Administrator - Toledo Internet Access - Toledo Ohio

  • raistlin@tacorp.net - jslagle@toledolink.com - WHOIS JS10172
    /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    \ / ASCII Ribbon Campaign . If dreams are like movies then memories
    X - NO HTML/RTF in e-mail . are films about ghosts…
    / \ - NO Word docs in e-mail . - Adam Duritz - Counting Crows

You can definitely put a bit of code into a template
to itterate through all Attachments to the Transaction
and include them if they’re of type text.

The fact that Message->First->Content doesn’t do the right thing here
is a bug that will get fixed for ~2.2

    -j

If the user sends their email as a text+html (2 attachments) you don’t get
any content from the “Correspodence” template.

Is it possible to include the first (Or any) text/plain attachments in the
content?

Of is there something I can shove in a template to do that?

Jason


Jason Slagle - CCNP - CCDP
Network Administrator - Toledo Internet Access - Toledo Ohio

  • raistlin@tacorp.net - jslagle@toledolink.com - WHOIS JS10172
    /"\ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    \ / ASCII Ribbon Campaign . If dreams are like movies then memories
    X - NO HTML/RTF in e-mail . are films about ghosts…
    / \ - NO Word docs in e-mail . - Adam Duritz - Counting Crows

Rt-devel mailing list
Rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“That package looks like what I wanted, but the site was down today,
so I decided to reimplement it in Perl.”
-me

Hi,

Sorry, I should have sent this to the list as well:

What would such a piece of code look like :smiley:

Unfortunately, I really don’t have the time to write this code just now.
I’m just a little overly hosed. You wanna look at iterating over
the Attachments in Transaction->Message.

This will do the trick:

{
$Transaction->Attachments(‘text/plain’)->First->Content ||
$Transaction->Attachments(‘text/html’)->First->Content ||
“No Viewable Message.”
}

Cheers,

Alex

Alex Krohn alex@gossamer-threads.com writes:

What would such a piece of code look like :smiley:

Unfortunately, I really don’t have the time to write this code just now.
I’m just a little overly hosed. You wanna look at iterating over
the Attachments in Transaction->Message.

This will do the trick:

{
$Transaction->Attachments(‘text/plain’)->First->Content ||
$Transaction->Attachments(‘text/html’)->First->Content ||
“No Viewable Message.”
}

No. It doesn not for me. For HTML messages, I allways get “No
Viewable Message.”

/ Jonas Liljegren

The Wraf project Welcome to the hub of online gaming
Sponsored by http://www.rit.se/

I understand that Attachments are no longer going to file but to the
database. Since the web page is still pointing to file
is the code still there to put them there and can I unable it. I see the
options in config.pm for the file size but setting this to 0 does
not work.

Thanks

Chris

Huh? I really don’t quite understand the question. RT2 requires that
ticket content be in the database. To the best of my knowledge, there are
not widely distributed patches to RT1 to move the files into the database.

    -jOn Mon, Jun 11, 2001 at 05:06:03PM -0400, Chris Farkus wrote:

I understand that Attachments are no longer going to file but to the
database. Since the web page is still pointing to file
is the code still there to put them there and can I unable it. I see the
options in config.pm for the file size but setting this to 0 does
not work.

Thanks

Chris

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

“Bother,” said Pooh, “Eeyore, ready two photon torpedoes and lock
phasers on the Heffalump, Piglet, meet me in transporter room three”

The file “WebRT/html/Ticket/Attachment/dhandler” has the following
lines:
my $content_type = $AttachmentObj->ContentType || ‘text/html’;
$r->content_type($content_type);
$m->out($AttachmentObj->Content);
$m->abort;

What exactly does “$m-o>ut(…)” do? How is it defined? In other
words, what is its return type (if it has one) , which arguments does
it take , etc? The whole point of this is to find out if an image can
actually be displayed using “$m->out(…)” . The problem we had with
"$m-out(…)" is that if the attachment was a jpeg (or any other
image),
then “Netscape (4.x and 6.x)” just displayed it as plain text .

Mixo
The above code is from an old version RT , rt-1-3-81, but is in
rt-2-0-4 as well.

Uh. this code has changed significantly since RT 1.3.81. Just today, I was
testing uploading jpegs into RT and displaying them via the webui.

    jOn Fri, Aug 03, 2001 at 10:21:19AM +0200, mixo wrote:

The file “WebRT/html/Ticket/Attachment/dhandler” has the following
lines:
++++++++++++++++++++++++++++++++++++++++++++++++++
my $content_type = $AttachmentObj->ContentType || ‘text/html’;
$r->content_type($content_type);
$m->out($AttachmentObj->Content);
$m->abort;
+++++++++++++++++++++++++++++++++++++++++++++++++++

What exactly does “$m-o>ut(…)” do? How is it defined? In other
words, what is its return type (if it has one) , which arguments does
it take , etc? The whole point of this is to find out if an image can
actually be displayed using “$m->out(…)” . The problem we had with
“$m-out(…)” is that if the attachment was a jpeg (or any other
image),
then “Netscape (4.x and 6.x)” just displayed it as plain text .

Mixo
The above code is from an old version RT , rt-1-3-81, but is in
rt-2-0-4 as well.


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

jesse reed vincent – root@eruditorum.orgjesse@fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90

that’s security the same way that asking for directions to topeka and
being told that a seal is a mammal is informative
-robin@apocalypse.org

Just curious, has anyone seen a problem when a user attachs an HTML file
that is divided into multiple pages?

RT clearly knows about both pages (giving the user the option of page 1
or page 2) but regardless of which one they select, it only displays page
1.

Thanks in advance,

darrin

|+ Just curious, has anyone seen a problem when a user attachs an HTML file
|+ that is divided into multiple pages?
|+
|+ RT clearly knows about both pages (giving the user the option of page 1
|+ or page 2) but regardless of which one they select, it only displays page
|+ 1.

BTW, I am running MySQL 3.23.42 with RT 2.0.11, and I have this:
set-variable = max_allowed_packet=16M

in my /var/db/mysql/my.cnf

Doing a mysqladmin -p variables yields the correct results for this
variable.

-darrin

Just curious, has anyone seen a problem when a user attachs an HTML file
that is divided into multiple pages?

Define ‘divided into multiple pages’ ? To me, a HTML ‘page’ is everything
from the opening to the closing (or end of connection).

‘Multiple pages’ that are somehow in one attachment would indicate that
the user is doing something weird. I suspect you’re referring to multiple
attachments. ( Terminology is important )

RT clearly knows about both pages (giving the user the option of page 1
or page 2) but regardless of which one they select, it only displays page
1.

Yup, Attachments. Are you certain that they are different? Actually, try
this (in SQL) to see whether they are different (replace ‘ticketID’ with
the number of the ticket with the problem).

SELECT count(distinct(at.Content))
FROM Attachments as at, Transactions as tn
WHERE at.TransactionId = tn.id AND
tn.Ticket = 'ticketID';

vs

SELECT count(at.Content)
FROM Attachments as at, Transactions as tn
WHERE at.TransactionId = tn.id AND
tn.Ticket = 'ticketID';

If the numbers don’t add up, you’ve got exactly duplicate attachments
somewhere. If they do match up, you got different contents in each
Attachment.

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

|+ Define ‘divided into multiple pages’ ? To me, a HTML ‘page’ is everything
|+ from the opening to the closing (or end of connection).

Our Sales Management Software uses crystal reports, which has the ability
to print in HTML format. Invoices, Sales Orders, etc that are ‘multiple
pages’. From looking at the raw HTML, the pages are divided by

tags.

|+ ‘Multiple pages’ that are somehow in one attachment would indicate that
|+ the user is doing something weird. I suspect you’re referring to multiple
|+ attachments. ( Terminology is important )

Nope. See above. Single Attachment.

|+ > RT clearly knows about both pages (giving the user the option of page 1
|+ > or page 2) but regardless of which one they select, it only displays page
|+ > 1.
|+
|+ Yup, Attachments. Are you certain that they are different? Actually, try
|+ this (in SQL) to see whether they are different (replace ‘ticketID’ with
|+ the number of the ticket with the problem).
|+
|+ SELECT count(distinct(at.Content))
|+ FROM Attachments as at, Transactions as tn
|+ WHERE at.TransactionId = tn.id AND
|+ tn.Ticket = ‘ticketID’;
|+
|+ vs
|+
|+ SELECT count(at.Content)
|+ FROM Attachments as at, Transactions as tn
|+ WHERE at.TransactionId = tn.id AND
|+ tn.Ticket = ‘ticketID’;
|+
|+ If the numbers don’t add up, you’ve got exactly duplicate attachments
|+ somewhere. If they do match up, you got different contents in each
|+ Attachment.

mysql> SELECT count(distinct(at.Content))
→ FROM Attachments as at, Transactions as tn
→ WHERE at.TransactionId = tn.id AND
→ tn.Ticket = ‘93’;
| count(distinct(at.Content)) |
| 2 |
1 row in set (0.04 sec)

mysql> SELECT count(at.Content)
→ FROM Attachments as at, Transactions as tn
→ WHERE at.TransactionId = tn.id AND
→ tn.Ticket = ‘93’;
| count(at.Content) |
| 2 |
1 row in set (0.00 sec)

–darrin

|+ Define ‘divided into multiple pages’ ? To me, a HTML ‘page’ is everything
|+ from the opening to the closing (or end of connection).

Our Sales Management Software uses crystal reports, which has the ability
to print in HTML format. Invoices, Sales Orders, etc that are ‘multiple
pages’. From looking at the raw HTML, the pages are divided by

tags.

|+ ‘Multiple pages’ that are somehow in one attachment would indicate that
|+ the user is doing something weird. I suspect you’re referring to multiple
|+ attachments. ( Terminology is important )

Nope. See above. Single Attachment.

See above. User is doing something weird. :wink:

Not seeing an example (and having currently borked my web rt installation,
oh joy), I’d hazard that either RT or the browser is simply stopping at
the first closing . The handler for attachments doesn’t have any
magic to show one part or the other.

If its one attachment, that makes

|+ > RT clearly knows about both pages (giving the user the option of page 1

a little confusing. This is in the Ticket display page?
Ticket/Elements/ShowTransaction (the bit which generates the ‘Download’
links) doesn’t have anything to split apart Attachments. Odd.

rt-devel would be your next step.

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

|+ a little confusing. This is in the Ticket display page?
|+ Ticket/Elements/ShowTransaction (the bit which generates the ‘Download’
|+ links) doesn’t have anything to split apart Attachments. Odd.
|+
|+ rt-devel would be your next step.

Going there next. But when I display the attachment, at the bottom of
the page, I get:

View Pages:   Next   Last

-darrin

|+ a little confusing. This is in the Ticket display page?
|+ Ticket/Elements/ShowTransaction (the bit which generates the ‘Download’
|+ links) doesn’t have anything to split apart Attachments. Odd.
|+
|+ rt-devel would be your next step.

Going there next. But when I display the attachment, at the bottom of
the page, I get:

View Pages: Next Last

Oh!

Ok, the displaying of attachments in RT is done by a script
‘WebRT/html/Ticket/Attachment/dhandler’. At the bottom of this, there is:

$m->out($AttachmentObj->Content);
$m->abort;

‘View Pages’ isn’t generated by RT. In fact, when it displays the
attachment, thats all, and only, what it displays. Instead, the ‘View
Pages’ must within the HTML of the attachment. It would be interesting to
know if your browser is receiving all the … pages, or is
just stopping after the first closing .

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

What happens to attachments (in rt 2.0.15) … where do they go? I was
doing some testing and found that MS docs get corrupted (at least the one I
tried said that the path was now invalid what ever that means and I
couldn’t open it.) Should attachments only be text? or can binary ones be
handled?

Thanks for any info
John

<>< Proverbs 3:5-6 “Trust in the Lord with all your heart and lean not on
your own understanding;
in all your ways acknowledge him, and he
will make your paths straight.”

Go figure I zip the word doc and it uploads and downloads fine. Still would
like to know how attachments are handled.

John

At 09:22 AM 3/31/2003, you wrote:

What happens to attachments (in rt 2.0.15) … where do they go? I was
doing some testing and found that MS docs get corrupted (at least the one
I tried said that the path was now invalid what ever that means and I
couldn’t open it.) Should attachments only be text? or can binary ones be
handled?

Thanks for any info
John


<>< Proverbs 3:5-6 “Trust in the Lord with all your heart and lean not on
your own understanding;
in all your ways acknowledge him, and he
will make your paths straight.”


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

<>< Proverbs 3:5-6 “Trust in the Lord with all your heart and lean not on
your own understanding;
in all your ways acknowledge him, and he
will make your paths straight.”

Hi All,

I’m currently developing a form which performs some basic ticket
manipulations
eg, set priority, due date etc…
Now the requirement to add attachments has arisen on this form.

I’ve searched the archives for relevant information on this but I cannot
find any.
So hence this post.

Has anybody developed such a form with this functionality before?
If so, would they be kind enought to point me in the right direction.

Thank you in advance,
Jp