Wednesday, June 19, 2013

Filter Incoming Mail (Thunderbird)

https://developer.mozilla.org/en-US/docs/Extensions/Thunderbird



https://developer.mozilla.org/en-US/docs/Extensions/Thunderbird/HowTos



@Check the sample code here:

https://developer.mozilla.org/en-US/docs/Extensions/Thunderbird/HowTos/Common_Thunderbird_Extension_Techniques/Filter_Incoming_Mail


@how to read the message body?

http://forums.mozillazine.org/viewtopic.php?f=19&t=1699075

@ read this:
http://thunderbirddocs.blogspot.tw/2005/02/thunderbird-extensions-how-to-get-body.html

@ sample code:
http://forums.mozillazine.org/viewtopic.php?t=274891


@

nsIScriptableInputStream:


@

nsIMsgDBHdr



@

nsIMsgFolder


@ 花了六個小時這一篇文章有作用!





@
  1. 下載附加元件到你的電腦,除非它已經存在。
  2. 在 Thunderbird 中,開啟 工具 | 附加元件
  3. 點選「齒輪」圖案右上方搜尋的右邊然後 從檔案安裝附加元件...
  4. 瀏覽到附加元件安裝檔所在位置,選擇它,點選 開啟

@Content-Transfer-Encoding: base64


represented as a byte sequence of 8-bit-padded ASCII characters is encoded in MIME's Base64 scheme as follows:
TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg
dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu
dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo
ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=

Setting up an extension development environment





@thunderbird - extension - logging?


Code:
function logtest()
{
//var {Cc, Ci} = require("chrome");
//var Application = Cc["@mozilla.org/steelapplication;1"]
//                    .getService(Components.interfaces.steelIApplication);

var Application = Components.classes["@mozilla.org/steel/application;1"].getService(Components.interfaces.steelIApplication);
Application.console.log('Bam! : sslake test');
}