Re: Do shell script question - non sudoer user
Re: Do shell script question - non sudoer user
- Subject: Re: Do shell script question - non sudoer user
- From: Bernardo Hoehl <email@hidden>
- Date: Sun, 23 Jan 2005 09:36:48 -0200
Hi Charlie, Daniel and Emmanuel,
Thanks for posting.
It seems that Daniel's "mail" tip is working Ok as long as administrator privileges are concerned.
But one small problem I notice by using the command "mail" instead of "sendmail -bm":
The email I send out contains a "multipart/alternative" content, and as I get the emails on my tests the whole header and source, text and HTML code, of the email is displayed in the body of the message. The subject comes blank.
It seems that the mail command puts its own header in the source, adding a second header to my email.
Any clues?
I think I will go thru mail's man pages and see if I can figure out the solution, may be "telling" mail to stop putting its own header in the email message.
Thanks!
Bernardo
==============
On 22 Jan, 2005, at 11:47 PM, daniel wrote:
Bernardo - I think the problem you're running into is that non-admin users cannot (by default) use the sudo command to execute with administrator privileges. I doubt AppleScript's "execute as administrator" can do anything to overcome this security measure.
You might ask yourself, if you're willing to give this user a script that contains an administrator password, why not just make them an administrator?
I think Emmanuel's suggestion to try something less "system-level" than sendmail is probably good. If you want to stick with command line tools, why don't you try the "mail" program? You can use it basically the same way you're using sendmail:
do shell script "mail " & theDestinationEmailAddress & " < " & PathToTextFile
Daniel
On Jan 22, 2005, at 12:18 PM, Bernardo Hoehl wrote:
Hi List!
I have a little AS Studio app that sends out HTML enclosed emails.
The app works fine with me, the administrator of my Box. It uses Postfix to send out the emails.
I am trying to port the app to a non administrator user, but get stuck with administrator privileges.
The original line is:
do shell script "sendmail -bm " & theDestinationEmailAdress & " < " & PathToTextFile
It seems that such a command requires administrator privileges a so, it doens't work.
I tried changing it to :
do shell script "sendmail -bm " & theDestinationEmailAdress & " < " & PathToTextFile password ThePassword with administrator privileges
Then I get the usual "think before you type and respect other users privacy" message as a return of the do shell script line, and the script doesn't work.
Any clues to overide the problem?
Thanks,
Bernardo Höhl
Rio de Janeiro - Brazil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden