Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks


Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Tuesday, June 18 2013 @ 10:40 PM EDT


 Forum Index > Support > General Geeklog Support New Topic Post Reply
 A public dummy site mail and a protected real site mail
   
LWC
 11/08/05 09:51AM (Read 2596 times)  
+++++
Full Member

Status: offline


Registered: 02/19/04
Posts: 811
$_CONF['site_mail'] is supposed to be a public e-mail address. Actually, it's the only e-mail address Geeklog doesn't protect.

Well, we all know that the site obviously has to use something in the "from" header when it sends something to the users.
Which is exactly why I - as well as most of the sites - always use something that starts with something like no_reply@.

But there comes a time when you need to send something to yourself so you can't you no_reply@ after all...at least if you want to use $_CONF['notification'].

Those notifications are found in multiple files in multiple sections. There's no central place to easily have them sent to another address (an actual address or by using a certain uid).

Therefore, I suggest to have 2 site_mails:
$_CONF['site_mail']
and
$_CONF['default_contact]
When Geeklog needs to send a message to you, it will only use the former if the latter isn't set.

So what do you think?

 
Profile Email Website
 Quote
LWC
 12/18/05 07:01PM  
+++++
Full Member

Status: offline


Registered: 02/19/04
Posts: 811
Here's my solution for this situation (it was officially submitted). I hope you'd implement it!

Config.php :
PHP Formatted Code

// This is the return address for all email sent by Geeklog:
$_CONF['site_mail']         = 'noreply@mydomain.com';
// This is the target address for notifications sent by Geeklog:
// (could be either a uid or a username)
// $_CONF['default_contact'] = 2;




 

The reason it's disabled is so it doesn't take away anything from existing sites! In other words, you can not use it by mistake as it won't work unless you uncomment it (see below)!

Note that it can either a uid or a username!

system/lib-comment.php (> Geeklog v1.4)
public_html/comment.php (< Geeklog v1.4)
As well as any other file that has notifications!
From:
PHP Formatted Code

    COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);




 

To:
PHP Formatted Code

notification($mailsubject, $mailbody);




 

And finally,
lib-common.php (or something alike):
PHP Formatted Code

function notification($mailsubject, $mailbody) {
global $_CONF, $_TABLES;

$result = -1;
if (isset($_CONF['default_contact'])) {
if (is_numeric($_CONF['default_contact']))
$default_type = 'uid';
else
$default_type = 'username';

            $result = DB_query("SELECT username,fullname,email FROM {$_TABLES['users']} WHERE $default_type = {$_CONF['default_contact']}");
}
if ($result) {
            $A = DB_fetchArray($result);
            if (!empty ($A['fullname'])) {
                $to = COM_formatEmailAddress ($A['fullname'], $A['email']);
            } else {
                $to = COM_formatEmailAddress ($A['username'], $A['email']);
            }
    COM_mail ($to, $mailsubject, $mailbody);
} else
    COM_mail ($_CONF['site_mail'], $mailsubject, $mailbody);
}



 

 
Profile Email Website
 Quote
Content generated in: 1.20 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content