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 !
Comments
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?
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 ?
> 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 !
` $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.
Thanks for your help...
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
Jason
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.
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!
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.
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!