Jump to content

Harald Ponce de Leon

Community Team
  • Content count

    5,379
  • Joined

  • Last visited

  • Days Won

    130

Posts posted by Harald Ponce de Leon


  1. its a PHP setting:

     

    zlib.output_compression = On

     

    Right.

     

    Here is the logic in application_top.php:

     

    01: if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {
    
    02:   if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {
    
    03:     if (PHP_VERSION >= '4.0.4') {
    
    04:       ob_start('ob_gzhandler');
    
    05:     } else {
    
    06:       include(DIR_WS_FUNCTIONS . 'gzip_compression.php');
    
    07:       ob_start();
    
    08:       ob_implicit_flush();
    
    09:     }
    
    10:   } else {
    
    11:     ini_set('zlib.output_compression_level', GZIP_LEVEL);
    
    12:   }
    
    13: }

     

    Line 2 checks to see if zlib.output_compression is enabled or not - if it is, it sets the compression level with the GZIP_LEVEL parameter, and that is all - no further gzippin' is occuring :D


  2. actually what i really meant is that if your using the 2003/01/22 snapshot (which has this already included) with transparent zlib compression enabled, then adding this code to the store again broke things for me.

     

    Is the zlib compression enabled in php.ini or is it mod_gzip for Apache?

     

    The GZip feature in CVS checks to see if zlib compression is enabled in php.ini and disables itself if the GZip feature is enabled.

     

    There is currently no mod_gzip detection occuring.


  3. This message was created automatically by mail delivery software (Exim).

     

    A message that you sent could not be delivered to one or more of its

    recipients. This is a permanent error. The following address(es) failed:

     

     pipe to |php3 -q /var/www/TESTSITE/osc_mail2db.php

    config=/var/www/TESTSITE/admin/includes/configure.php

       generated by care@mydomain

     

    <<snip>>

     

    You should try the php4 binary :)

     

    The mime_decode.php script is not php3 compatible. Just for your information, the mime_decode.php script depended on Pear - I removed that dependency as it was only using Pear for its logging capabilities, so it works without Pear.


  4. Ok looks like ive got a bit further, correct my typo in the directory name...  I get a bounce back that looks like this

     

    ------ pipe to |/usr/lib/cgi-bin/php4 -q /var/www/TESTSITE/osc_mail2db.php

    +config=/var/www/TESTSITE/admin/includes/configure.php

          generated by care@mysite ------

     

    <br />

    <b>Fatal error</b>:  Call to undefined function:  mysql_connect() in

    +<b>/var/www/TESTSITE/osc_mail2db.php</b> on line <b>95</b><br />

     

    ------ pipe to |/usr/lib/cgi-bin/php4 -q /var/www/TESTSITE/osc_mail2db.php

    +config=/var/www/TESTSITE/admin/includes/configure.php

          generated by sales@mysite

          (ultimately generated from care@mysite) ------

     

    <br />

    <b>Fatal error</b>:  Call to undefined function:  mysql_connect() in

    +<b>/var/www/TESTSITE/osc_mail2db.php</b> on line <b>95</b><br />

     

    Please tell me you've read that message :D

     

    I've marked the important text in bold.

     

    Your PHP binary does not include MySQL functionality. It needs to be compiled again.


  5. Forgive my lack of knowledge...but what will this do for me ??

     

    Since you do not have access to the php binary (due to chroot), get the server administrator to copy the binary to your home directory - then you have access to it.

     

    You could also try to compile the php binary on your server, but I doubt it would work due to the chroot environment.

     

    You can also try to FTP upload a php binary to your server, if you have a matching OS to what the server is using. It may or may not work (probably won't, but its up to you to try).

     

    Your server administrator will probably kill me now for saying that :D :lookround:


  6. Perl and Python are available in the chroot, just not cli php. So any other piping mail processors that use Perl or Python *should* work. PHP just isn't one of the more popular command-line interface tools since it's primary development purpose is serving dynamic web pages

     

    Easy :D

     

    cd ~/
    
    mkdir bin
    
    cp /usr/bin/php ~/bin/

     

    (ofcourse they would have to do this due to the chroot)

     

    There is nothing you can do with php binary that you can't with the php module (in apache, as a http request).


  7. When i install this file in my shop which is 2.2 mid november, the contact_us.php just loads a blank page. Any ideas guys?? IS it purely because its an older snapshot?

     

    Do you have the helpdesk_departments table definition set in catalog/includes/application_top.php? (as mentioned in the installation text)


  8. emails are not getting placed with the correct department... all emails are placed with the default department...

     

    For some strange reason mysql_num_rows is returning 0 for the departments query :(

     

    A fixed osc_mail2db.php has been uploaded again to the Contribution package-set.

     

    The error for the department query was a leading space existing in the email address.


  9. to logon to the tellnet i put in mail.mydomain.com 110

     

    is that right

     

    That is not right :(

     

    Adding recipes is not done by logging into the mail server daemon, it is done by editing mail daemon configuration files.

     

    If your server is using Sendmail or Postfix, the example in the installation text will work for you. Otherwise you will need to find out how to add recipes specific to your MTA and/or consult your server administrator.


  10. which leads me to this question: Why can't we just insert the ticket into the DB when the user submits it instead of sending it to a mail alias that forwards it to a script that inserts it into the database????... seems like alot of circling around to just get some info in the database.

     

    I mentioned that in a previous post :) (on page three of this thread)

     

    Actually, the reason for the email is to use whatever is defined in the recipe and to have whatever there consistent when postings are sent via email or via the Contact Us page.

     

    If a backup email address is used, this would only need to be set in the recipe and not in the Contact Us php logic.


  11. Vielleicht lerne ich ja mal irgendwann etwas Englisch

     

    Maybe you can ask here:

     

    http://www.oscommerce.de

     

    i have just set up postfix and now the mail just disappears it doesnt get returned and it doesnt appear in the admin section of helpdesk. this is driving me insane!!! hehe

     

    Regarding:

     

    http://forums.oscommerce.com/viewtopic.php...p?p=95351#95351

     

    I just had alook and ooooops! :oops:

     

    The parse_output() call should be renamed to osc_parse_mime_decode_output()

     

    I will upload the fixed osc_mail2db.php script to the contribution.

     

    The function is defined in osc_mail2db.php.

     

    Also what is the web based admin you are using for postfix?

     

    Postfix is on my local Gentoo Linux server - all configuration is done by hand :D


  12. Can you please post a copy of your 'alias' file (I'm not even sure if that's it's name or if it has an extension) so those of us who use cPanel and sendmail are able to copy your process.

     

    /etc/mail/aliases:

     

    help: "|/usr/bin/php -q /home/projects/osCommerce/cvs/catalog/extras/helpdesk/osc_mail2db.php config=/home/projects/osCommerce/cvs/admin/admin/includes/local/configure.php

     

    All on one line.

     

    The "help" user does not have to have a user account on the server - it's just an alias.

     

    Note: Don't forget to run "newaliases" to generate a new aliases.db file :) (should be located in the same directory as the "aliases" file)

     

    Am I correct in my thinking that we can just change a few minor things in your file and upload it to our usretc directory and all will be working?

     

    No - as mentioned, configuration is server specific.

     

    You can try, but don't blame me if something breaks :D


  13. Here is my example at Pair:

     

    pair_mail_1.jpg

     

    The option to choose above is "Filter"

     

    pair_mail_2.jpg

     

    In the Mail Sent To field I would enter the mail alias entry of help, sales, info, or whatever so that the helpdesk department email address would be help _AT_ oscommerce.com, sales _AT_ oscommerce.com, info _AT_ oscommerce.com, or whatever.

     

    [the " _AT_ " string is ofcourse the @ symbol to avoid the forum creating automatic links to non existing email accounts]

     

    The Pass To field would contain the following:

     

    /usr/bin/php -q /path/to/osc_mail2db.php config=/path/to/admin/includes/configure.php

     

    Note: There is no need to enter the | here (as in "|/usr/bin/php -q ....") as this is a html based interface to the mail setup which does the magic automatically behind the scenes.

     

    ##

     

    The correct term for mail alias entry is indeed Recipe.


  14. There is a reason why little documentation was provided with the contribution in regard to accepting incoming mails - this is very server specific and will be impossible to cover all areas. That is why when people have this working they should report back on the steps they made not only to help others out, but to also put some documentation together. I've put my bit in with the Sendmail example - that is all I did and it works for me.

     

    I will mention three types of servers:

     

    1) Localhost (Linux. Windows probably needs a third party application).

    2) Shared Server (little control over the server)

    3) Dedicated Server (some control over the server)

     

    1) It's more than likely you have no idea what to do otherwise you would not be reading up to this page on this thread :D (smile, sooner or later you will get it working)

     

    The most important thing to do is to get mails working with your localhost server. I have Gentoo Linux installed, the appropriate documentation for this can be found here:

     

    http://www.gentoo.org/doc/en/desktop.xml#doc_chap6

     

    If your server documentation is still alien to you, the only suggestion I have is to test this on the shared/dedicated server and let the server administrator take care of it for you.

     

    2) Ask your server administrator! Tell them you need a mail alias entry to parse a script - provide the examples given in the contribution installation text.

     

    If your server administrator does not know or has to do research on it, I'd suggest to move to another server hosting company. Hey, this is e-commerce, it should be taken seriously - your server administrator should have the know-how for their own servers!

     

    3) A combination of 1) and 2).

     

    ##

     

    I hope that helps somewhat - I am not a unix mail guru so I cannot provide more tips.

     

    ##

     

    The contribution will also work without a mail alias entry, but then incoming emails cannot be tracked and stored in the database. I think the Contact Us page provided needs to be updated in this case as it needs to store the submited information directly in the database instead of emailing it to the mail alias entry (which would not exist).


  15. What are the downfalls of using gZip? (This seems too good to be true!)

    Am I just sacrificing CPU time, or will I run into compatibility problems with client browsers?

     

    Remember that it is just the HTML being compressed, not the images. The images are already compressed in either GIF or JPG or whatever.

     

    I have proposed a php/gzip feature internally and will spruce it up and contribute it soon.

     

    There is some logic to enable gzip compression only if the client supports it.

     

    Here are some rough benchmarks:

     

    default.php:

    Uncompressed length: 27774

    Compressed length: 3753

     

    product_info.php:

    Uncompressed length: 25908

    Compressed length: 4045

     

    checkout_confirmation.php:

    Uncompressed length: 25617

    Compressed length: 3428

×