[工作筆記] 手機發送接收研究 with MMS email

要弄這個東西其實還挺浪費錢的,因為發 MMS 是要錢的。當然,我不會幹這種蠢事,我當然是只發了一封,然後利用 webmail 把他 mark 成 unread 之後,就可以不斷的重新去讀取了。我記得我之前貼過關於 blog 可以利用手機發送的相關文章,不過,那個東西是專門針對韓國的行動服務商所開發的,在台灣是不適用的。

從 webmail 可以把 MMS 發送過來的原始碼拆出來。想要看的請往下捲動,因為實在太長了所以不放在上面佔版面。從 TextCube 的 Mail.Pop3 這個 component 來看,它是將整個 source code 拆成幾個部分,大致上都可以理解為什麼要這樣拆。只是,台灣行動通訊服務商所發出來的 MMS 實在是讓人覺得很滑稽。

我目前只有台灣大哥大的,因為發這個東西要錢,所以我也不好意思請別人幫忙。大抵上可以區分為這三塊:

  • mail header
  • mail body
  • mail attachments

然而,我參考了韓國原始的程式,發現其實他們的 attachments 只針對了圖片作取出的動作,其他的東西都不算是 attachments 的一部份。有趣的是,在台灣大哥大的 MMS 簡訊裡面,除了圖片以外,連同你的文字、或是其它的附件,例如聲音、影像等等,都算是 attachments 的一種。這麼說來,其實可以整個忽略從 MMS email 中所截取出來的 mail body 的部分,只要針對 attachments 做特殊處理即可。當然,這是針對台灣大哥大的因應辦法,其他家通訊業者則不清楚。

這麼說來,可以利用這個東西再往外擴展成一般網站所使用的 MMS to Blog 或是發佈的另一種機制,倒也不是不可行的事情。當然,比較起來,似乎 E-mail to Blog 這種方式會比 MMS 要好一點,不過,以台灣這種高價的行動上網的市場,我想應該沒有多少人有興趣玩吧。

以下是 MMS E-mail 的原始碼,可以跳過沒關係 (笑

Return-path: <***************/[email protected]>
Envelope-to: ***********@ushiisland.net
Delivery-date: Wed, 09 Jul 2008 21:58:27 -0600
Received: from smtp.tcc.net.tw ([219.80.51.15])
    by host247.hostmonster.com with esmtp (Exim 4.69)
    (envelope-from <***************/[email protected]>)
    id 1KGnIY-0003B1-43
    for ***************@ushiisland.net; Wed, 09 Jul 2008 21:58:27 -0600
Received: from mms2.twmmms.catch.net.tw (unknown [172.20.2.241])
    by smtp.tcc.net.tw (Postfix) with ESMTP id 00DC524347
    for <***************@ushiisland.net>; Thu, 10 Jul 2008 11:58:22 +0800 (CST)
Received: by mms2.twmmms.catch.net.tw (Multimedia IP message store 6.1.999.11) id 4864395F00037F22 for [email protected]; Thu, 10 Jul 2008 11:58:22 +0800
Message-ID: <5463965.1215662301676.JavaMail.mms@mms2>
Date: Thu, 10 Jul 2008 10:57:26 +0800
From: ***************@twmmms.catch.net.tw
Reply-To: ***************[email protected]
To: ***************@ushiisland.net
Subject:  =?utf-8?B?5omL5qmf55m86YCB5paH56ug5ris6KmmIA==?=
Mime-Version: 1.0
Content-Type: multipart/related; type="text/html"; 
    boundary="----=_Part_497987_9519656.1215662301660"
Importance: Normal
X-Mms-Sender-Visibility: Show
X-MMS-Message-Type: MM4_forward.REQ
X-Priority: 3
X-user: ::::219.80.51.15:host247.hostmonster.com::::::
DomainKey-Status: no signature

------=_Part_497987_9519656.1215662301660
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
Content-ID: <0000>
Content-Disposition: inline

<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3Dutf-8"=
><title>TWM MMS</title>
    <style type=3D"text/css">
      body {
        margin: 24px 12px 12px 12px!important;
        padding: 0;
=09    =09background: #fff;
        font-size: x-small;
=09=09=09  font-family: Arial, Helvetica, sans-serif;
        direction: ltr;
=09    =09text-align: left;
=09    =09text-decoration: none;
=09    =09color: #000;
=09    =09text-align: center;
      }
=09</style></head><body>

    <table style=3D"margin: 12px auto 0pt; background: rgb(255, 255, 255) n=
one repeat scroll 0%; font-size: 13px; font-family: Arial,Helvetica,sans-se=
rif; direction: ltr; text-align: left; text-decoration: none; color: rgb(0,=
 0, 0); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-in=
itial; -moz-background-inline-policy: -moz-initial;" border=3D"0" cellpaddi=
ng=3D"0" cellspacing=3D"0" width=3D"467">
        <tbody><tr>
        </tr>
        <tr>
            <td>
            <!-- Header starts here -->
                <div style=3D"margin: 12px 24px 0pt 0pt; padding: 0pt; font=
-size: 130%; font-weight: bold; color: rgb(102, 102, 102); text-align: righ=
t;"></div>
                <!-- Header ends here -->
            </td>
            </tr>
        <tr>
            <!-- <td><img src=3D"D:\Documents and Settings\cchen\Desktop\TW=
M MMSC 3.2\SiteInformation\TWMLogo_catch.gif" style=3D"width: 660px; height=
: 58px;"></td>
            <td><img src=3D"http://192.168.104.21/twmlogo.gif" style=3D"wid=
th: 660px; height: 58px;"></td> -->
            <td><img src=3D"cid:TWM.gif" style=3D"width: 860px; height: 60p=
x;"></td>
        </tr>
        <tr style=3D"vertical-align: top;">
            <td colspan=3D"2" align=3D"left">
            <!-- Content starts here -->
            <table border=3D0><TR><TD width=3D350 colSpan=3D4><IMG src=3D"h=
ttp://www.comverse.com/web1/content/dottedline350.gif" width=3D350></TD></T=
R><tr><tr><td colspan=3D1 align=3D"Center"><IMG align=3Dbaseline alt=3D"" b=
order=3D0 hspace=3D0 src=3D"cid:989"></td></tr><tr><td colspan=3D1 align=3D=
"Center">&#25163;&#27231;&#30332;&#36865;&#25991;&#31456;&#28204;&#35430;</=
td></tr></tr><TR><TD width=3D350 colSpan=3D4><IMG src=3D"http://www.comvers=
e.com/web1/content/dottedline350.gif" width=3D350></TD></TR></table>
            <!-- Content ends here -->
            </td>
        </tr>
        <tr style=3D"vertical-align: bottom;">
            <td>
            <!-- footer starts here -->
            <div style=3D"margin: 12px 24px 0pt 0pt; padding: 0pt; font-siz=
e: 120%; font-weight: bold; color: rgb(102, 102, 102); text-align: left;">&=
#24744;&#25910;&#21040;&#20102;&#19968;&#23553;&#30001;&#22909;&#21451;&#23=
492;&#20358;&#30340;&#65325;&#65325;&#65331;&#22810;&#23186;&#39636;&#35338=
;&#24687;, &#32882;&#30059;&#21516;&#27493;&#30340;&#20840;&#26032;&#39636;=
&#39511;, &#21482;&#35201;&#38283;&#21855;&#38468;&#20214;&#27284;&#26696;,=
 &#23601;&#33021;&#28858;&#24744;&#25765;&#25918;&#12577;...</div>
            <div style=3D"margin: 12px 24px 0pt 0pt; padding: 0pt; font-siz=
e: 130%; font-weight: bold; color: rgb(102, 102, 102); text-align: left;">&=
#26356;&#22810;&#26356;&#22909;&#29609;&#30340;&#34892;&#21205;&#21152;&#20=
540;&#27489;&#36814;&#24744;&#21040;&#21488;&#28771;&#22823;&#21733;&#22823=
;catch &#36629;&#39686;&#36938;&#29609;&#12290;</div>
            <div style=3D"margin: 12px 24px 0pt 0pt; padding: 0pt; font-siz=
e: 130%; font-weight: bold; color: rgb(102, 102, 102); text-align: left;">
&#21488;&#28771;&#22823;&#21733;&#22823;.&#27867;&#20126;&#38651;&#20449;.&=
#26481;&#20449;&#38651;&#35338;<a href=3D"http://www.catch.net.tw"> www.cat=
ch.net.tw</a></div>
            <div style=3D"margin: 12px 24px 0pt 0pt; padding: 0pt; font-siz=
e: 130%; font-weight: bold; color: rgb(102, 102, 102); text-align: left;">&=
#22914;&#20320;&#26410;&#33021;&#38321;&#35712;&#38468;&#21152;&#27284;&#26=
696;, &#35531;&#25353;&#27492;&#19979;&#36617;<a href=3D"http://www.microso=
ft.com/downloads/details.aspx?displaylang=3Dzh-tw&FamilyID=3D1e1550cb-5e5d-=
48f5-b02b-20b602228de6">Internet Explorer 6.0</a>&#25110;&#20197;&#19978;&#=
12290;</div>
            <!--This message was sent from a cellular phone.-->
            <!-- footer ends here -->
            </td>
        </tr>
    </tbody></table>
  </body>
</html>

------=_Part_497987_9519656.1215662301660
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
Content-Location: smil.txt
Content-Disposition: inline
Content-ID: <988>

5omL5qmf55m86YCB5paH56ug5ris6Kmm
------=_Part_497987_9519656.1215662301660
Content-Type: image/jpeg; name=R0014510.JPG
Content-Transfer-Encoding: base64
Content-Location:R0014510.JPG
Content-ID: <989>

/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIy
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAeACgAMBIgACEQED
/* 太長省略 */
ZepKMbXGKvW/KgHsaw9T1CMXeWfbEZ2Ste0lBQGvIx9M0gzWjGGGPSryNxzWdE/II61cRgQCK5C2
XY3JODVhTx1qojc9KnUnHQ80Ek6tmpVPINQpn1qUHkVSEf/Z
------=_Part_497987_9519656.1215662301660
Content-Type: image/gif; name=TWM.gif
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=TWM.gif
Content-ID: <TWM.gif>

R0lGODlh0AI9APcAAP////+cAP+UAP9jAP97AP9rAP9zAP+MAP+tAP+lAP+EALVrGf97CPfvzv+M
CPecMffenP+cCN5CAO+UEM7OzveMMffFABApGUIpGaVjQtbvnKUQWntjEPfmvffFhBlrWrVrCEoI
/* 太長省略 */
znfXe972ksc856GYxjb+3otRXMgW3/jEPK6X9rr74wwT2cjZK5vy7GAMNe/FOMnRY/GTndfiADRg
AVfGcpYXQIgFgMDLXu4yCMLsZX6MGcxfDjM/8IFmMq/5y2J+M5zZfGYQqHnOdo5znum85zqLWc0L
+HOg18yPN4/Z0Hr+MqHpbGY5I7rRfNazliU9aUpX2tKXxnSmuYzlTV+501vO8qdFHWpSZ9rUp0Z1
qlW9ala32tWvhnWsZT1rWtfa1qwOCAA7
------=_Part_497987_9519656.1215662301660--
Hina Chen
偏執與強迫症的患者,算不上是無可救藥,只是我已經遇上我的良醫了。
Taipei