Mail notification comments is empty

Hello ! Sorry for my bad english...

I have upgrade zenphoto 1.0.5 to 1.1.4. I have actived the notification when a comment is add. But the mail (object and message) is empty. Where is the error? Which file do I have to modify? Before the upgrade, that works be fine!

Thank you for your help !
«1

Comments

  • If you are running an IIS server you will need to be on the nightly build of version 1.1.5.
  • itsme Member
    No it doesn't running on an iss server...which file concern that problem ? thank you
  • libe-utf8.php
  • itsme Member
    thank you. Do you know where is the problem in this file?
  • No, because you are the only one reporting the problem.
  • I do have this same problem with my test gallery, I am not on a IIS. And I am running 1.1.5 [1219]
  • Please check the following:

    Do you receive an email if you request a password reset?

    Check the email address you have entered in the admin login information. Is it correct?

    Check your spam filter. Is it allowing the emails from the gallery?

    Check the email comment notification option. Is is checked?
  • I receive an email when I do a password reset, but its empty like the other one.

    http://img.skitch.com/20080403-qjh9j6kt7jxtmxf4eytfc2cxsu.jpg

    Yes the email is correct.

    http://img.skitch.com/20080403-1xn94gdt3nhqdmdsuuqb1521nd.jpg

    Yes I get the emails in my inbox.

    Yes its checked.

    http://img.skitch.com/20080403-re6k762qgmuiuktyd4afi7ij9q.jpg

    Is it normal that the email is from, zenphoto@URL ?
  • itsme Member
    Do you receive an email if you request a password reset?

    > YES.

    Check the email address you have entered in the admin login information. Is it correct?

    > YES. We are notify when a comment is added. But with the mail empty.

    Check your spam filter. Is it allowing the emails from the gallery?

    > YES. Is it allowed.

    Check the email comment notification option. Is is checked?

    > YES. It is checked.

    The bug is in libe-utf8.php, but where?

    Thanks for your help sbillard !
  • The mail function is `send_mail()` in lib-utf8.php. It would appear that something is happening to the `$messsage` array. Is is possible that `safe_mode` is set on your server?
  • To debug this you could add an output statement after the line:
    ` $message = chunk_split(base64_encode($message));`
    add
    `echo "
    Mail message reads:".$message;`

    If this shows text, then the message is still intact and something is happening during the sending or receiving.
  • itsme Member
    thank you for your help. But where is the lib-utf8.php? I will test immediately.
  • It is in the folder zp-core in your installation
  • itsme Member
    is it utf8.php ?
  • itsme Member
    there is not a file called "lib-utf8.php"
  • If you are not running on zenpoto 1.1.5 nightly build, you should do so. Then the file lib-utf8.php will be in the zp-core folder.
  • itsme Member
    I don't want to update to a nightly build. I have scared to do something wrong...is the bug not in another file?
  • There are no known bugs in this area.
  • itsme Member
    And which folder(s) and file(s) do I have to replace? all the zp-core folder? (the nighty build over the 1.1.4?)

    Thanks for your help...
  • You should delete all the files and folders in the zp-core folder except for the zp-config.php. Also delete all the files and folders in the themes folder. Then copy the contents of these two folders from the nightly build. I suggest you wait until tomorrow for this, though. We have found a small problem with plugins in last night's build.
  • itsme Member
    ok thank you...stay me tuned !
  • This time tomorrow should be good.
  • just a quick question regarding the latest zenphoto build and email notifications: what PHP version is required to be able receive notifications?

    I'm asking this because I have 2 identical latest builds of zenphoto running on 2 separate servers one on

    PHP version 5.2.5

    the other one on

    PHP version 4.3.11

    on the older version of PHP 4.3.11 which in the documentation it says is supported - can't receive any email notifications -none(but only using the latest zenphoto build)with older builds work fine

    on the PHP v. 5 all notifications work ok
  • acrylian Administrator, Developer
    Actually that should work with 4.1/4.3, too, but I am not familiar with that parts of the code.
  • I'm having a very similar issue. I have random comments being made on my site about valtrax and viagra and I would like them to be sent to me for moderation. I receive emails about password resets, but I do not receive them when someone makes a comment on an image. I am running version 1.1.7[1842]. Any ideas on how I can get this to work? I don't know what php version my server is running. I'm using GoDaddy as my WebHost. Thanks for any advice you can give...

    Jason
  • jcase16: You should see if this problem still exists for you in the 1.2 (or better current nightly build) version of zenphoto.

    You can see what version of PHP you are using when you run the setup program. It will display the PHP version in the system check information.

    ImDude: what other possible differences are there between the two installations? We have not had a problem in the past with email on PHP version 4.
  • Hi sbillard,

    After months ago, I have finally tested your code that you have posted before :

    To debug this you could add an output statement after the line:
    $message = chunk_split(base64_encode($message));
    add
    echo "Mail message reads:".$message;

    If this shows text, then the message is still intact and something is happening during the sending or receiving.

    And they shows no text.

    So i have try to sending me a password, and i have received a mail for reset my password but empty. Same problem with the comment that i have received.

    The bug is still running since 1.1.4 and now I have upgrade to 1.2.1 and the problem is staying.

    Is it not a problem in the zp-config.php file?

    Thank you for your answer!
  • sbillard please?
  • print out the $message content before and after the `$message = chunk_split(base64_encode($message));` statement. If it is empty before you will have to back track and put some debug output at the calling location.

    This would be in the zp_mail function in functions.php. Check to see if it was passed the text. If so, check where in its processing the text gets lost, e.g. the UTF8 conversion.

    If the message is empty when zp_mail is called check the call on zp_mail in auth_zp.php.
  • I have tried but it's a little complicated for me so i have paste the code here :

    From functions.php :

    `
    function zp_mail($subject, $message, $headers = '', $admin_emails=null) {
    `
    echo "message=$message";
    `
    if (is_null($admin_emails)) { $admin_emails = getAdminEmail(); }
    if (count($admin_emails) > 0) {
    // Make sure no one is trying to use our forms to send Spam
    // Stolen from Hosting Place:
    // http://support.hostingplace.co.uk/knowledgebase.php?action=displayarticle&cat=0000000039&id=0000000040
    $badStrings = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:");
    foreach($_POST as $k => $v) {
    foreach($badStrings as $v2) {
    if (strpos($v, $v2) !== false) {
    header("HTTP/1.0 403 Forbidden");
    die("Forbidden");
    exit();
    }
    }
    }

    foreach($_GET as $k => $v){
    foreach($badStrings as $v2){
    if (strpos($v, $v2) !== false){
    header("HTTP/1.0 403 Forbidden");
    die("Forbidden");
    exit();
    }
    }
    }

    if( $headers == '' ) {
    $headers = "From: " . get_language_string(getOption('gallery_title'), getOption('locale')) . "";
    }

    // Convert to UTF-8
    if (getOption('charset') != 'UTF-8') {
    $subject = utf8::convert($subject, getOption('charset'));
    $message = utf8::convert($message, getOption('charset'));
    `
    echo "UTF8 converted message=$message";
    `
    }

    // Send the mail
    foreach ($admin_emails as $email) {
    UTF8::send_mail($email, $subject, $message, $headers);
    }
    }
    }
    `
    From auth_zp.php, zp-mail is only call here :

    `
    if (isset($_POST['login']) && isset($_POST['user']) && isset($_POST['pass'])) {
    $post_user = sanitize($_POST['user'],3);
    $post_pass = sanitize($_POST['pass'],3);
    $redirect = sanitize($_POST['redirect'],3);
    if ($_zp_loggedin = checkLogon($post_user, $post_pass)) {
    zp_setcookie("zenphoto_auth", md5($post_user . $post_pass), time()+5184000, $cookiepath);
    if (!empty($redirect)) { header("Location: " . FULLWEBPATH . $redirect); }
    } else {
    // Clear the cookie, just in case
    zp_setcookie("zenphoto_auth", "", time()-368000, $cookiepath);
    // was it a request for a reset?
    $admins = getAdministrators();
    $admin = array_shift($admins);
    $key = $admin['pass'];
    $code_cypher = md5(bin2hex(rc4($key, trim($post_pass))));
    if (isset($_POST['code_h'])) {
    $code_hash = sanitize($_POST['code_h'],3);
    } else {
    $code_hash = '';
    }
    if (($code_cypher == $code_hash) && strlen(trim($post_pass)) == CAPTCHA_LENGTH) {
    if (empty($post_user)) {
    $requestor = 'You are receiving this e-mail because of a password reset request on your Zenphoto gallery.';
    } else {
    $requestor = sprintf(gettext("You are receiving this e-mail because of a password reset request on your Zenphoto gallery from a user who tried to log in as %s."),$post_user);
    }
    $admins = getAdministrators();
    $user = array_shift($admins);
    $adm = $user['user'];
    $pas = $user['pass'];
    setOption('admin_reset_date', time());
    $req = getOption('admin_reset_date');
    $ref = md5($req . $adm . $pas);
    $msg = "\n".$requestor.
    "\n".sprintf(gettext("To reset your Zenphoto Admin passwords visit: %s"),FULLWEBPATH."/".ZENFOLDER."/admin-options.php?ticket=$ref") .
    "\n".gettext("If you do not wish to reset your passwords just ignore this message. This ticket will automatically expire in 3 days.");
    `
    echo "message to be passed=$msg";
    `
    zp_mail(gettext("The Zenphoto information you requested"), $msg);
    $_zp_login_error = 2;
    } else {
    $_zp_login_error = 1;
    }
    }
    }
    }
    `
    Can you help me with this please?

    Thank you very much for your help!
Sign In or Register to comment.