Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Create Mail account by AppleScript -> Authentication problem

Hi everyone,

For two day, I try to create a new email account in Apple Mail by using Apple Script. Actually, my script works fine except for the declaration of SMTP informations.

To my side, my SMTP server requires *authentication by password*.





----- CODE -----
tell application "Mail"
(* First, the IMAP account. Works flawlessly *)
try
set newacct to make new imap account with properties {name:"MailboxName", user name:"xxx@mycompany.com", password:"", uses ssl:true, server name:"xxx.mycompany.com", port:xxx, full name:"<Sender User Name>", email addresses:{"xxx@mycompany.com"}}

(* Next, we create a new SMTP server in the list. *)
set addsmtp to make new smtp server with properties {server name:"xxx.mycompany.com", user name:"xxx@mycompany.com", uses ssl:true, authentication:password, password:""}

(* End then, we attach the SMTP server to the new IMAP account. *)
set smtp server of newacct to addsmtp
end try
end tell
----- END CODE -----





When I launch this script, Mail starts, the IMAP account is created just like the SMTP server. BUT when I check it (MailboxName > right click > Modify "MailboxName" > Sending server (SMTP) > modify the SMTP server list > advanced) there is *<Do not localize>* message instead of the SMTP scrolling list.
When I restart AppleMail, there is the list but only with " xxx.mycompany.com" instead of " xxx.mycompany.com:xxx@mycompany.com".
I check the advanced properties of the new SMTP server and Authentication parameter is set to "None".

*I've tried "authentication:md5", it works !*

Does anyone have an idea ?
If you need further information, please let me know.

Regards,

Florent.


ps : I haven't found AppleScript forum. Sorry if this post is not in the right place 🙂

Macbook Pro 15", Mac OS X (10.6.2)

Posted on Feb 4, 2010 3:24 AM

Reply
14 replies

Feb 10, 2010 1:41 PM in response to V.K.

Your last message have been posted after the topic moved 🙂

After I'm logged on https://bugreport.apple.com, there is this message in red :

*You do not have access to the Apple Bug Reporter (aka RadarWeb).*
*Please contact the IS&T HelpLine.*


What's wrong ?

Whatever, I would appreciate if anybody have the answer to my issue...
I did some research on this board and apparently nobody report this bug (?) before.

No AppleScript expert around here ?


Thanks in advance !

< Edited by Host >

Feb 9, 2010 11:16 AM in response to ATomik | Florent

Did you ever figure this out? I know its only been five days.

This is AWESOME!!!!!

Me being lazy and not wanting to go to the other office to setup an email account on the computer. I thought maybe I could do this with automator or applescript. I couldn't do it with automator or applescript and then googled and found this.

I am going to use this for every new account I setup.

Aug 19, 2010 9:35 AM in response to ATomik | Florent

Nothing new guys ?

I've received a mail from Darin Marshall inviting me to subscribe to ADC.

Is it a joke ?

Seriously, I will not pay $99 (I'm engineer student) to get an answer like "Yeah, its a bug from Apple Mail, sry...". I'm almost sure that it is a bug and the only stuff that I request is a confirmation.

Of course I'll wait for the next version of Apple Mail and then try again my script 🙂

I had almost forgot, he invited me to go there http://bugreport.apple.com/ whereas I still have an error message :

*You do not have access to the Apple Bug Reporter (aka RadarWeb).*




So, what would I do now ?

A billion thanks 🙂

<Edited by Host>

Feb 16, 2010 3:42 AM in response to boddarma

Hi boddarma,

I've no solution at the moment and I still believe there isn't, because it's a bug from Apple Mail. On this point, a confirmation by an expert/developer would be appreciated.
To bypass this, I've no choice, I use MD5 instead of password method.

Like you, I spent hours by reading tons of technical articles and I didn't find anything.

Maybe you could try to report the bug to Apple by this link : http://bugreport.apple.com/

The website bug for me (I stil have no reply about this).

Mar 4, 2010 6:29 AM in response to ATomik | Florent

Hi ATomik,

Not sure whether you've sought a workaround? If you haven't, try this - works for me:-

Change Element: authentication:password of Record: "newacct" to: authentication:"".
In other words, change the data type from property to Empty String - invokes 1st value in prop: "authentication"'s list (of values). Note: this also works: authentication:"password" - really just
synonym for former.

As regards, to this being a bug, I think you're right to a degree, conflated with poorly written (dic) documentation, for which AS is nortorious. Further, it'd would appear that prop:"password" is conflicting with value: "password" of prop: "authentication". Thus, it's my contention that this is why
when setting authentication to kerberos[4-5]|md5|none, they all work as expected.

Hope this helps.

Regards

Mar 6, 2010 12:38 PM in response to ATomik | Florent

I can verify Darin Marshall is a very responsive Apple employee that works on bug reports.

I don't know why the bugreport website doesn't work for you. It works great for me. It does require a valid Apple ID (like what you use to purchase stuff from iTunes or App Store) but I don't even think it requires you being a registered Apple developer.

http://bugreport.apple.com/ works great for me and Darin Marshall is a real person. Sorry I can't offer more help then that.

Mar 10, 2010 6:40 AM in response to ATomik | Florent

Hello Aric Friesen, hello ssh2,

first of all, thank you for replying on this thread 🙂



_I'll start with SSH2 :_
I've tried to change the property of IMAP account directly (while the creation) AND overloading it after declaration and it still not works.

Maybe this image is friendlier than text ^^

User uploaded file

Of course, I also tried to put double-quote on ‘password‘, nothing changes.
Same if I remove ‘authentication:""‘ from SMTP creation and declare it after.
As you probably get, my English is not perfect so I may have misunderstood your post 🙂 If you can post the code of your solution, that could be clearer for me.


_Now *Aric Friesen* :_
Indeed Mr Marshall seems to be an implicated and professional person. I haven't reply to his last mail because I was a bit upset. I'm very sorry about that, I apologize, sincerely.

In his last mail, he indicate me the process to sign up ADC for free and then the authentication web page worked. There is no "problem" anymore about that (well, there was never a problem in fact... shame on me !).

I'm going to wait for ssh2 reply before getting in bug reporting (and, at same time, thank Darin for his precious help !).


regards

Florent.

ps : Don't paid attention to "<SMTP Server Address>" in IMAP account creation, on the pic. It's a copy/paste mistake.

Create Mail account by AppleScript -> Authentication problem

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.