﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>学习日记 &#187; thunderbird</title>
	<atom:link href="https://www.softwareace.cn/?feed=rss2&#038;tag=thunderbird" rel="self" type="application/rss+xml" />
	<link>https://www.softwareace.cn</link>
	<description>时刻想着为自己的产品多做一些对他好的事情</description>
	<lastBuildDate>Fri, 20 Mar 2026 06:58:28 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Building a C++ XPCOM Component in Windows</title>
		<link>https://www.softwareace.cn/?p=832</link>
		<comments>https://www.softwareace.cn/?p=832#comments</comments>
		<pubDate>Fri, 20 Jun 2014 07:36:17 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[二次开发]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=832</guid>
		<description><![CDATA[http://briankrausz.com/building-a-c-xpcom-component-in  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>http://briankrausz.com/building-a-c-xpcom-component-in</p>
<p>-windows/Jason was kind enough to translate this post to Belorussian.</p>
<p>I’ve been teaching myself to write Firefox extensions for the last few weeks, and became interested in XPCOM components. Unfortunately, I couldn’t find a good (and recent) summary of them, and had to spend 3 or 4 days cobbling together various tutorials, so I figured it’s time to write one.</p>
<p>What is XPCOM?<br />
XPCOM is a language-agnostic communication platform used in Mozilla products (and some other random pieces of software) to allow code (specifically extensions) to be written in a wide variety of languages.</p>
<p>Why would I want to use XPCOM?<br />
There are two ways to “use” XPCOM. First, you can call functions through XPCOM. For example, the Firefox bookmarks service uses an XPCOM interface. So in order to interact with this service from Javascript you would do something like:</p>
<p>var bmarks = Components.classes["@mozilla.org/browser/bookmarks-service;1"].getService();<br />
bmarks.QueryInterface(Components.interfaces.nsIBookmarksService);<br />
bmarks.addBookmarkImmediately(&#8220;http://www.mozilla.org&#8221;,&#8221;Mozilla&#8221;,0,null);<br />
There are plenty of tutorials on doing this as it is the more common use for XPCOM, so I won’t go into any detail on it here.</p>
<p>The second way is to write an XPCOM service. That is what this tutorial covers. Sometimes you need extra functionality, speed, or just want to tie into some library that requires a different language. Most commonly this is C++, but there is also JavaXPCOM and PyXPCOM (and probably a few others). I’ll be talking about C++, since it’s what I needed for my project.</p>
<p>Warnings<br />
Before you trudge through this: you most likely are in the wrong place. Firefox extensions are usually all Javascript. If you can use JS to do what you want, stop now. There is no need to go through the complexity of an XPCOM component when you can just use JS. Go read a tutorial about writing extensions and get to work.<br />
There is something called ctypes coming to FF 3.7 that may make doing this a lot easier. I haven’t touched this at all, but it may be worth considering if you can wait for the functionality and only need to tie into a particular DLL for some functionality. Long story short, XPCOM may become the more difficult way to call C++ functions from FF extensions.<br />
My Setup<br />
Windows 7<br />
Visual C++ Express 2008 (free from Microsoft’s website)<br />
Firefox 3.6 (Gecko 1.9.2)<br />
A UUID or GUID generator. This is a unique (read: random) ID that identifies your app to the world. Windows and Linux have tools to generate this (guidgen &#038; uuidgen, respectively), or you can find various online generators (Mozilla links to several). I recommend this one since it gives you the C++ encoded form too, which you will need. You need two different UUIDs: one for your interface and one for your component.<br />
Ability to read and understand C++<br />
Sample Code<br />
If you don’t want to go through the tutorial and just want everything to work, then download this sample code. Just follow step #1 of the tutorial, then make sure your Gecko SDK directory is set right in the build step, and you can breeze on by most of this article.</p>
<p>The Tutorial<br />
This is mostly paraphrased from Alex Sirota’s great tutorial, but it hasn’t been updated since 2005 and is a bit outdated. This new one should work out of the box for FF 3.6.</p>
<p>This tutorial will create a component called MyComponent with one function: Add, which will take 2 numbers and, surprisingly, return the sum.</p>
<p>Download the Gecko SDK for your version of Firefox. I used 1.9.2 for FF 3.6.<br />
Create an idl file – IMyComponent.idl, with the following (replacing ***IUID*** with your interface UUID):<br />
#include &#8220;nsISupports.idl&#8221;</p>
<p>[scriptable, uuid(***IUID***)]<br />
interface IMyComponent : nsISupports<br />
{<br />
  long Add(in long a, in long b);<br />
};<br />
This file is a language-agnostic interface definition which you can read more about here.</p>
<p>Generate the interface header and typelib files out of the interface definition file. Assuming you extracted the Gecko SDK to C:\xulrunner-sdk\, run the following commands (from the directory you saved IMyComponent.idl to):<br />
C:\xulrunner-sdk\sdk\bin\xpidl.exe -m header -I C:\xulrunner-sdk\idl .\IMyComponent.idl<br />
C:\xulrunner-sdk\sdk\bin\xpidl.exe -m typelib -I C:\xulrunner-sdk\idl .\IMyComponent.idl<br />
These will create IMyComponent.h and IMyComponent.xpt, respectively.</p>
<p>IMyComponent.h has two snippits of code that you can use for the next two files. Everything between /* Header file */ and /* Implementation file */ can be used for MyComponent.h:<br />
Start by inserting double inclusion protection code and the right include:<br />
#ifndef _MY_COMPONENT_H_<br />
#define _MY_COMPONENT_H_</p>
<p>#include &#8220;IMyComponent.h&#8221;<br />
Add the following lines, which define your component name, contract ID, and CUID (where ***CUID*** is the C++-style component UUID, of the form { 0×12345678, 0x9abc, 0xdef0, { 0×12, 0×34, 0×56, 0×78, 0x9a, 0xbc, 0xde, 0xf0 } }):<br />
#define MY_COMPONENT_CONTRACTID &#8220;@example.com/XPCOMSample/MyComponent;1&#8243;<br />
#define MY_COMPONENT_CLASSNAME &#8220;A Simple XPCOM Sample&#8221;<br />
#define MY_COMPONENT_CID ***CUID***<br />
Copy in the snippet from IMyComponent.h, replacing all the instances of _MYCLASS_ with the name of your component (MyComponent).<br />
Finish off the double inclusion protection code with #endif //_MY_COMPONENT_H_<br />
Everything between /* Implementation file */ and /* End of implementation class template. */ can be used for MyComponent.cpp:<br />
Start by inserting the right include:<br />
#include &#8220;MyComponent.h&#8221;<br />
Copy in the snippet from IMyComponent.h, replacing all the instances of _MYCLASS_ with the name of your component (MyComponent).<br />
Add some implementation to the Add method. I replaced return NS_ERROR_NOT_IMPLEMENTED; with<br />
	*_retval = a + b;<br />
return NS_OK;<br />
Create your module definitions files:<br />
#include &#8220;nsIGenericFactory.h&#8221;<br />
#include &#8220;MyComponent.h&#8221;</p>
<p>NS_GENERIC_FACTORY_CONSTRUCTOR(MyComponent)</p>
<p>static nsModuleComponentInfo components[] =<br />
{<br />
    {<br />
       MY_COMPONENT_CLASSNAME,<br />
       MY_COMPONENT_CID,<br />
       MY_COMPONENT_CONTRACTID,<br />
       MyComponentConstructor,<br />
    }<br />
};</p>
<p>NS_IMPL_NSGETMODULE(&#8220;MyComponentsModule&#8221;, components)<br />
You now have all of the files needed to build an XPCOM component:</p>
<p>IMyComponent.h<br />
IMyComponent.idl<br />
IMyComponent.xpt<br />
MyComponent.cpp<br />
MyComponent.h<br />
MyComponentModule.cpp<br />
Now comes the hard part: getting the damn thing to build.</p>
<p>Building the code<br />
Ok, it’s actually not hard since I’ve done most of the legwork for you. Assuming you’re using Visual C++ 2008 here are the settings you need (again assuming C:\xulrunner-sdk is where your Gecko SDK is). In Project->Properties:</p>
<p>Configuration Properties<br />
  General<br />
    Configuration Type: .dll<br />
  C/C++<br />
    General<br />
      Additional Include Directories: C:\xulrunner-sdk\include<br />
    Preprocessor<br />
      Preprocessor Definitions: XP_WIN;XP_WIN32;XPCOM_GLUE_USE_NSPR<br />
  Linker<br />
    General<br />
      Additional Library Directories: C:\xulrunner-sdk\lib<br />
    Input<br />
      Additional Dependencies: nspr4.lib xpcom.lib xpcomglue_s.lib<br />
If you put the idl file into your project, be sure to mark it “Excluded from Build” in its properties…we don’t want VS touching it.</p>
<p>Cross your fingers, pray to whatever deity you believe in, and hit the build button. If it didn’t work let me know why in the comments and I’ll try to build a troubleshooting section.</p>
<p>Installing/Testing the Code<br />
Copy two files to C:\Program Files\Mozilla Firefox\components:<br />
The DLL the build generated<br />
IMyComponent.xpt<br />
Normally, if this was installed as part of an extension, it would automatically search this directory and find these files. But now we have to force a refresh. Delete xpti.dat. and compreg.dat from your profile directory (FF will regenerate them on next restart)<br />
Close Firefox and open it with this test file (MyComponentTest.html in the sample code):<br />
<html><br />
<script type="text/javascript">
function MyComponentTestGo() {
	try {
		// normally Firefox extensions implicitly have XPCOM privileges, but since this is a file we have to request it.
		netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		const cid = "@example.com/XPCOMSample/MyComponent;1";
		obj = Components.classes[cid].createInstance();
		// bind the instance we just created to our interface
		obj = obj.QueryInterface(Components.interfaces.IMyComponent);
	} catch (err) {
		alert(err);
		return;
	}
	var res = obj.Add(3, 4);
	alert('Performing 3+4. Returned ' + res + '.');
}
</script><br />
<body><br />
<button onclick="MyComponentTestGo();">Go</button><br />
</body><br />
</html><br />
One last time: cross your fingers, pray to whatever deity you believe in, and hit the Go button. If it didn’t work let me know why in the comments and I’ll try to build a troubleshooting section.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=832</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Davmail+ThunderBird 连接MS Exchange Server</title>
		<link>https://www.softwareace.cn/?p=831</link>
		<comments>https://www.softwareace.cn/?p=831#comments</comments>
		<pubDate>Fri, 20 Jun 2014 07:27:15 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[二次开发]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=831</guid>
		<description><![CDATA[为了方便，来公司之后直接安装了Ubuntu10.04的64bit版本，但是在连接公司的exchange邮箱的时 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>为了方便，来公司之后直接安装了Ubuntu10.04的64bit版本，但是在连接公司的exchange邮箱的时候前短时间一直使用web access，速度慢，ckeck邮件也不方便，所以查阅了很多资料，综合很多朋友的意见，准备试一下 Davmail ＋ ThunderBird 试一下。</p>
<p>之所以选用以上的组合，给予下面的survey and test.<br />
（1）Ubuntu 原装版本的Evolution. 还算好用，不过配置后，会出现这个错误：<br />
引用<br />
The Exchange server is not compatible with Exchange Connector.</p>
<p>The server is running Exchange 5.5. Exchange Connector<br />
supports Microsoft Exchange 2000 and 2003 only.</p>
<p>无奈，不能使用他，我的gmail都是设置在这里的，无奈，试试其他的。</p>
<p>（2）kmail.  实验后，结论和evolution是一样的，没办法使用他连接exchage。</p>
<p>（3）ThunderBird  同上。</p>
<p>ThunberBird ＋ Davmail </p>
<p>First, Davmail is a gateway software for other mail-clients. more info see: http://davmail.sourceforge.net/index.html<br />
Download from  http://davmail.sourceforge.net/download.html, I choose the davmail_version-1_all.deb. You can choose one which is suitable for yourself.</p>
<p>Second, Install Davmail step by step.<br />
see http://davmail.sourceforge.net/linuxsetup.html<br />
do some settings:</p>
<p>OWA URL: https://red001.mail.microsoftonline.com/owa/</p>
<p>After that, I recommend turning on the following:</p>
<p>Local IMAP Port: 1143<br />
Local SMTP Port: 1025<br />
Local LDAP Port: 1389</p>
<p>You should just turn off the POP support.</p>
<p>-> save and close the window.</p>
<p>Third, install the ThunderBird.<br />
Java代码  收藏代码<br />
aptitude thunderbird<br />
install automaticly.</p>
<p>then, create an account like this:<br />
引用</p>
<p>name: ***<br />
email address: ***@**<br />
password: ***</p>
<p>引用</p>
<p>server setting:<br />
sever name: localhost<br />
IMAP port:1143<br />
user name: ***@** (this is your email account.)</p>
<p>引用</p>
<p>Outgoing server<br />
description: whatever<br />
server name: localhost<br />
SMTP port 1025<br />
username and password :  ***@**  (this is your email account)<br />
do not select &#8216;use secure authentication&#8217;</p>
<p>okay.<br />
Now, you can try it.<br />
Good luck!</p>
<p>http://blog.csdn.net/tody_guo/article/details/7926381</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=831</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging Thunderbird using Firefox Developer Tools</title>
		<link>https://www.softwareace.cn/?p=830</link>
		<comments>https://www.softwareace.cn/?p=830#comments</comments>
		<pubDate>Fri, 20 Jun 2014 07:16:49 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[二次开发]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=830</guid>
		<description><![CDATA[http://flailingmonkey.com/debugging-thunderbird-using-f [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>http://flailingmonkey.com/debugging-thunderbird-using-firefox-developer-tools</p>
<p>I recently discovered that it is possible to use Firefox Developer Tools with Thunderbird. Philipp Kewisch has done a fantastic job of his Google Summer of Code 2013 Project to bring Firefox Developer Tools to Thunderbird.</p>
<p>Starting with Thunderbird 24.0a1 and a matching version of Firefox, it is possible to debug Thunderbird code using Firefox Developer Tools. If your version of Thunderbird is 14.x then please go to &#8220;Help&#8221; > &#8220;About Thunderbird&#8221; and allow it to update.</p>
<p>For best results you should use the latest nightly versions of both Thunderbird and Firefox. At the very least the version numbers should match. Here is how to get things up and running using the latest nightlies:</p>
<p>Download the latest Thunderbird Nightly.<br />
Start Thunderbird.<br />
Select &#8220;Tools&#8221; > &#8220;Allow Remote Debugging.&#8221;<br />
Thunderbird > Allow remote debugging<br />
&#8220;Thunderbird&#8221; > &#8220;Allow remote debugging&#8221;<br />
Download the same version of Firefox Nightly as you did Thunderbird.<br />
Start Firefox.<br />
Press Ctrl > Shift > K to open the toolbox.<br />
Click the gear icon to open the developer tools options panel.<br />
Check &#8220;Enable Chrome Debugging&#8221; and &#8220;Enable Remote Debugging&#8221; then click &#8220;Restart Now&#8221; if it appears.<br />
Enable Chrome Debugging and Enable Remote Debugging options<br />
Enable Chrome Debugging and Enable Remote Debugging options<br />
Select &#8220;Web Developer&#8221; > &#8220;Connect…&#8221;<br />
Choose localhost port 6000 and click &#8220;Connect.&#8221;<br />
You will be presented with a set of available remote tabs and processes. For me they appeared as follows:</p>
<p>Available remote tabs and processes<br />
Available remote tabs and processes<br />
&#8220;Your Kobo Order Receipt&#8221; &#8211; the area in which the selected email is displayed. In this view the following did / did not work:<br />
The console tab may work but was empty when I tested.<br />
The inspector, debugger, style editor and profiler work just fine.<br />
The network tab was empty.<br />
&#8220;Message Summary&#8221; is the area in which email summaries are displayed when multiple messages are selected.<br />
The console tab may work but was empty when I tested.<br />
The inspector, debugger, style editor and profiler work just fine.<br />
The network tab was empty.<br />
&#8220;Main Process&#8221; &#8211; the main Thunderbird process. In this view the following did / did not work:<br />
The console, debugger and profiler work fine.<br />
The inspector and style editor and network tabs were empty.<br />
Although not all of the tools work perfectly in all contexts at least you can now use the DevTools for extension development and to fix bugs.</p>
<p>Philipp says that the same code packaged as an extension could be used to enable the debug server from other XUL apps but it doesn&#8217;t look like he has uploaded the extension yet.</p>
<p>Something has been needed since Venkman development halted so now we have something there is no excuse, whether it is Thunderbird itself or an extension &#8230; go, get hacking!</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=830</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging XULRunner applications</title>
		<link>https://www.softwareace.cn/?p=829</link>
		<comments>https://www.softwareace.cn/?p=829#comments</comments>
		<pubDate>Fri, 20 Jun 2014 07:14:44 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[二次开发]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.softwareace.cn/?p=829</guid>
		<description><![CDATA[https://developer.mozilla.org/en-US/docs/Mozilla/Projec [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>https://developer.mozilla.org/en-US/docs/Mozilla/Projects/XULRunner/Debugging_XULRunner_applications</p>
]]></content:encoded>
			<wfw:commentRss>https://www.softwareace.cn/?feed=rss2&#038;p=829</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
