From owner-freebsd-questions@FreeBSD.ORG Fri Aug 31 17:01:19 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7861816A4C5 for ; Fri, 31 Aug 2007 17:01:19 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.freebsd.org (Postfix) with ESMTP id A25F113C4A6 for ; Fri, 31 Aug 2007 17:01:18 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay11.apple.com (relay11.apple.com [17.128.113.48]) by mail-out4.apple.com (Postfix) with ESMTP id D055910519A4; Fri, 31 Aug 2007 10:00:19 -0700 (PDT) Received: from relay11.apple.com (unknown [127.0.0.1]) by relay11.apple.com (Symantec Mail Security) with ESMTP id B87BB2804E; Fri, 31 Aug 2007 10:00:19 -0700 (PDT) X-AuditID: 11807130-a81a3bb000006012-86-46d84923b41d Received: from [17.214.13.96] (cswiger1.apple.com [17.214.13.96]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay11.apple.com (Symantec Mail Security) with ESMTP id 9B6F028057; Fri, 31 Aug 2007 10:00:19 -0700 (PDT) In-Reply-To: <169381.93008.qm@web58104.mail.re3.yahoo.com> References: <169381.93008.qm@web58104.mail.re3.yahoo.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Chuck Swiger Date: Fri, 31 Aug 2007 10:00:18 -0700 To: L Goodwin X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== Cc: FreeBSD-Questions List Subject: Re: Configuring FreeBSD 6.2 to use sendmail for sending only 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: Fri, 31 Aug 2007 17:01:19 -0000 On Aug 30, 2007, at 6:14 PM, L Goodwin wrote: [ ... ] > Should I be calling "mail" or "sendmail", and which > mail or sendmail should I invoke if there is more than > one of either? Chuck's example calls sendmail in a > path that does not exist on my system (my sendmail is > in /usr/sbin/). I usually invoke whichever one is > first in my path. As others have said, there is more than one way to do the same task, but you asked to run sendmail in particular, rather than something else. The path I used was that to the actual sendmail binary, rather than the /usr/sbin wrapper which (on the particular machine I used, anyway) would invoke Postfix instead. You can find more details from "man mailwrapper". > One more question. Is it ok to run the script (and > send the email) as user root, or should I create a > user account with more limited permissions -- if so, > what limits should I set? The simple answer is that you should try not to run things as root when you can do them as a normal user. If you wish the email to contain arbitrary envelope from-addresses, be aware that only root can do so without a warning message unless you use this FEATURE (see / usr/share/sendmail/cf/README): > use_ct_file Read the file /etc/mail/trusted-users file to get the > names of users that will be ``trusted'', that is, > able to > set their envelope from address using -f without > generating > a warning message. The actual filename can be > overridden > by redefining confCT_FILE. Someone else has already provided another example of a controlled access email script which checks for the right UID. -- -Chuck