From owner-freebsd-questions@FreeBSD.ORG Sat Aug 4 18:23:09 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA5416A41A for ; Sat, 4 Aug 2007 18:23:09 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id E0FB913C4B4 for ; Sat, 4 Aug 2007 18:23:08 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.1/8.14.1) id l74IN77I074331; Sat, 4 Aug 2007 13:23:07 -0500 (CDT) (envelope-from dan) Date: Sat, 4 Aug 2007 13:23:07 -0500 From: Dan Nelson To: RW Message-ID: <20070804182307.GD77822@dan.emsphone.com> References: <20070804190634.69234e1e@gumby.homeunix.com.> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070804190634.69234e1e@gumby.homeunix.com.> X-OS: FreeBSD 7.0-CURRENT User-Agent: Mutt/1.5.16 (2007-06-09) Cc: questions@freebsd.org Subject: Re: How does Sendmail know how it was invoked? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2007 18:23:09 -0000 In the last episode (Aug 04), RW said: > mailwrapper checks to see how it was invoked and then looks up the > appropriate command in mailer.conf. All of the entries in > mailer.conf point to /usr/libexec/sendmail/sendmail, so how does that > binary know what it's supposed to do. The kernel passes the executable name to the running process along with the rest of the commandline arguments. If you run "ls -l /tmp", for example, the ls binary gets "ls", "-l", and "/tmp" as its arguments. See around line 360 of src/contrib/sendmail/src/main.c. http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/sendmail/src/main.c?annotate=HEAD -- Dan Nelson dnelson@allantgroup.com