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

Re: user@[my.ip.add.ress]



> The problem isn't where the mail *originates*, though, but to whom
> the mail is addressed (ie. the recipient). When Zmailer attempts to
> deliver mail coming from outside which is addressed to user@[...]
> (where ... is its own ip address), rrouter.cf still returns an smtp
> target, and ends up bouncing the mail because it tries to deliver
> to itself.

	Didn't I mention ?  I did my tests at  [130.232.1.11], which
	system detected it to be local.

> > -------------  $MAILSHARE/cf/rrouter.cf --------------
> > .....
> > 	(.*)<@\[(.)\]>(.*)
> > 		# numeric internet spec
> > 		if [ $(deliver "[\2]") ]; then
> > 			address="\1<@>\3"
> > 		else
> > 			return (((smtp "[\2]" "\1@$(gethostbyaddr \2)\3" $A)))
> > 		fi
> > 		;;
> > .....
> > ------------------------------------------------------
> 
> Actually, the fix I applied is simpler than that, and does not require
> fiddling with $MAILSHARE/db/localnames. I simple changed the line
> which read:
> 
>            return (((smtp "[\2]" "\1@$(gethostbyaddr \2)\3" $A))) ;;
> to read:
>            address = "\1<@$(gethostbyaddr \2)\3" ;;
> 
> Mail which resolves to a local address seems to then get local, and
> remote ip addresses get the correct target also.

	What, if  gethostbyaddr()  fails ??

> Is there some other side-effect of doing this that I've missed? When
> I first applied it, I tested it quite extensively since I'm naturally
> suspicious of such a simple fix. :-)

	The rare case when you want to use ``local@[1.2.3.4]'' address
	in the first place, is when you want explicitely tell, where
	the SMTP connection should be made  (for whatever reasons you
	have), there you do not want it to figure hostname, and possibly
	start using MXes to point email to (possibly faulty) gateway,
	for example.

...
> --
> David Nugent: davidn@blaze.net.au, davidn@unique.blaze.net.au
> Unix/Linux/DOS/Win/Os2 Microsystem Technical Support [FOR HIRE!]
> http://www.blaze.net.au/~davidn

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