public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* query-pr on email based
@ 2002-09-19 15:42 Peter Chiang
  2002-09-20 14:15 ` Hans-Albert Schneider
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Chiang @ 2002-09-19 15:42 UTC (permalink / raw)
  To: help-gnats

is there a way to setup the query-pr email based to limit the supported
domain? for example, only allow people from @yahoo.com to query-pr this
email based feature.




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

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

* Re: query-pr on email based
  2002-09-19 15:42 query-pr on email based Peter Chiang
@ 2002-09-20 14:15 ` Hans-Albert Schneider
  0 siblings, 0 replies; 2+ messages in thread
From: Hans-Albert Schneider @ 2002-09-20 14:15 UTC (permalink / raw)
  To: Peter Chiang; +Cc: help-gnats

Peter Chiang wrote:
> 
> is there a way to setup the query-pr email based to limit the supported
> domain? for example, only allow people from @yahoo.com to query-pr this
> email based feature.

I am not aware of a solution inside GNATS.

I suggest you setup something based on a mail filter.

My favorite mail filter is procmail (http://www.procmail.org),
so I would do somethig like this:

1) Setup a procmailrc file /some/where/filter-query-pr that
   filters the request based on anything you like.
   If it should be allowed, pipe the mail to query-pr.
   If it should be forbidden:
   - either "exit 77" (the exit code expected for "permission denied";
     double check with your /usr/include/sysexits.h) and thus have
     your mail server send a bounce,
   - or generate a reply mail telling the sender that they are
     not allowed access, and how to get permission (if appropriate).

2) Feed the query to
	"|/where/ever/procmail /some/where/filter-query-pr"
   instead of
	"|/where/ever/query-pr ..."



/some/where/filter-query-pr would be something like this:

##################
# Recipe 1: This address should be rejected, though the domain is OK:
:0
* ^From:.*badguy@yahoo.com
* ! ^From:.*notsobadguy@yahoo.com
| exit 77

# Recipe 2: Allow everybody from this domain:
:0
* ^From:.*@yahoo.com
| /where/ever/query-pr ...

# Recipe 3: Reject everything else
:0
| formail -rt; cat /some/where/polite-reject-message

# end of procmail recipes
############

The lines starting with * are conditions; in this relatively
simple example they consist of regular expressions similar to
those used by egrep (see the man pages for details), or negations
thereof (the second condition of recipe 1).

The formail program is part of the procmail package.


Hans-Albert
-- 
Hans-Albert Schneider		<Hans-Albert.Schneider@infineon.com>
Infineon Technologies AG	phone:	(+49) 89 234 45445
Corporate Logic; Verification	fax:	(+49) 89 234 42284
(CL DAT TDM VM)			Munich, Germany


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

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

end of thread, other threads:[~2002-09-20 20:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-19 15:42 query-pr on email based Peter Chiang
2002-09-20 14:15 ` Hans-Albert Schneider

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).