Emails notifications from Savannah FrontEnd

Overriding notification emails during development

Set the following variable in .savane.conf.php:

$sys_debug_email_override_address = "savannah-hackers-tests@gnu.org";

To override any outgoing email notifications, and ensure they are sent only to the development mailing list.

Each email will have the following prepended to the message body:

Savannah Debug: email override is turned on
Original recipient list:
jsmith@example.com
------------

If the variable $sys_debug_email_override_address is set, all emails will be sent to its content (assumed to be a valid email address) regardless of the original recipients for the notification email. It is recommended to set it to savannah-hackers-tests@gnu.org to avoid spamming the public mailing lists. When using this email address, it is recommended to subscribe to this mailing list here: https://lists.gnu.org/mailman/listinfo/savannah-hackers-tests to ensure you (the developer) will receive the notification emails.

If the variable $sys_debug_email_override_address is not set, emails sent from the development site (e.g. new support tickets) are sent to the relevant mailing lists (e.g. savannah-help-public@gnu.org) and will be delivered to all the subscribers - don't spam unnecessarily.

In both cases (variable set or unset), emails sent from the development site originate from www-data@jsmith.frontend0.savnnah.org. The first time emails are sent they will be held in moderation until reviewd by a human (all of savannah's mailing lists are moderated as an anti-spam measure).

It is recommended to send a test email early (e.g. when the development site is first activated), and allow 24 hours for a human moderator to approval this email address. This will save frustrations later on if trying to troubleshoot email issues or adjust email message content.

Email addresses in the database

The PHP website sends notification emails for two types of events:

  1. Project registrations
  2. Project tracker submissions (new bugs/support/tasks/patches/cookbook/news items).

For new project registrations:

mysql> select type_id, name, admin_email_adress from group_type ;
+---------+------------------------------------+----------------------------------+
| type_id | name                               | admin_email_adress               |
+---------+------------------------------------+----------------------------------+
|       1 | Official GNU software              | savannah-register-public@gnu.org |
|       2 | non-GNU software and documentation | savannah-register-public@gnu.org |
|       3 | www.gnu.org portions               | savannah-register-public@gnu.org |
|       4 | GUG                                | savannah-hackers@gnu.org         |
|       6 | www.gnu.org translation teams      | savannah-hackers@gnu.org         |
+---------+------------------------------------+----------------------------------+
5 rows in set (0.00 sec)

For tracker submission in each project:

mysql> select group_id, unix_group_name,
              new_bugs_address, new_patch_address,
              new_support_address, new_task_address,
              new_news_address, new_cookbook_address
       from groups where group_id in ( 5802, 2613, 11318 ) \G

*************************** 1. row ***************************
               group_id: 2613
        unix_group_name: coreutils
       new_bugs_address: jim@xxxxxxxx.yyy, coreutils@gnu.org
      new_patch_address: jim@xxxxxxxx.yyy, bug-coreutils@gnu.org
    new_support_address:
       new_task_address:
       new_news_address: jim@xxxxxxxx.yyy
   new_cookbook_address:
*************************** 2. row ***************************
               group_id: 5802
        unix_group_name: administration
       new_bugs_address:
      new_patch_address:
    new_support_address: savannah-help-public@gnu.org
       new_task_address: savannah-hackers-public@gnu.org
       new_news_address: savannah-users@gnu.org
   new_cookbook_address:
*************************** 3. row ***************************
               group_id: 11318
        unix_group_name: datamash
       new_bugs_address: agn
      new_patch_address: agn
    new_support_address: agn
       new_task_address: agn
       new_news_address: agn
   new_cookbook_address:

PHP Code

Email sending code

The function sendmail_mail in <savane>/frontend/php/include/sendmail.php behaves similarly to PHP's mail and is used to send email from all savane's php files.

It performs the following additional tasks:

  1. user and 'squad' expansion (e.g. if the recipient is agn, find the email associated with savannah user agn).
  2. processes exclude lists (defined in the configuration section for each project's tracker).
  3. adds additional SMTP headers (e.g. X-Apparently-From: with the logged-in user name and IP, X-Savane-Server, X-Savane-Project, etc.).
  4. If the user has configuration a specific SUBJECT line, construct a customized message with the specific subject line and send it to this user. (on the website, click "My Account Conf"->"Edit Personal Notification Settings" then see "Subject line" to set a custom one)
  5. If the global variable $sys_debug_email_override_address is set, emails will be sent to the address specified in it, regardless of the original recipients. This can be used during development, to ensure emails do not spam public mailing lists or unsuspecting users.

FIXME: There's a variable called $int_delayspamcheck which affects sending - is it ever used? It set to true, messages are added to a DB table trackers_spamcheck_queue_notification instead of being sent.

new project registration

FIXME: What's going on??

The file <savane>/frontend/php/include/Group.class contains:

function getTypeAdminEmailAddress()
       { return $this->type_data_array['admin_email_adress']; }

which returns the relevant 'new project' email address for each project type (the project type is selected by the submitter in the html form).

the file <savane>/frontend/php/register2/index.php uses this function to send an email notification about new project registration (note: the /register/ URL is aliased to the /regster2/ directory in the apache configuration)

$type_admin_email_address = $project->getTypeAdminEmailAddress();

But later on this variable is only used as the 'FROM:' field to send a message directly to the user who submitted the new project.

The comment in the code says:

# a mail for the moderators staff!
# Done automatically by the task tracker

And new projects are treated as new tasks (i.e. stored in the tasks tracker) - but Savannah's administration project has an empty value for the news_tasks_address - so how do emails end up in savannah-register-public@gnu.org?

New tracker items

FIXME: these functions are not used anywhere ...

The file <savane>/frontend/php/include/Group.class contains:

function getNewBugAddress() {
  return $this->data_array['new_bug_address'];
}

function getNewSupportAddress() {
  return $this->data_array['new_support_address'];
}

function getNewTaskAddress() {
  return $this->data_array['new_task_address'];
}

function getNewPatchAddress() {
  return $this->data_array['new_patch_address'];
}

FIXME: try git grep _address | grep new_ to find a lead...