<?xml version="1.0" encoding="utf-8"?>
<service name="yahoomail"
         version="$Id: yahoomail.xml 21403 2008-12-12 22:50:49Z justin $"
         xmlns="http://www.flock.com/web-detective#">

  <strings>
    <string name="domains" value="yahoo.com" />
    <string name="composeParamsClassic" value="" />
    <string name="composeParamsNew" value="to=To,subject=Subj,body=Body,cc=Cc,bcc=Bcc" />
    <string name="classicFlavor_re">
      <![CDATA[^/?(\S+?)/]]>
    </string>
    <string name="defaultClassicFlavor" value="mc" />
    <string name="classicInboxParam_mc" value="Inbox" />
    <string name="classicInboxParam_ym" value="Inbox" />
    <string name="classicFolderPath_mc">
      <![CDATA[/mc/showFolder?rb=%folder%]]>
    </string>
    <string name="classicFolderPath_ym">
      <![CDATA[/ym/ShowFolder?rb=%folder%]]>
    </string>
    <string name="classicComposePath_mc">
      <![CDATA[/mc/compose?%params%&.intl=%intl%]]>
    </string>
    <string name="classicComposePath_ym">
      <![CDATA[/ym/compose?%params%&.intl=%intl%]]>
    </string>
    <string name="newInboxParam" value="Inbox" />
    <string name="newFolderPath">
      <![CDATA[?action=showFolder&box=%folder%]]>
    </string>
    <string name="newComposePath">
      <![CDATA[?action=compose&%params%]]>
    </string>
    <string name="onComposeURLLoadedNewView" value="fill" />
    <string name="encodeMessageIDForBetaView" value="1" />
    <string name="messageURL">
      <![CDATA[http://mrd.mail.yahoo.com/msg?]]>
    </string>
    <string name="mailAPIUrl" value="mg1.mail.yahoo.com/ws/mail/v1/formrpc?m=" />
    <string name="newViewComposerIFrame" value="compArea_test_1" />
    <string name="refreshUnreadMessageListDelay" value="10000" />
    <string name="upgradeAccountTitle" value="Yahoo! Mail Plus" />
    <string name="expiredCredentials" value="Client.ExpiredCredentials" />
    <string name="ar" value="com.ar"/><!-- Argentina -->
    <string name="au" value="com.au"/><!-- Australia -->
    <string name="br" value="com.br"/><!-- Brazil -->
    <string name="ca" value="ca"/><!-- Canada -->
    <string name="cf" value="ca"/><!-- Quebec -->
    <string name="cn" value="com.cn"/><!-- China -->
    <string name="de" value="de"/><!-- Germany -->
    <string name="dk" value="dk"/><!-- Denmark -->
    <string name="es" value="es"/><!-- Spain -->
    <string name="fr" value="fr"/><!-- France -->
    <string name="gr" value="gr"/><!-- Greece -->
    <string name="hk" value="com.hk"/><!-- Hong Kong -->
    <string name="id" value="co.id"/><!-- Indonesia -->
    <string name="in" value="co.in"/><!-- India -->
    <string name="ie" value="ie"/><!-- Ireland (UK) -->
    <string name="it" value="it"/><!-- Italy -->
    <string name="kr" value="co.kr"/><!-- Korea -->
    <string name="mx" value="com.mx"/><!-- Mexico -->
    <string name="my" value="com.my"/><!-- Malaysia -->
    <string name="nl" value="nl"/><!-- Netherlands -->
    <string name="no" value="no"/><!-- Norway -->
    <string name="nz" value="co.nz"/><!-- New Zealand -->
    <string name="ph" value="com.ph"/><!-- Philippines -->
    <string name="pl" value="pl"/><!-- Poland (UK) -->
    <string name="se" value="se"/><!-- Sweden -->
    <string name="sg" value="com.sg"/><!-- Singapore -->
    <string name="th" value="co.th"/><!-- Thailand -->
    <string name="tr" value="tr"/><!-- Turkey (UK) -->
    <string name="tw" value="com.tw"/><!-- Taiwan -->
    <string name="uk" value="co.uk"/><!-- United Kingdom -->
    <string name="vn" value="com.vn"/><!-- Vietnam -->
    <string name="dndXPathFields">
      <![CDATA[classicPlainComposerXPath,text/unicode;classicPlainComposerXPath_mc,text/unicode]]>
    </string>
    <string name="classicPlainComposerXPath">
      <![CDATA[//textarea[@id="bodyfield"]]]>
    </string>
    <string name="classicPlainComposerXPath_mc">
      <![CDATA[//textarea[@id="compose_editorArea"]]]>
    </string>

    <string name="homePageURL" locale="default">
      <![CDATA[http://mail.yahoo.com/]]>
    </string>

    <string name="homePageURL" locale="de">
      <![CDATA[https://edit.europe.yahoo.com/config/mail?.intl=de]]>
    </string>
  </strings>

  <sessioncookies>
    <cookie host=".yahoo.com" name="T" path="/" />
    <cookie host=".yahoo.com" name="Y" path="/" />
  </sessioncookies>

  <detect type="classicViewComposer_mc">
    <xpath name="node" extract="this">
      <![CDATA[//iframe[@id="compose_editorArea"]]]>
    </xpath>
  </detect>

  <detect type="classicViewComposer_ym">
    <xpath name="node" extract="this">
      <![CDATA[//iframe[@id="rteEditorComposition0"]]]>
    </xpath>
  </detect>

  <detect type="classicViewComposerBody">
    <xpath>
      <![CDATA[//body//text()]]>
      <regexp>
        <![CDATA[/\x0a/]]>
      </regexp>
    </xpath>
  </detect>

  <detect type="newViewComposer">
    <xpath>
      <![CDATA[//div[@id="tabMessageComposerBody" and @style[contains(.,"visible")]]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerSubject">
    <conditions>
      <xpath extract="value">
        <![CDATA[//input[@id="Subject"][@type="text"]]]>
        <regexp>
          <![CDATA[/(?:&amp;)/]]>
        </regexp>
      </xpath>
    </conditions>
    <results>
      <xpath name="subject" extract="this">
        <![CDATA[//input[@id="Subject"][@type="text"]]]>
      </xpath>
    </results>
  </detect>

  <detect type="newViewComposerBody">
    <xpath>
      <![CDATA[//body//text()]]>
      <regexp>
        <![CDATA[/\x08/]]>
      </regexp>
    </xpath>
  </detect>

  <detect type="newViewPlainText">
    <xpath>
      <![CDATA[//div[@id="richeditLine" and @style[contains(.,"display: none")]]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerTo">
    <xpath name="to" extract="this">
      <![CDATA[//textarea[@id="To"]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerCc">
    <xpath name="cc" extract="this">
      <![CDATA[//textarea[@id="Cc"]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerBcc">
    <xpath name="bcc" extract="this">
      <![CDATA[//textarea[@id="Bcc"]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerShowBcc">
    <xpath name="show_bcc" extract="this">
      <![CDATA[//span[@id="_test_show_hide_bcc"]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerSubj">
    <xpath name="subject" extract="this">
      <![CDATA[//input[@id="Subject"]]]>
    </xpath>
  </detect>

  <detect type="newViewComposerIFrame">
    <xpath name="iframe" extract="this">
      <![CDATA[//iframe[@id="compArea_test_1"]]]>
    </xpath>
  </detect>

  <detect type="signup">
    <url domain="edit.yahoo.com">
      <path contains="registration" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="yahooid"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwordconfirm"]]]>
      </xpath>
    </form>
  </detect>

  <!-- BEGIN Special Cases for Signup -->
  <!-- China -->
  <detect type="signup">
    <url domain="member.cn.yahoo.com">
      <path contains="cnreg/reginfo.html" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="yahooid"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwordconfirm"]]]>
      </xpath>
    </form>
  </detect>

  <!-- Taiwan -->
  <detect type="signup">
    <url domain="tw.reg.yahoo.com">
      <path contains="ap/reg/preg" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@name="uid"][@type="text"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@name="pw2"][@type="password"]]]>
      </xpath>
    </form>
  </detect>
  <!-- END Special Cases for Signup -->

  <detect type="login"><!-- Yahoo! login with username text field -->
    <url domain="yahoo.com">
      <path contains="config/login_verify2" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="username"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login"><!-- Yahoo! login with username text field -->
    <url domain="yahoo.com">
      <path contains="config/mail" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="username"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>
 
  <detect type="login"><!-- Yahoo! login with username text field -->
    <url domain="yahoo.com">
      <path contains="config/login" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="username"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login"><!-- Yahoo! login after configuring Seal -->
    <url domain="yahoo.com">
      <host equals="login.yahoo.com" />
      <querystring contains=".src=ym" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="username"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login"><!-- Yahoo! login with username text field -->
    <url domain="mail.yahoo.com" />
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="username"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login"><!-- Yahoo! login with hidden username field -->
    <url domain="yahoo.com">
      <path contains="config/login_verify2" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//form[@name="login_form"]//input[@name=".slogin"][@type="hidden"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login"><!-- Yahoo! login with hidden username field -->
    <url domain="yahoo.com">
      <path contains="config/mail" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//form[@name="login_form"]//input[@name=".slogin"][@type="hidden"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <detect type="login"><!-- Yahoo! login with hidden username field -->
    <url domain="yahoo.com">
      <path contains="config/login" />
    </url>
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//form[@name="login_form"]//input[@name=".slogin"][@type="hidden"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@id="passwd"]]]>
      </xpath>
    </form>
  </detect>

  <!-- BEGIN Special cases for Login -->
  <!-- China -->
  <detect type="login"><!-- Yahoo! login with username text field -->
    <url domain="cn.mail.yahoo.com" />
    <form>
      <xpath name="username" extract="value">
        <![CDATA[//input[@id="emailinput"]]]>
      </xpath>
      <xpath name="password" extract="value">
        <![CDATA[//input[@name="passwd"][@type="password"]]]>
      </xpath>
    </form>
  </detect>
  <!-- END Special case for Login -->

  <detect type="loggedin">
    <url domain="mail.yahoo.com">
      <host notcontains="mailplus" />
      <host notcontains="calendar" />
      <host notcontains="notepad" />
      <host notcontains="address" />
      <host notcontains="overview" />
    </url>
    <xpath><![CDATA[//a[@id="_test_sign_out"]]]></xpath>
  </detect>

  <detect type="loggedin"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com">
      <host notcontains="mailplus" />
      <host notcontains="calendar" />
      <host notcontains="notepad" />
      <host notcontains="address" />
      <host notcontains="overview" />
    </url>
    <xpath><![CDATA[//span[@id="ygmagreeting"]]]></xpath>
  </detect>

  <detect type="loggedin"><!-- Classic Yahoo! Mail view: as of 4/25/08 -->
    <url domain="mail.yahoo.com">
      <host notcontains="mailplus" />
      <host notcontains="calendar" />
      <host notcontains="notepad" />
      <host notcontains="address" />
      <host notcontains="overview" />
    </url>
    <xpath><![CDATA[//td[@id="ygmagreet"]]]></xpath>
  </detect>

  <detect type="loggedin"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com">
      <host notcontains="mailplus" />
      <host notcontains="calendar" />
      <host notcontains="notepad" />
      <host notcontains="address" />
      <host notcontains="overview" />
    </url>
    <xpath><![CDATA[//li[@id="ygmagrtlinks"]/a[@class="sio"]]]></xpath>
  </detect>

  <detect type="loggedin"><!-- Classic Yahoo! Mail "ym" view -->
    <url domain="mail.yahoo.com">
      <host notcontains="mailplus" />
      <host notcontains="calendar" />
      <host notcontains="notepad" />
      <host notcontains="address" />
      <host notcontains="overview" />
    </url>
    <xpath><![CDATA[//a[@id="ygmausername"]]]></xpath>
  </detect>

  <detect type="loggedoutCookies">
    <cookie nomatch="true" host=".yahoo.com" name="T" />
    <cookie nomatch="true" host=".yahoo.com" name="Y" />
  </detect>

  <detect type="loggedout">
    <url domain="yahoo.com">
      <path contains="/config" />
      <querystring contains="logout=1" />
    </url>
  </detect>

  <detect type="loggedout">
    <url domain="yahoo.com" />
    <xpath>
      <![CDATA[//li[@id="logout"]]]>
    </xpath>
  </detect>

  <detect type="loggedout">
    <url domain="yahoo.com" />
    <xpath>
      <![CDATA[//ul[@id="reg"]/li[@class="signedout"]]]>
    </xpath>
  </detect>

  <detect type="loggedout">
    <url domain="yahoo.com" />
    <document>
      <xpath><![CDATA[//li[@id="signup"]//a[contains(@href,"r/")]]]></xpath>
    </document>
  </detect>

  <detect type="loggedout">
    <url domain="yahoo.com" />
    <document>
      <xpath><![CDATA[//div[@id="pa-logout-note"]/p[@class="mail-logout"]]]></xpath>
    </document>
  </detect>

  <!-- A generic rule that should cover the main front page (www.yahoo.com,
       fr.yahoo.com, etc) regardless of language and screen resolution -->
  <detect type="loggedout">
    <xpath><![CDATA[//ul[@id="reg"][@class="so"]//li[@id="signup"]]]></xpath>
  </detect>

  <!-- Special rule when logged out from about:flock -->
  <detect type="loggedout">
    <url>
      <host equals="login.yahoo.com" />
      <path contains="/config/" />
    </url>
  </detect>

  <detect type="completeLogout">
    <url domain="yahoo.com">
      <host equals="login.yahoo.com" />
      <path contains="config/" />
      <querystring contains="logout=1" />
    </url>
  </detect>

  <detect type="accountinfo">
    <url domain="mail.yahoo.com" />
    <xpath name="accountid">
      <![CDATA[//b[@id="said"]/text()]]>
    </xpath>
    <regexp re1="altaccountid">
      <![CDATA[/username = '(.+)';/]]>
    </regexp>
  </detect>

  <detect type="accountinfo"><!-- Classic Yahoo! Mail view as of 11/15/08 -->
    <url domain="mail.yahoo.com" />
    <regexp re1="accountid">
      <![CDATA[/aliasid:"([^"]+)"/]]>
    </regexp>
  </detect>

  <detect type="accountinfo"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com" />
    <xpath name="accountid">
      <![CDATA[//span[@id="ygmagreeting"]/strong/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"><!-- Classic Yahoo! Mail view: as of 4/25/08 -->
    <url domain="mail.yahoo.com" />
    <xpath name="accountid">
      <![CDATA[//td[@id="ygmagreet"]//strong/text()]]>
      <regexp re1="accountid">
        <![CDATA[/\s?(.+)\s?/]]>
      </regexp>
    </xpath>
  </detect>

  <detect type="accountinfo"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com" />
    <xpath name="accountid">
      <![CDATA[//ul[@id="ygmahelp"]/li/a/strong/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com" />
    <xpath name="accountid">
      <![CDATA[//ul[@id="ygmahelp"]/li/strong/a/text()]]>
    </xpath>
  </detect>

  <detect type="accountinfo"><!-- Classic Yahoo! Mail "ym" view -->
    <url domain="mail.yahoo.com" />
    <xpath name="accountid">
      <![CDATA[//a[@id="ygmausername"]/text()]]>
    </xpath>
  </detect>

  <detect type="language">
    <url domain="mail.yahoo.com" >
      <regexp re1="intl" re2="farm">
        <![CDATA[/http:\/\/(.+)\.(.+)\.mail\.yahoo\.com/]]>
      </regexp>
    </url>
  </detect>

  <detect type="modernView">
    <url domain="mail.yahoo.com" />
    <xpath>
      <![CDATA[//a[@id="_test_switch_back"]]]>
    </xpath>
  </detect>
 
  <detect type="upgradeAccount">
    <url domain="mail.yahoo.com" />
    <regexp re1="hasMailPlus">
      <![CDATA[/"hasMailPlus":(.+?),/]]>
    </regexp>
  </detect>

  <detect type="upgradeAccount">
    <url domain="mail.yahoo.com" />
    <regexp re1="hasMailPlus">
      <![CDATA[/<hasMailPlus>(.+)<\/hasMailPlus>/]]>
    </regexp>
  </detect>

  <detect type="upgradeAccountClassic"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com" />
    <xpath>
      <![CDATA[//span[@id="mailtab"]/span/a/text()[contains(.," ")]]]>
    </xpath>
  </detect>

  <detect type="upgradeAccountClassic"><!-- Classic Yahoo! Mail view -->
    <url domain="mail.yahoo.com" />
    <xpath>
      <![CDATA[//li[@id="mail"]/a/strong/text()[contains(.," ")]]]>
    </xpath>
  </detect>

</service>
