Custom headers: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
No edit summary
 
(added mailnews.customHeaders)
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:


==Add custom headers==
==Add custom headers==
The '''mailnews.customHeaders''' and '''mail.compose.other.header''' settings are used to add custom headers. They're supported in all versions. The first one adds headers that can be used in searches while the other one adds headers to the list of header fields such as To, CC etc that you can use when composing a message.


Every version supports adding a custom header using the mail.compose.other.header preference. This will add the custom header to the list of header fields such as To, CC etc. available when you compose a message. For example, add the following to [http://www.mozilla.org/support/thunderbird/edit#user user.js]:
'''mailnews.customHeaders''' is a string of custom headers separated by spaces, with each entry except for the last one ending with ':'. For example: ''X-Spam-hits: Body: Reply-To''


:user_pref("mail.compose.other.header", "X-No-Archive");
'''mail.compose.other.header''' is a string of custom headers separated by commas. For example, ''X-No-Archive,X-gazette-tag''


You could then select X-No-Archive and type "yes" (without the quotes) when composing the message to add a ''X-No-Archive: yes'' header. If you want to add more than one custom header you must add them in the same preference. For example,
You could select X-No-Archive and type "yes" (without the quotes) when composing the message to add a ''X-No-Archive: yes'' header.  


:user_pref("mail.compose.other.header", "X-No-Archive,X-gazette-tag");
You can add custom headers by editing [[prefs.js]] (not recommended), using the [[Modify_Thunderbird_settings | Config Editor]] or by using the "customize..." option at the bottom of the leftmost list box in searches and message filters to add a custom header (it updates mailnews.customHeaders).


You could also add these preferences by editing prefs.js or using the [http://aboutconfig.mozdev.org/ about:config extension]. In Thunderbird 1.5 you can use Tools -> Options -> Advanced -> General -> Config editor to do the same thing as about:config.
Thunderbird 1.5 added the ability to add a custom header to every message you send using a identity (From: address), without having to do anything when composing the message. It requires at least two preferences be added to prefs.js. One preference lists the name of the preferences that define each custom header for that identity. The others specify the custom header and the value. For example:
 
The "customize..." option at the bottom of the leftmost list box in searches and message filters uses mail.compose.other.header so any custom header you add in order to use them in the rules lets you send messages using those headers as a sidefeffect.
 
Thunderbird 1.5 adds the ability to add a custom header to every message you send using a identity (From: address), without having to do anything when composing the message. It requires at least two preferences be added to user.js. One preference lists the name of the preferences that define each custom header for that identity. The others specify the custom header and the value. For example:


:user_pref("mail.identity.idN.headers", "archive");
:user_pref("mail.identity.idN.headers", "archive");
:user_pref("mail.identity.idN.header.archive", "X-No-Archive: yes");  
:user_pref("mail.identity.idN.header.archive", "X-No-Archive: yes");  


where 'N' is the appropiate id number. Notice that while the custom header is X-No-Archive its defined using a different name. You could add two custom headers for id3 using:
where 'N' is the appropriate id number. Notice that while the custom header is X-No-Archive its defined using a different name. You could add two custom headers for id3 using:


:user_pref("mail.identity.id3.headers", "archive, gazette-tag");
:user_pref("mail.identity.id3.headers", "archive, gazette-tag");
Line 26: Line 23:
:user_pref("mail.identity.id3.header.gazette-tag", "X-gazette-tag: Bubba");
:user_pref("mail.identity.id3.header.gazette-tag", "X-gazette-tag: Bubba");


You can look in prefs.js or use Tools -> Options -> Advanced -> General -> Config editor to find the number of the identity. The simplest way to find the id value might be to search for the email address. mail.identity.'''id1'''.useremail for example contains my default email address.
You can look in prefs.js or use [[Menu differences in Windows, Linux, and Mac|Tools -> Options]] -> Advanced -> General -> Config editor to find the number of the identity. The simplest way to find the id value might be to search for the email address. mail.identity.'''id1'''.useremail for example contains my default email address.


==Customize viewed headers==
==Customize what headers you see==


You can show the user agent and/or the organization header in the headers listed by View -> Headers -> normal by adding a line to user.js:
You can show the user agent and/or the organization header in the headers listed by View -> Headers -> normal by setting
'''mailnews.headers.showOrganization''' or '''mailnews.headers.showUserAgent''' true using the [[Modify_Thunderbird_settings | Config Editor]]. You can add other pre-defined headers using '''mailnews.headers.extraExpandedHeaders''' . Separate each header in the list with a space, not a comma.


:user_pref("mailnews.headers.showOrganization, true");
The [http://mnenhy.mozdev.org/ Mnenhy extension] adds additional menu commands to add or display custom headers.  


:user_pref("mailnews.headers.showUserAgent", true");
==Enigmail==
 
==Mnenhy and Enigmail==
 
The [http://mnenhy.mozdev.org/ Mnenhy extension] adds additional menu commands to add or display custom headers.


The [http://enigmail.mozdev.org/ Enigmail extension] needs to see all of the headers so it sets mail.show_headers to 2 and uses extensions.enigmail.show_headers to control what headers are displayed for the user. Enigmail also adds some custom headers to all outgoing mail if you add ''user_pref("extensions.enigmail.addHeaders",true);'' to user.js . It currently adds:
The [http://enigmail.mozdev.org/ Enigmail extension] needs to see all of the headers so it sets mail.show_headers to 2 and uses extensions.enigmail.show_headers to control what headers are displayed for the user. Enigmail also adds some custom headers to all outgoing mail if you add ''user_pref("extensions.enigmail.addHeaders",true);'' to user.js . It currently adds:
Line 50: Line 44:
==External links==
==External links==
*[https://addons.mozilla.org/extensions/moreinfo.php?application=thunderbird&category=News%20Reading&numpg=10&id=1003 Header scroll extension]  
*[https://addons.mozilla.org/extensions/moreinfo.php?application=thunderbird&category=News%20Reading&numpg=10&id=1003 Header scroll extension]  
* [https://addons.mozilla.org/extensions/moreinfo.php?application=thunderbird&numpg=10&id=210 View headers toogle button]
* [https://addons.mozilla.org/extensions/moreinfo.php?application=thunderbird&numpg=10&id=210 View headers toggle button]
 
* [http://developer.mozilla.org/en/docs/Extensions:Thunderbird:customDBHeaders_Preference Mozilla Developer Center article] about exposing custom header data for use in a custom column.
[[Category:Thunderbird]]
[[Category:Thunderbird]]

Latest revision as of 12:40, 8 February 2012

This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

Add custom headers

The mailnews.customHeaders and mail.compose.other.header settings are used to add custom headers. They're supported in all versions. The first one adds headers that can be used in searches while the other one adds headers to the list of header fields such as To, CC etc that you can use when composing a message.

mailnews.customHeaders is a string of custom headers separated by spaces, with each entry except for the last one ending with ':'. For example: X-Spam-hits: Body: Reply-To

mail.compose.other.header is a string of custom headers separated by commas. For example, X-No-Archive,X-gazette-tag

You could select X-No-Archive and type "yes" (without the quotes) when composing the message to add a X-No-Archive: yes header.

You can add custom headers by editing prefs.js (not recommended), using the Config Editor or by using the "customize..." option at the bottom of the leftmost list box in searches and message filters to add a custom header (it updates mailnews.customHeaders).

Thunderbird 1.5 added the ability to add a custom header to every message you send using a identity (From: address), without having to do anything when composing the message. It requires at least two preferences be added to prefs.js. One preference lists the name of the preferences that define each custom header for that identity. The others specify the custom header and the value. For example:

user_pref("mail.identity.idN.headers", "archive");
user_pref("mail.identity.idN.header.archive", "X-No-Archive: yes");

where 'N' is the appropriate id number. Notice that while the custom header is X-No-Archive its defined using a different name. You could add two custom headers for id3 using:

user_pref("mail.identity.id3.headers", "archive, gazette-tag");
user_pref("mail.identity.id3.header.archive", "X-No-Archive: yes");
user_pref("mail.identity.id3.header.gazette-tag", "X-gazette-tag: Bubba");

You can look in prefs.js or use Tools -> Options -> Advanced -> General -> Config editor to find the number of the identity. The simplest way to find the id value might be to search for the email address. mail.identity.id1.useremail for example contains my default email address.

Customize what headers you see

You can show the user agent and/or the organization header in the headers listed by View -> Headers -> normal by setting mailnews.headers.showOrganization or mailnews.headers.showUserAgent true using the Config Editor. You can add other pre-defined headers using mailnews.headers.extraExpandedHeaders . Separate each header in the list with a space, not a comma.

The Mnenhy extension adds additional menu commands to add or display custom headers.

Enigmail

The Enigmail extension needs to see all of the headers so it sets mail.show_headers to 2 and uses extensions.enigmail.show_headers to control what headers are displayed for the user. Enigmail also adds some custom headers to all outgoing mail if you add user_pref("extensions.enigmail.addHeaders",true); to user.js . It currently adds:

X-Enigmail-Version: 0.90.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime

See also

External links