help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: query-pr on email based


From: Hans-Albert Schneider
Subject: Re: query-pr on email based
Date: Fri, 20 Sep 2002 12:44:29 +0200

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:address@hidden
* ! ^From:address@hidden
| exit 77

# Recipe 2: Allow everybody from this domain:
:0
* ^From:address@hidden
| /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           <address@hidden>
Infineon Technologies AG        phone:  (+49) 89 234 45445
Corporate Logic; Verification   fax:    (+49) 89 234 42284
(CL DAT TDM VM)                 Munich, Germany




reply via email to

[Prev in Thread] Current Thread [Next in Thread]