Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Problem with mail piping and postfix


I'm installing osTicket in a server with postfix as mta. I enable piping in admin panel and added the line:
support: |/var/www/localhost/htdocs/support/api/pipe.php

that is where osTicket is installed. I put the execute permission in pipe.php (755) to permit postfix user execute it. When I send an email to support the system returns me the email with the following message:

Subjet: API Error(s)

Invalid FROM address [Validation failed for: Óscar Amor <>]

And the system give the following mail:

This is the mail system at host enigma.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<support@mail>: data format error
Reporting-MTA: dns; enigma
X-Postfix-Queue-ID: 77C10A05140
X-Postfix-Sender: rfc822; [email][/email]
Arrival-Date: Mon, 21 Apr 2008 12:31:37 +0200 (CEST)

Final-Recipient: rfc822; [email][/email]
Original-Recipient: rfc822;
Action: failed
Status: 5.6.0
Diagnostic-Code: x-unix; data format error

I don't have any email in banlist.

Any ideas?


  • The code checking your emails is part of PEAR which checks it against the RFC standards.

    oops (edit correction)

    your bad email is the which doesn't contain a top level domain (.com .edu, etc).. thats where your problem is.....
  • djtremors;2637 said:
    your bad email is the which doesn't contain a top level domain (.com .edu, etc).. thats where your problem is.....
    This mail is an example. I'm using real mail ( but i don't post here to avoid spam.
  • : data format error
    Reporting-MTA: dns; enigma
    So your saying that support@mail was a typo replacement?
    Besides that, i can't see any other issues.. possibly the special characters in the users name maybe???

    if you can PM me the real error maybe, might help
  • Like djtremors is saying, it could very well be the Ó character. Try replacing this with a normal O and see if that helps.
  • Hi there

    I get the same problem when I receive messages where the FROM name is in Greek and the email has been sent from Outlook.

    The header is:

    From: =?iso-8859-7?B?w+n+8ePv8iDT9ezl+e3f5Ofy?=

    When I change the name to english, the header becomes:

    From: "Name in English"

    and the email goes through to osticket properly...

    Also, when I send an email from gmail where FROM is in greek, the header is:

    From: "=?ISO-8859-7?B?w+n+8ePv8iDT9ezl+e3f5Ofy?="

    which is the same thing only with "" around it and the email also goes through properly.

    So (I'm guessing) the problem occurs when the FROM name is in Greek without quotes. However, I have no idea how to fix this. This causes a big problem as every time this happens the client gets a failure email and thinks we didn't get the email.

    Any suggestions would be welcome.

  • In case anybody is having the same problem, I verified that the problem is indeed caused by the missing quotes.

    I made a simple addition to osTicket code which detects if the quotes are missing and adds them. This seems to have solved it for me.
  • @Symos: share to show us your code change or supply us a diff -urw or whichever method so we can easily patch them in?
  • The only reason I didn't post this before was that I'm sure somebody more familiar with php can write it in a better way. But until then:

    In includes/class.mailparse.php, right at the beginning of the first function (function Mail_parse) before all existing code I added the following code:

    	If (stripos($mimeMessage,'From: =?') !== false || stripos($mimeMessage,'From:=?') !== false) {
    $FromPosition = stripos($mimeMessage,'FROM:');
    If ($FromPosition !== false) {
    $mimeMessage = substr($mimeMessage,0,$FromPosition+6) . '\"' . substr($mimeMessage,$FromPosition+6,strlen($mimeMessage)-$FromPosition+6);
    $BracketPosition = stripos($mimeMessage,'<',$FromPosition+6);
    $mimeMessage = substr($mimeMessage,0,$BracketPosition-1) . '\"' . substr($mimeMessage,$BracketPosition-1,strlen($mimeMessage)-$BracketPosition+1);

    I think I haven't added anything else in any other files.

    What this code does:
    When the "From" name in an email is written in a different language, sometimes it gets recoded starting with "From: =?iso-8859-7?" or whatever the encoding is. Gmail etc. add quotes before and after =?iso etc. so it works. But Outlook doesn't. So my code looks for "=?" (without the quotes) after "From:", then looks for a "<" (indicating the beginning of the email address after the name) and adds quotes around this part. So far it has worked for me flawlessly.
  • A proper mail parser should handle this but then requires either someone to write a class to manage full ISO standards or have in compile for php to do it properly which most people dont have.. :(
    Lucky for me, English is fine.
Sign In or Register to comment.