procmail
[Top] [All Lists]

Re: Host lookups

2008-11-28 08:42:33
On Fri, 28 Nov 2008, Dallman Ross wrote:

On Fri, Nov 28, 2008 at 02:14:38AM -0500, Fleet Teachout wrote:

I'm trying to use procmail to do the host lookup so I
can see the "Remote Name."  So far I have:
I already know it will be empty as to XXX.  You are using wrong
syntax.  Suggest you do a quick review of the man page.


 |      Starts the specified program, possibly in $SHELL if any  of  the
        characters  $SHELLMETAS are spotted.  You can optionally prepend
        this pipe symbol with variable=, which will cause stdout of  the
        program  to  be  captured  in the environment variable (procmail
        will not terminate processing the rcfile at this point).

Try

   XXX=| host "$MATCH" | cut -d' ' -f5

And you would not need the c-flag at the start of the recipe.

Hmmmm. I read that; wasn't sure how to go about it. And I couldn't find anything like what I wanted in 'man procmailex.'

Thanks.

However, there is a serious bug in many procmail binaries making
the above syntax unsafe.  Random memory will be eaten unless you
have applied a patch.  So the alternative below is recommended:

Thanks for the heads up.

 :0
 * conditions
 { XXX = `shell command` }

(You don't need the c-flag there, either.  Nested brace sets
are not delivering recipes, and the assignment therein is also
not a delivering action.)

I believe the latter is what you were attempting all along anyway.

I believe it is.

By the way, can't you just turn on the reverse-lookup feature in
your SMTP host's setup?

I don't know. I get my mail through my leased server; so I don't think my SMTP host really sees it until after the fact (during mail downloads).

Thank you Dallman!  I'll play with the above.

                                - fleet -
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>