Skip to content

Commit

Permalink
Merge branch 'master' into post-secure-autoconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
u451f committed May 4, 2016
2 parents 89bf536 + caaf2b5 commit 188fbd6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Makefile
@@ -1,9 +1,15 @@
SHELL := /bin/bash
VERSION := $(shell cat install.rdf|grep '<em:version>'|cut -d\> -f2|cut -d\< -f1)

FAKETIME := 200001010000

make-xpi:
zip -r ../torbirdy-$(VERSION).xpi * -x "debian/*" -x "patches/*" -x "ChangeLog" -x "Makefile" -x "gpg.conf" -x "import-translations.sh" -x "README.RELEASE"

make-reproducible:
find . -print0 | xargs -0 touch -t $(FAKETIME)
zip -X ../torbirdy-$(VERSION).xpi `find . | sort` -x "debian/*" -x "patches/*" -x "ChangeLog" -x "Makefile" -x "gpg.conf" -x "import-translations.sh" -x "README.RELEASE" -x *.git*

clean:
rm -f ../torbirdy-$(VERSION).xpi

Expand Down
4 changes: 4 additions & 0 deletions chrome/content/emailwizard.js
Expand Up @@ -138,6 +138,10 @@ if(!org.torbirdy.emailwizard) org.torbirdy.emailwizard = new function() {
}
document.getElementById("provisioner_button").disabled = true;
document.getElementById("provisioner_button").hidden = true;

// 0 is for POP3 (default), 1 is for IMAP. See emailwizard.xul and prefs.js.
var selectProtocol = prefs.getIntPref("extensions.torbirdy.defaultprotocol")
document.getElementById("torbirdy-protocol").selectedIndex = selectProtocol;
};

return pub;
Expand Down
22 changes: 21 additions & 1 deletion components/torbirdy.js
Expand Up @@ -166,7 +166,7 @@ const TorBirdyPrefs = {
*/

// Prevent hostname leaks.
"mail.smtpserver.default.hello_argument": "127.0.0.1",
"mail.smtpserver.default.hello_argument": "[127.0.0.1]",
// Compose messages in plain text (by default).
"mail.html_compose": false,
"mail.identity.default.compose_html": false,
Expand Down Expand Up @@ -320,6 +320,25 @@ var TorBirdyOldPrefs = [
"network.proxy.http",
]

// sanitizeDateHeaders()
// Run this function to make sure that the Date header in a new message
// is rounded down to the nearest minute.
function sanitizeDateHeaders() {
// Import the jsmime module that is used to generate mail headers.
let { jsmime } = Components.utils.import("resource:///modules/jsmime.jsm");
// Inject our own structured encoder to the default header emitter,
// to override the default Date encoder with a rounded-down version.
jsmime.headeremitter.addStructuredEncoder("Date", function (date) {
// Copy date
let roundedDate = new Date(date.getTime());
// Round down to the nearest minute.
roundedDate.setSeconds(0);
// Use the headeremitter's addDate function to format it properly.
// `this` magically refers to the headeremitter object.
this.addDate(roundedDate);
});
}

function TorBirdy() {
this._uninstall = false;
this.wrappedJSObject = this;
Expand Down Expand Up @@ -347,6 +366,7 @@ function TorBirdy() {

this.setAccountPrefs();
this.setPrefs();
sanitizeDateHeaders();

dump("TorBirdy registered!\n");
}
Expand Down
1 change: 1 addition & 0 deletions defaults/preferences/prefs.js
Expand Up @@ -10,3 +10,4 @@ pref("extensions.torbirdy.whonix_run", true);
pref("extensions.torbirdy.info_run", false);
pref("extensions.torbirdy.emailwizard", false);
pref("extensions.torbirdy.fetchall", false);
pref("extensions.torbirdy.defaultprotocol", 0); // 0 - POP3, 1 - IMAP

0 comments on commit 188fbd6

Please sign in to comment.