public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* how to include database name in mails
@ 2005-04-18 13:12 Lan Yufeng
  2005-04-18 18:31 ` Chad Walstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Lan Yufeng @ 2005-04-18 13:12 UTC (permalink / raw)
  To: Help-gnats

Hi, is there any way to send notification mail with database name set
dynamically, such as:
Subject: FooProduct cat1/pr#123
* FooProduct is the database name.

Because we gonna have a lot of databases, manually modify dbconfig for each
database is time consuming.

help! Suggestion on soucecode hacking are welcome too.


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to include database name in mails
  2005-04-18 13:12 how to include database name in mails Lan Yufeng
@ 2005-04-18 18:31 ` Chad Walstrom
  2005-04-19  1:14   ` Lan Yufeng
  0 siblings, 1 reply; 3+ messages in thread
From: Chad Walstrom @ 2005-04-18 18:31 UTC (permalink / raw)
  To: help-gnats


[-- Attachment #1.1: Type: text/plain, Size: 1400 bytes --]

On Mon, Apr 18, 2005 at 09:06:45PM +0800, Lan Yufeng wrote:
> Hi, is there any way to send notification mail with database name
> set dynamically, such as:
> Subject: FooProduct cat1/pr#123
> * FooProduct is the database name.
> 
> Because we gonna have a lot of databases, manually modify dbconfig
> for each database is time consuming.
> 
> help! Suggestion on soucecode hacking are welcome too.

My first suggestion is to use a separate email for each database.  It
is relatively easy to tell your email server to pipe to  "queue-pr
--database DATABASE".  You could probably generate a quick sed script
to walk over the dbconfig files and insert the appropriate address.

I personally email addresses named after the database in some way.
For example, bug-DATABASE@bugs.domain.tld.  I then use procmail to
match the "To:" and "Cc:" headers for the database name and pipe it to
the appropriate queue-pr command:

# One recipe to rule them all...
MATCH=
:0:
* ^(To|Cc): bug-\/[_-a-zA-Z0-9]+
{
	DB=$MATCH
	:0 w
	| queue-pr --database=${DB}

	:0 e
	failed-queue/${DB}/.
}

# Or you can have separate recipes for each database
:0 w
* ^(To|Cc): PRODUCT@bug.domain.tld
| queue-pr --database=PRODUCT

:0 e
failed-queue/PRODUCT/.

-- 
Chad Walstrom <chewie@wookimus.net>           http://www.wookimus.net/
           assert(expired(knowledge)); /* core dump */

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to include database name in mails
  2005-04-18 18:31 ` Chad Walstrom
@ 2005-04-19  1:14   ` Lan Yufeng
  0 siblings, 0 replies; 3+ messages in thread
From: Lan Yufeng @ 2005-04-19  1:14 UTC (permalink / raw)
  To: help-gnats

Hi, Chad.
Since most our users submit bugs using the web interface, the procmail
and queue-pr magic can only be played when user choose to reply gnats
system emails. That's cool, but first, I just want to make it clear to
the mail recipents what product database the problem report belongs
to. (I understand that  user could figure it out from the "From"
address as you suggestted)
 
As you mentioned using sed script, maybe I should write a shell script
wrapping "mkdb" command, so that it will insert appropriate database
name to the mail config sections  of file "dbconfig ".

Thank you very much for your tips,

2005/4/19, Chad Walstrom <chewie@wookimus.net>:
> On Mon, Apr 18, 2005 at 09:06:45PM +0800, Lan Yufeng wrote:
> > Hi, is there any way to send notification mail with database name
> > set dynamically, such as:
> > Subject: FooProduct cat1/pr#123
> > * FooProduct is the database name.
> >
> > Because we gonna have a lot of databases, manually modify dbconfig
> > for each database is time consuming.
> >
> > help! Suggestion on soucecode hacking are welcome too.
> 
> My first suggestion is to use a separate email for each database.  It
> is relatively easy to tell your email server to pipe to  "queue-pr
> --database DATABASE".  You could probably generate a quick sed script
> to walk over the dbconfig files and insert the appropriate address.
> 
> I personally email addresses named after the database in some way.
> For example, bug-DATABASE@bugs.domain.tld.  I then use procmail to
> match the "To:" and "Cc:" headers for the database name and pipe it to
> the appropriate queue-pr command:
> 
> # One recipe to rule them all...
> MATCH=
> :0:
> * ^(To|Cc): bug-\/[_-a-zA-Z0-9]+
> {
>         DB=$MATCH
>         :0 w
>         | queue-pr --database=${DB}
> 
>         :0 e
>         failed-queue/${DB}/.
> }
> 
> # Or you can have separate recipes for each database
> :0 w
> * ^(To|Cc): PRODUCT@bug.domain.tld
> | queue-pr --database=PRODUCT
> 
> :0 e
> failed-queue/PRODUCT/.
> 
> --
> Chad Walstrom <chewie@wookimus.net>           http://www.wookimus.net/
>            assert(expired(knowledge)); /* core dump */
> 
> 
> _______________________________________________
> Help-gnats mailing list
> Help-gnats@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnats
> 
> 
> 
>


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-04-19  1:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-18 13:12 how to include database name in mails Lan Yufeng
2005-04-18 18:31 ` Chad Walstrom
2005-04-19  1:14   ` Lan Yufeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).