Auto-provisioning POP3 or Exchange mail via UC Mini how-to.

Search This thread

CRCinAU

Senior Member
Oct 29, 2007
1,182
43
Melbourne
www.crc.id.au
As you all know, a lot of new ROMs (including mine) are shipping with UC support built in.

Now for a while, I've been pondering how I could use UC to auto-create my email account on each flash - to easily setup my testing. Ponder no more.

In the SDConfig.txt file, you need to have an entry to the XML file we create later on. This will be a line like:

Code:
XML: \Storage Card\Setup\Email.xml

Within this Email.xml file, we want to setup the user account. For exchange, we use the following:
Code:
<wap-provisioningdoc>
   <characteristic type="Sync">
        <characteristic type="Settings">
        <parm name="SyncWhenRoaming" value="1"/>
        </characteristic>
        <characteristic type="Connection">
            <parm name="Domain" value="mydomain"/>
            <parm name="Password" value="mypassword"/>
            <parm name="SavePassword" value="1"/>
            <parm name="Server" value="my.exchange.server.com"/>
            <parm name="User" value="My Name"/>
            <parm name="URI" value="Microsoft-Server-ActiveSync"/>
        <parm name="UseSSL" value="1"/>
        </characteristic>
        <characteristic type="Mail">
            <parm name="Enabled" value="1"/>
        <parm name="EmailAgeFilter" value="3"/>
        </characteristic>
        <characteristic type="Calendar">
            <parm name="Enabled" value="1"/>
        <parm name="CalendarAgeFilter" value="5"/>
        </characteristic>
        <characteristic type="Contacts">
            <parm name="Enabled" value="1"/>
        </characteristic>
   </characteristic>
</wap-provisioningdoc>

After replacing the required details, this should setup all that is required for Outlook Mobile to query your Exchange server.

Ah you say, but my mail account is POP3. Ah ha I reply, you'll need to use the following code in Email.xml.
Code:
<wap-provisioningdoc>
   <characteristic type="EMAIL2"> 
     <characteristic type="{4FE84006-9E8A-4158-864D-A2E1E98C3786}">
        <parm name="SERVICENAME" value="My Account Mail" /> 
        <parm name="SERVICETYPE" value="POP3" />
        <parm name="INSERVER" value="pop.server.com" />
        <parm name="OUTSERVER" value="smtp.server.com" />
        <parm name="AUTHNAME" value="myusername" /> 
        <parm name="AUTHSECRET" value="mypassword" /> 
        <parm name="DOMAIN" value="" /> 
        <parm name="REPLYADDR" value="myusername@domain.com" />
        <parm name="NAME" value="My Name" />
     </characteristic>
   </characteristic> 
</wap-provisioningdoc>

"Ahhhh" I hear you say not wanting to be out done, "but I use POP3 over SSL!". You see me chuckle, as you realise I have an answer. Use the following between AUTHSECRET and DOMAIN:
Code:
      <characteristic type="TAGPROPS">
        <parm name="8128000B" value="1"/>
        <parm name="812C000B" value="1"/>
      </characteristic>

8128000B is for incoming SSL, while 812C000B is for outgoing SSL.

Oh, and if you want to use SMTP auth for sending mail, add in the following after OUTSERVER:
Code:
      <parm name="AUTHREQUIRED" value="1"/>

Here my children ends the lesson on auto-provisioning email accounts the UC way. Go forth and use this knowledge to make your lives much, much easier.

Happy Flashing.
 
Last edited:

CRCinAU

Senior Member
Oct 29, 2007
1,182
43
Melbourne
www.crc.id.au
Heh - I have enough on my plate at the moment... Just drawing my testing to a close on Release 10.3 of my ROM - including a new battery driver that does readings in 1% increments :) I'll hopefully have it ready for release in about an hour.
 

cyberscribe

Senior Member
Oct 13, 2007
85
0
Your wisdom astounds me O sage philosoph! So I come to you with true hope rising in my heart. In many lands have I sought this answer and truly despair had threatened to overtake me.

Can it be that light breaks through the clouds of my despondency? Are you the promised one, he who holds "the answer?"

can UC be configured to populate the device name and owner information fields so that we need not repeat that ritual after every flash?

I promise to shower you with praise should you deign to craft the spell that will accomplish this feat!

Your humble and unworthy servant.
 

ph03n1x

Senior Member
May 8, 2007
51
0
Your wisdom astounds me O sage philosoph! So I come to you with true hope rising in my heart. In many lands have I sought this answer and truly despair had threatened to overtake me.

Can it be that light breaks through the clouds of my despondency? Are you the promised one, he who holds "the answer?"

can UC be configured to populate the device name and owner information fields so that we need not repeat that ritual after every flash?

I promise to shower you with praise should you deign to craft the spell that will accomplish this feat!

Your humble and unworthy servant.

if u go to the uc thread i think post 17 it mentions a tool which can do exactly that all though idk about all the poetry but yea check it out in the development forum
 
Last edited:

CRCinAU

Senior Member
Oct 29, 2007
1,182
43
Melbourne
www.crc.id.au
does someone know how to set the download limit of emails (size) ?
with these settings all attachements will be downloaded also, or am i wrong ?

Ahhh, a worthy question!

The answer you seek is a reverent one. Add the following below the NAME parm.

Code:
<parm name="RETRIEVE" value="0" />

Now with all true options in life, there are multiple values you may use. Specify a value of 0 to say that you only want to download headers. Specify a value of -1 (or 4294967295) if you want to download all messages.

I can also see more questions brewing, so I shall also list you these.

Code:
<parm name="KEEPMAX" value="0" />

Specifies the maximum size (in KB) for message attachments to be downloaded. Attachments that are larger will remain on the server, but the message itself will still be downloaded. Use a value of 0 to specify that you do not want any message attachments. Use a value of -1 (or 4294967295) to specify that you want all message attachments, no matter how large.

Code:
<parm name="LINGER" value="0" />

How often perform scheduled sends/receives in minutes. Beware however, if a value is not provided for LINGER, the automatic connection sync setting defaults to every 15 minutes. You should set the LINGER parameter to 0 to never connect automatically.

Code:
<parm name="FORMAT" value="1" />

Specifies which format to use for downloading and composing new e-mail messages (1 for Plain Text, and 2 for HTML). The default is HTML, however a true sage will only ever require Plain Text :)
 

petervbeck

Senior Member
Jun 18, 2007
558
0
in front of your monitor
CRCinAU, thank you very much! missing this option was quite annoying to me because i had to change these options manually everytime!
If we ever meet, you'll get a Guinness from me! :D
Thanks again!
 

Funky B

Senior Member
Apr 28, 2006
53
0
Santa Barbara
Here's everything together for POP3 except for TAGPROPS for SSL. I've also added DWNDAY for the # of days to download.
Code:
<characteristic type="EMAIL2">
 <characteristic type="{05250a7a-21ff-4119-a4a5-046cfe884082}">
  <parm name="SERVICENAME" value="[I]My Account Mail[/I]" />
  <parm name="SERVICETYPE" value="POP3" />
  <parm name="INSERVER" value="[I]pop.server.com[/I]" />
  <parm name="OUTSERVER" value="[I]smtp.server.com[/I]" />
  <parm name="NAME" value="[I]your name[/I]" />
  <parm name="AUTHNAME" value="[I]your account name[/I]" />
  <parm name="AUTHSECRET" value="[I]your account password[/I]" />
  <parm name="DOMAIN" value="[I]your domain if needed[/I]" />
  <parm name="REPLYADDR" value="[I]your reply to address[/I]" />
  <parm name="LINGER" value="30" />
  <parm name="RETRIEVE" value="-1" />
  <parm name="KEEPMAX" value="-1" />
  <parm name="DWNDAY" value="7" />
  <parm name="AUTHREQUIRED" value="1" />
  <parm name="FORMAT" value="2" />
 </characteristic>
</characteristic>

You can generate your own GUID here.

While were at it I also connect to wifi to download email after a flash because reception is horrible where I live. In order to do so I need to type in my WEP key - another step. Add this to your provisioning.xml file and have sdautorun setup wifi too :)

Code:
<characteristic type="CM_WiFiEntries">
  <characteristic type="[I]Your SSID[/I]">
    <parm name="DestID" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
  </characteristic>
</characteristic>

<characteristic type="Wi-Fi">
  <characteristic type="access-point">
    <characteristic type="[I]Your SSID[/I]">
      <parm name="DestId" value="{436EF144-B4FB-4863-A041-8F905A62C572}"/>
      <parm name="Encryption" value="0"/>
      <parm name="Authentication" value="0"/>
      <parm name="Hidden" value="0"/>
      <parm name="KeyProvided" value="0"/>
      <parm name="NetworkKey" value="[I]your network key[/I]"/>
      <parm name="KeyIndex" value="1"/>
      <parm name="Use8021x" value="0"/>
    </characteristic>
  </characteristic>
</characteristic>

The GUID for CM_WiFiEntries in this example is directed to the internet network. You can also choose "{A1182988-0D73-439e-87AD-2A5B369F808B}" for the work network.

Under wifi you can choose "ad-hoc" instead of access-point for a computer to computer connection.

Authentication will allow for open (0), shared (1), WPA (3), WPA-PSK (4) or WPA-NONE(5).

For a full list of parameters check out MSDN. Other options are EAPType and Filter to filter out specific network types.
 

CRCinAU

Senior Member
Oct 29, 2007
1,182
43
Melbourne
www.crc.id.au
Authentication will allow for open (0), shared (1), WPA (3), WPA-PSK (4) or WPA-NONE(5).

There are a couple others on this too that aren't documented..

Authentication:
6 = WPA2
7 = WPA2-PSK

Encryption:
0 = Encrypt using 802.11 wired equivalent privacy (WEP) key.
1 = No encryption.
4 = Encrypt using Temporal Key Integrity Protocol (TKIP) sequence counters.
6 = Encrypt using Advanced Encryption Standard (AES).
 

Dr Puttingham

Retired Moderator
Jul 24, 2005
1,504
2
Delray Beach, FL
OK guys, thank you so much for educating us!

Now that THAT'S said....

Please tell me what I'm doing wrong.. Tasks isn't in the XML so I added it along with the download the last 30 days, entire messages. Tasks blows up the XML and when I remove everything works except it wants to download the last 3 days and not the netire message...

Here's my email.xml

<wap-provisioningdoc>
<characteristic type="Sync">
<characteristic type="Settings">
<parm name="SyncWhenRoaming" value="1"/>
</characteristic>
<characteristic type="Connection">
<parm name="Domain" value="xxxx"/>
<parm name="Password" value="xxxxxxxx"/>
<parm name="SavePassword" value="1"/>
<parm name="Server" value="mail.xxxx.com"/>
<parm name="User" value="puttingham"/>
<parm name="URI" value="Microsoft-Server-ActiveSync"/>
<parm name="DWNDAY" value="30" />
<parm name="UseSSL" value="1"/>
<parm name="RETRIEVE" value="-1" />
</characteristic>
<characteristic type="Mail">
<parm name="Enabled" value="1"/>
<parm name="EmailAgeFilter" value="3"/>
</characteristic>
<characteristic type="Calendar">
<parm name="Enabled" value="1"/>
<parm name="CalendarAgeFilter" value="5"/>
</characteristic>
<characteristic type="Contacts">
<parm name="Enabled" value="1"/>
</characteristic>
<characteristic type="Tasks">
<parm name="Enabled" value="1"/>
</characteristic>
</wap-provisioningdoc>

With the Tasks like that I get a
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

End tag 'wap-provisioningdoc' does not match the start tag 'characteristic'. Error processing resource 'file:///C:/Document...

</wap-provisioningdoc>
--^
 

duke_stix

Senior Member
Aug 2, 2006
499
0
so who's gna take the initiative to make one of these up for gmail? ready for people to just put username and password in?!


hm..i'll have a crack i think!

how hard would it be to code a small little program that will generate these XML files for us?

any one got any pointers?
 
Last edited:

egoist6

Senior Member
Sep 4, 2007
703
4
Munich
so who's gna take the initiative to make one of these up for gmail? ready for people to just put username and password in?!


hm..i'll have a crack i think!

how hard would it be to code a small little program that will generate these XML files for us?

any one got any pointers?

dude,
read my post #6.
 

egoist6

Senior Member
Sep 4, 2007
703
4
Munich

Attachments

  • OEMizer.zip
    152.9 KB · Views: 178
Last edited:

Dr Puttingham

Retired Moderator
Jul 24, 2005
1,504
2
Delray Beach, FL
Well, thanks to this thread and Sleuth's UC I've finally got a nice cab file with all my AS settings preconfigured. And in my personal cab I imported my exchange server's security certificate so all is well. Hard to find was how to sync the last 30 days, that's found on page 55 of Sleuth's thread
<parm name="EmailAgeFilter" value="5"/>
Still can't enable HTML but that's no big deal. (FORMAT doesn't work :( )

I carry my last 30 days, entire message with no attachments being dl'ed until I need them.

The entire script is

- <wap-provisioningdoc>
- <!-- Mail2web Settings
-->
- <characteristic type="Sync">
- <characteristic type="Connection">
<parm name="Server" value="mail.xxxxx.com" />
<parm name="AllowSSLOption" value="1" />
<parm name="User" value="dr_puttingham" />
<parm name="Domain" value="estate" />
<parm name="Password" value="is_here" />
<parm name="SavePassword" value="1" />
</characteristic>
- <characteristic type="Settings">
<parm name="PeakStartTime" value="0800" />
<parm name="PeakEndTime" value="1800" />
<parm name="PeakFrequency" value="-1" />
<parm name="BodyTruncation" value="-1" />
- <characteristic type="PeakDays">
<parm name="Sun" value="0" />
<parm name="Mon" value="1" />
<parm name="Tue" value="1" />
<parm name="Wed" value="1" />
<parm name="Thr" value="1" />
<parm name="Fri" value="1" />
<parm name="Sat" value="0" />
</characteristic>
</characteristic>
- <characteristic type="Mail">
<parm name="Enabled" value="1" />
<parm name="MailBodyTruncation" value="-1" />
<parm name="MailFileAttachments" value="0" />
<parm name="EmailAgeFilter" value="5" />
<parm name="FORMAT" value="1" />
</characteristic>
- <characteristic type="Calendar">
<parm name="Enabled" value="1" />
</characteristic>
- <characteristic type="Contacts">
<parm name="Enabled" value="1" />
</characteristic>
- <characteristic type="Tasks">
<parm name="Enabled" value="1" />
</characteristic>
</characteristic>
</wap-provisioningdoc>

Thanks also to egoist6 for the OEMizerlink as I used that to troubleshoot the Tasks not being enabled.