yaobinshi / test1

test for scratch
MIT License
0 stars 0 forks source link

Enhance email notification to allow customization via fossology.conf #138

Open yaobinshi opened 9 years ago

yaobinshi commented 9 years ago

Author Name: Mary Laser Original Redmine Issue: 21, http://www.fossology.org/issues/21 Original Date: 2012/02/06 Original Assignee: Mark Donohoe


Today on IRC we were discussing how to make job notifications more useful and flexible. Here is what we came up with. Consider this a draft and is open to discussion. Comments are welcome.

1) To make the notifications more customizable, add three variables and a new section to fossology.conf:

[EMAILNOTIFY]
header=myheaderfile
footer=myfooterfile
subject=mysubject

When a job completes, the scheduler will send a plain text email notification (if turned on in the user record) to the user. The email will have the subject "mysubject", which by default is "FOSSology scan complete". The scheduler will write into the email: a) the contents of the file myheaderfile b) any agent messages c) the contents of the file myfooterfile

Our default fossology.conf would look like:

[EMAILNOTIFY] header=emailheader.txt footer=emailfooter.txt subject=FOSSology scan complete

Files are located in $SYSCONFDIR.

The contents of emailheader.txt could be:

Your FOSSology scan for $DB.upload.upload_filename has $JOBRESULT.

The contents of emailfooter.txt could be:

Complete job information can be found at $JOBQUEUELINK.

2) the header and footer files can contain variables that will be substituted by the scheduler. Possible variables are:

$BROWSELINK browse link to upload $JOBQUEUELINK link to job queue details (showjob) $JOBRESULT is "completed successfully" or "failed" $SCHEDULERLOG link to scheduler log $UPLOADFOLDERNAME name of upload folder $DB.tablename.columnname this only applies to certain tables (upload, user, job tables)

3) Agents can add messages to the email notification with a new function call (or macro) NOTIFY_EMAIL(message). It would be good if some agents added a link to the notification with direct links to their results. This applies to nomos, buckets, copyright, and the license list (new) agent.

comments?

Bob Gobeille

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Mary Laser Original Date: 2011/11/15 00:31:17 +0000


Add email notification changes to FO 2.0 and reassign task to Alex

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Mary Laser Original Date: 2011/12/19 23:55:55 +0000


alex: 85% done

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Alex Norton Original Date: 2012/01/13 21:38:53 +0000


finished, just needs testing

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Mary Laser Original Date: 2012/01/19 16:53:12 +0000


Resulting email on fluffy (shown below) does not include hostname in the URL. This should be fixed, but I'm going to reduce the priority since this is a relatively minor issue.

Return-Path: fossy@fluffy.ostt X-Original-To: fossy@fluffy.ostt Delivered-To: fossy@fluffy.ostt Received: by fluffy.ostt (Postfix, from userid 112) id 253043F4025; Fri, 13 Jan 2012 14:51:17 -0700 (MST) To: fossy@fluffy.ostt X-Mailer: mail (GNU Mailutils 2.1) Message-Id: 20120113215118.253043F4025@fluffy.ostt Date: Fri, 13 Jan 2012 14:51:17 -0700 (MST) From: fossy@fluffy.ostt (fossology)

FOSSology scan complete FOSSology scan has completed.

http://?mod=showjobs&show=job&job=81 http://?mod=browse&upload=81&show=detail http://?mod=browse&upload=81&show=detail http://?mod=browse&upload=81&show=detail http://?mod=browse&upload=81&show=detail

FOSSology

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Alex Norton Original Date: 2012/01/23 17:01:49 +0000


Should be fixed with svn 5415

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Mary Laser Original Date: 2012/02/10 17:37:04 +0000


Hi Mark, can you add verification of this functionality to your email notification testing, please? thanks.

yaobinshi commented 9 years ago

Original Redmine Comment Author Name: Anonymous Original Date: 2012/03/26 15:24:57 +0000


spam post deleted