Solved

Emails to OSticket getting cut off when there is a ' or "

Posted on 2006-06-27
6
1,100 Views
Last Modified: 2013-12-13
Hi there,

I have OSticket running and I believe it uses the php mail function.  When I receive email form 1 client (Mac, entourage) it cuts the message off at the first " or '  in the message.  If i copy the original and send from Outlook there is no problems.  Is this an encoding issue or something that can be corrected on my end or do I have to get the client to change something.

Mike
0
Comment
Question by:guess18
  • 3
6 Comments
 
LVL 40

Expert Comment

by:RQuadling
ID: 16999055
I don't run OSTicket, and as such have some questions.

I tried to download OSTicket, but V1 is discontinued and V2 is coming. http://www.osticket.com/downloads.php

The system must somehow get the email from the mail server.

You need to examine this script to see if you can get the mail as soon as it arrives into the script and before any processing. At that stage see if the entire email is present.

If it is, then the problem is withing OSTicket.

If not then the problem lies between the client and the mail server OR the mail server and the method PHP uses to read the mail.

But without any source, this is a bit difficult to deal with.
0
 

Author Comment

by:guess18
ID: 17003332
Thanks for the response.  Currently I am running a windows scheduled task to fetch the email from this post http://www.osticket.com/forums/showthread.php?t=349&highlight=pop3+fetch 

You can download version 1.3.1 from this post http://www.osticket.com/forums/showthread.php?t=1362&highlight=download+1.3.1

I believe its the script that is causing the errors because I setup that POP account to forward a copy to my email address incase something like this happens.  The copy I receive is fine in Outlook 2003.  For some reason its just from this one client that is sending mail from Entourage in Mac.

Thanks,

Mike
0
 
LVL 40

Accepted Solution

by:
RQuadling earned 500 total points
ID: 17007772
Without some data to test and to see what is going on, I'm a bit stuck.

I assume that automail.php is the script responsible.

I would say that the get_part() function is the problems.

What we need to determine is ...

1 - Is this the right place to look.
2 - Assuming it is, does $curmsg contain the ENTIRE message.

The issue is that we need to know which message to examine as you may be getting a LOT of messages.

I think you will need the help of your Mac user to diagnose this.

The first thing I would do is to probably dump the value of $curmsg to a file.

If you have VERY few (1 or 2 an hour), then we can use the same file and you have to manually watch for them.

If you get more than that, then you would need to use 1 file per message and manually delete them.

If you know of a way to identify the sender then we can use that as a filter.

The function imap_body() will get the message in its entirity. Ignoring MIME types.

That would be a start. Make sure your server is actually getting the entire message.

Basically it is a debugging exercise.

It is a case of seeing what gets extracted from the message and reporting that and manually dianosing it.

Ah.

As this is running on a  schedule, you COULD stop that and run it manually from the CLI or a browser?

So, we should be able to add as much debugging as we want.



So ...
Stop the scheduler and see if you can launch the automail.php script from your browser.

If so, lets start debugging.

All debugs are ...

echo '<br />' . __FILE__ . ':' . __LINE__ . ':' . xxxx;

where xxxx is the variable or message we want to show. That way we have a history of each line.

0
 
LVL 40

Expert Comment

by:RQuadling
ID: 17007807
     while ($curmsg <= @imap_num_msg($mbox)) {
            echo '<br />' . __FILE__ . ':' . __LINE__ . ": <b>Message #$curmsg</b> : " . imap_body($mbox, $curmsg) . '<hr /><br /><br />';
            $body = get_part($mbox, $curmsg, "TEXT/PLAIN");


Try this one first. See if the entire message is visible.

If you are running this manually you should see the message on the screen.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now