Authenticated Mail

Posted on
Mon May 19, 2003 9:38 pm
Jeff offline

Authenticated Mail

from the help file:
Indigo also does not currently support connecting to SMTP servers that require authentication. Most personal ISP's do not require SMTP authentication, so we recommend that you use your ISP mail server settings.


My ISP does require authentication... any plans to support it soon?

Posted on
Mon May 19, 2003 10:06 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Authenticated Mail

Jeff wrote:
My ISP does require authentication... any plans to support it soon?

Bummer. Let me investigate what will be involved in adding this. In the mean time, you could use a simple AppleScript to have the OS X Mail program send the mail for you. Something like this should work:

tell application "Mail"
  set bodyvar to "body of message"
  set addrVar to "username@not_a_valid_email_address.com"
  set subjectvar to "Test Message"

  set newMessage to (a reference to (make new outgoing message))
  tell newMessage
    make new to recipient at beginning of to recipients with properties {address:addrVar}
    set the subject to subjectvar
    set the content to bodyvar
  end tell

  send newMessage
end tell

If this will work for you, then I can show you how to create an AppleScript attachment for Indigo that defines the above functionality as a handler, say SendEmail(). Then, from within Indigo you could just select the AppleScript action type and type in something like, "SendEmail("persons_email_address", "subject", "body").

regards,
matt

Posted on
Tue May 20, 2003 10:27 am
neonmarg offline
Posts: 3
Joined: May 20, 2003

mail script

Thanks! That will work fine for me and can be easily adapted to the few items I currently wish to use email for (power failure and startup notification).

I guess the next things I would like to use email for would be things like sending an email and getting back an email showing current status of all devices, or maybe having the most recent event log emailed to me?

Jeff

Posted on
Tue May 20, 2003 7:53 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: mail script

neonmarg wrote:
I guess the next things I would like to use email for would be things like sending an email and getting back an email showing current status of all devices, or maybe having the most recent event log emailed to me?

Using AppleScript you could build up the status of all devices as the body of the email script above. For an example of how to get the status of all the devices, take a look at the sample script shipped with Indigo, "example - list devices.scp". It is located in your user/Documents/Indigo User Date/scripts/ folder.

Emailing the most recent log file, although possible, won't be as simple. It would be easier if I added an AppleScript object that pointed to the currently active log file. I'll see what is involved in adding this.

regards,
matt

Posted on
Wed May 21, 2003 9:02 pm
W1BMW offline
Posts: 6
Joined: May 17, 2003

Re: mail script

Maybe slightly off topic, but does the application write to the house file upon each status change? I'm looking at having Apache/PHP parse the XML for a web based report. I realize too that I can probably answer this for myself, but was wanting to get the idea out for discussion.

/zim

Posted on
Wed May 21, 2003 9:39 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: mail script

W1BMW wrote:
Maybe slightly off topic, but does the application write to the house file upon each status change? I'm looking at having Apache/PHP parse the XML for a web based report. I realize too that I can probably answer this for myself, but was wanting to get the idea out for discussion.

The database file is not automatically saved after device state changes.

The database is saved every 15 minutes after a user (non-state) change to a device/trigger/group setting. The idea being to auto-save every 15 minutes after an important configuration or control logic change, but not to try to auto-save just because a light was turned on.

The entire database (including states) are saved upon application quit.

I'd probably recommend that you write an AppleScript attachment for the following handlers: receive x10 event, receive av event, receive security event. Write a handler that overrides these functions to first call the Indigo handler (via the AppleScript "continue" command), and then enumerate through the devices to pull out the current state.

regards,
matt

Posted on
Sat Feb 28, 2004 10:08 am
bdugan offline

Follow-up question to the authentification question

Matt,

I love the software so far. one simple question though: I'm trying to use Mail to send notices back when I'm not at home, but my provider requires authentification for outgoing messages. Am I missing something, or is there still no support for this in the current build?

I compiled the AppleScript you mentioned above and ran it with no problems; how would I run it with Indigo?

(OS 10.2.8, 333mhz iMac)

Posted on
Sat Feb 28, 2004 10:42 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Follow-up question to the authentification question

Correct, there still is no support for authenticated SMTP servers.

Use an "Execute Applescript" Action type (last panel of either a Trigger or Time/Date Action). You can either point to the file you already created, or you can copy & paste the script source into the edit field and choose the Embedded radio button.

Regards,
Matt

Posted on
Sat Feb 28, 2004 1:40 pm
gregjsmith offline
Posts: 946
Joined: Apr 01, 2003
Location: Rio Rancho, NM

(No subject)

Based on your script I tried the following attachement:

--[url=applescript://com.apple.scripteditor/?action=new&script=using%20terms%20from%20application%20%22Indigo%22%0A%09on%20Send_Email(bodyvar,%20addrVar,%20subjectvar)%0A%09%09try%0A%09%09%09tell%20application%20%22Mail%22%0A%09%09%09%09set%20newMessage%20to%20(a%20reference%20to%20(make%20new%20outgoing%20message))%0A%09%09%09%09tell%20newMessage%0A%09%09%09%09%09make%20new%20to%20recipient%20at%20beginning%20of%20to%20recipients%20with%20properties%20%7Baddress%3AaddrVar%7D%0A%09%09%09%09%09set%20the%20subject%20to%20subjectvar%0A%09%09%09%09%09set%20the%20content%20to%20bodyvar%0A%09%09%09%09end%20tell%0A%09%09%09%09%0A%09%09%09%09send%20newMessage%0A%09%09%09end%20tell%0A%09%09end%20try%0A%09end%20Send_Email%0Aend%20using%20terms%20from%0A]Click here to open this script in a new Script Editor window[/url].

using terms from application "Indigo"
     on Send_Email(bodyvar, addrVar, subjectvar)
          try
               tell application "Mail"
                    set newMessage to (a reference to (make new outgoing message))
                    tell newMessage
                         make new to recipient at beginning of to recipients with properties {address:addrVar}
                         set the subject to subjectvar
                         set the content to bodyvar
                    end tell
                    
                    send newMessage
               end tell
          end try
     end Send_Email
end using terms from


But Indigo gives errors. What do I need to change?

edit: Works fine, I left out a quote in my test message. the test message.

Posted on
Sat Jul 17, 2004 11:08 am
roba offline
Posts: 3
Joined: Jul 17, 2004

question about power restore

This thread has been very helpful - have email all set up for a power failure. Does anyone know how to trigger an email when poer is restored? The log produces a message:

Power Failure interface power back online

But, I could not find a variable to use to trigger an email.

thanks

roba

Posted on
Sat Jul 17, 2004 11:28 am
gregjsmith offline
Posts: 946
Joined: Apr 01, 2003
Location: Rio Rancho, NM

Re: question about power restore

roba wrote:
Does anyone know how to trigger an email when poer is restored?


Indigo only has a trigger for a power failure not a power restored. I made that feature request in some other thread somewhere for this capability. I'm sure Matt is overwhelmed with my FRs by now :oops:

Posted on
Sat Jul 17, 2004 11:46 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: question about power restore

There is not currently a way to define a trigger for this, but this has been requested and is something I will look into.

Regards,
Mat

Posted on
Mon Jul 19, 2004 11:40 am
pwarwick offline
Posts: 206
Joined: Jul 16, 2004
Location: Ontario, Canada

My ISP also requires authentication

I have tried Greg's script but although I get a message in the Event log that the Trigger Action has occurred, the script does not appear to get invoked. Nothing else appears in the log. I'm far from an AppleScript expert ... but if there is a simple way to troubleshoot the script I would appreciate it. I have tried it both embedded and as a file without any difference.

Patricia

Posted on
Mon Jul 19, 2004 12:16 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: My ISP also requires authentication

Try putting lines like this throughout the script:

tell app "Indigo" to log "got this far1"

changing the "far1" to "far2", "far3", etc., for each new line you add. Now you will be able to tell how far into the script you have gotten. You can also copy and pase the entire script into the Script Editor and manually run it there. Remove the "on Send_Email" line (and the end Send_Email line), and replace it with these lines:

set addrVar to "email_address@something.com"
set bodybar to "test body of the email"
set subjectvar to "test subject"

Regards,
Matt

Posted on
Mon Jul 19, 2004 6:45 pm
pwarwick offline
Posts: 206
Joined: Jul 16, 2004
Location: Ontario, Canada

My ISP also requires authentication

Thanks Matt,

I was able to get it working with your assistance. Part of my problem was in identifying that I had to invoke the script with Send_Email and not use the name of the script (which I had named sendmail.) See how basic my knowledge is. The "on Send_Email" command was failing.

Patricia

Who is online

Users browsing this forum: No registered users and 8 guests