[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: redirecting a quad in crossbar.cf



> 
> I would like to try and do the following:
> 
> In crossbar.cf, if I see an address on the smtp channel going to
> x@y, then I would like to redirect the address to the local channel for
> user x. I cannot do this in the alias function because I only want this
> to happen for 'to' addresses and not 'from'. I have already been able
> to figure all this out except that when we attempt to deliver I get
> a permissions problem of not being able to have mailbox deliver
> to a file or pipe. It would seem there are some attributes to an address
> that I do not understand how to change in order to make this happen.
> 
> If anyone can give me some pointers I would be grateful.

	It is about recipient address priviledges.
	A message coming in from SMTP-port has priviledges
	which effectively say:  "NO FILE/PIPE WRITES!"
	When a local recipient address is expanded so that
	it gives a pipe/file as a result, the recipient
	address gets new priviledges from that expansion.

	When the crossbar returns, the "$to" must have its
	attributes revised so that "priviledge" attribute
	is changed to be something that can write to desired
	pipe.

	Per default intercepting  x@y  to   x@local  and
	then running as if it is a normal user SHOULD work.

	Are you sure that local user does not have bugs in
	his/her configuration ?  Directory ownership/priviledges
	ok ?  .forward ownership/priviledges ok ?

	You can detect 'sender' addresses anywhere in the processing
	by testing "type" attribute, like this in  aliases.cf:

	# Usage: routeuser (channel host user attributes)
	#
	# This is where local alias expansion is controlled.

	routeuser (quad) {
		local user host lcuser mxh al a l key attr pobox ...

		attr=$(attributes $quad)
		case "$(get $attr type)" in
		sender)	return (($quad)) ;;
		esac
	...

	What that does is effectively doing alias expansions ONLY
	for recipient addresses.

	Anyway, the address intercepting at the crossbar requires that
	one does type="recipient" routeing for the addresses when doing
	their processing at the crossbar.

	Actually I think this is best done with GLOBAL aliases that
	take into account also the domain part.  (And are applied
	only for  attribute:type=recipient  messages.)

> thanks.
> 
> /mrg

	/Matti Aarnio <mea@nic.funet.fi>

PS:	I am trying to get the DSN (Delivery Status Notification) facility
	running.  We will see what interesting things will come up :)