On Wed, Oct 06, 1999 at 08:53:57PM +0100, Marek Narkiewicz wrote:
> I've just set up a web based mail forwarding for users.  My question is, how do I 
>guard 
> agianst idiots setting up a forwarding loop? eg [EMAIL PROTECTED] forwards to [EMAIL PROTECTED] 
> which forwrds to [EMAIL PROTECTED]?

You can't.
Same as you can't for users that can create their own .qmail files.
However qmail will reject messages as soon as it would add an identical
Delivered-To: line.

For your local system you could create a database with all known local
addresses and whether they deliver to mailboxes and/or forwards and then
construct a transitive graph (is this the name in english?) and deny
forwards if it would result in a loop.

[
    if you have deliveries
          a  ->  b
          b  ->  c
          c  ->  d
    the graph would know that
          a  ->  c
          a  ->  d
          b  ->  d
    This is known to me as "Warshall algorithm", the compexity is n**3
    where n is the number of addresses. This is, however, overhead for
    your problem so it is easier to follow the nodes linear, node by node.
]

However that does not prevent loops with remote users that you don't
know about, so it's probably better to rely on qmail (and the users
complaining that they don't receive emails any longer ;-).

        \Maex

-- 
SpaceNet GmbH             |   http://www.Space.Net/   | Yeah, yo mama dresses
Research & Development    | mailto:[EMAIL PROTECTED] | you funny and you need
Joseph-Dollinger-Bogen 14 |  Tel: +49 (89) 32356-0    | a mouse to delete files
D-80807 Muenchen          |  Fax: +49 (89) 32356-299  |

Reply via email to