From owner-freebsd-questions@FreeBSD.ORG Sat Aug 4 18:17:36 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 718F816A417; Sat, 4 Aug 2007 18:17:36 +0000 (UTC) (envelope-from don.hinton@vanderbilt.edu) Received: from mailgate03.smtp.vanderbilt.edu (mailgate03.smtp.Vanderbilt.Edu [129.59.1.73]) by mx1.freebsd.org (Postfix) with ESMTP id 2B58613C483; Sat, 4 Aug 2007 18:17:36 +0000 (UTC) (envelope-from don.hinton@vanderbilt.edu) Received: from smtp09.smtp.vanderbilt.edu (smtp09.smtp.Vanderbilt.Edu [129.59.1.239]) by mailgate03.smtp.vanderbilt.edu (8.13.8/8.13.8) with ESMTP id l74IHX22003796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 4 Aug 2007 13:17:33 -0500 Received: from smtp09.smtp.vanderbilt.edu (localhost [127.0.0.1]) by smtp09.smtp.vanderbilt.edu (8.12.11/8.12.11/VU-3.7.9C+d3.7.9) with ESMTP id l74IHXce023566; Sat, 4 Aug 2007 13:17:33 -0500 (CDT) Received: from [192.168.0.3] (c-69-245-3-33.hsd1.tn.comcast.net [69.245.3.33]) by smtp09.smtp.vanderbilt.edu (8.12.11/8.12.11/VU-3.7.9.3B+d3.7.9) with ESMTP id l74IHKs0023551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Aug 2007 13:17:25 -0500 (CDT) From: Don Hinton Organization: ISIS To: freebsd-questions@freebsd.org Date: Sat, 4 Aug 2007 13:17:10 -0500 User-Agent: KMail/1.9.7 References: <20070804190634.69234e1e@gumby.homeunix.com.> In-Reply-To: <20070804190634.69234e1e@gumby.homeunix.com.> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708041317.10675.don.hinton@vanderbilt.edu> X-Proofpoint-Virus-Version: vendor=fsecure engine=4.65.5502:2.3.11, 1.2.37, 4.0.164 definitions=2007-08-03_06:2007-07-30, 2007-08-03, 2007-08-03 signatures=0 X-PPS: No, score=0 Cc: RW , 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:17:36 -0000 On Saturday 04 August 2007 13:06:34 RW wrote: > 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. It checks argv[0], i.e., the name used to invoke it. Here's a simple program demostrating it: #include int main (int argc, char* argv[]) { std::cout << "my name is: " << argv[0] << std::endl; return 0; } Save it to a file and do the following: $ c++ -o foo file.cxx $ ./foo my name is: ./foo $ mv foo bar $ ./bar my name is: ./bar hth... don > > I'm just curious. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" -- Don Hinton or Institute for Software Integrated Systems (ISIS), Vanderbilt University tel: 615.480.5667 or 615.870.9728