Re: emacs: Wrong "From" address when forwarding a mail

2015-12-20 Thread Jinwoo Lee
On Sun, Dec 20, 2015 at 12:54 PM, Mark Walters  
wrote:
> You can get around some of this by setting
> notmuch-always-prompt-for-sender to t (it is a customizable
> variable). This means that whenever you create a new message or forward
> a message you will be prompted to choose a sender address.

I think forwarding should be more symmetric with replying than with
sending a new message.  Forwarding is an act of sending a mail you
received at your account A to another person, and so the default account
that it's sent from must be account A, not one of your other accounts.

Isn't it really weird if a mail was "forwarded" from an account that
never had received that mail?

> Indeed, I am surprised you don't find it annoying that, when you start a
> new personal email (e.g., with "m"), notmuch uses your corp address.

I'm not surprised because it's a new mail and not associated with any of
my accounts yet before I send it.  Forwarding is different because it's
already associated with one of the accounts and that one should be the
default From address when forwarding.  That's my expectation and I think
it's intuitive.

>> Can we make notmuch-show-forward-message behave like
>> notmuch-show-reply-sender, which chooses the From address correctly?
>
> We could do this, but it's not clear to me that it is better than what
> we have. Indeed, under your suggestion, suppose someone with their
> personal address as their primary address received an idiotic email from
> their boss, which they forward to their wife saying "what an
> idiot". Suddenly, it is now being read by work...

Agreed that this issue can happen in this case.  Let's forget about the
privacy issue.

> Overall, I don't think is is possible for notmuch  to get this right
> enough of the time to make anything other than
> notmuch-always-prompt-for-sender sensible in this sort of situation.
>
> Best wishes
>
> Mark
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


emacs: Wrong "From" address when forwarding a mail

2015-12-20 Thread Jinwoo Lee
I have two accounts set up in my notmuch configuration.  And when I'm
forwarding a mail using notmuch-show-forward-message, it always uses my
primary account as its From address no matter which account that
original mail has been delivered to.

For example:
1. I got a mail delivered to my personal address, perso...@somemail.com,
   which is my secondary account.
2. I want to forward the mail to someone else and I press 'f' for
   notmuch-show-forward-message.
3. It always uses my corp address, c...@somecompany.com, which is my
   primary account, as the From address, instead of
   perso...@somemail.com.

This is quite annoying and has some privacy issues because my corporate
account may be scanned by my employer.  I'm working around this by doing
'C-u f', which allows me to choose the From address, but it's very easy
to just press 'f' and make a mistake.

Can we make notmuch-show-forward-message behave like
notmuch-show-reply-sender, which chooses the From address correctly?

Thanks,
-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-17 Thread Jinwoo Lee
On Tue, Jun 16, 2015 at 11:23 PM, David Bremner  wrote:
> At a guess, this again has to do with spaces in the pathname. Maybe this
> is fixable with more quoting, but it's really independent of mac vs
> gnu/linux. In this instance it looks like quoting "test_results_path"
> would help.

Ah, I thought the readelf error was a fatal one.  I re-ran `make test'
from a new directory that doesn't have spaces in its name.  It gave
different errors and I'm attaching the output.

-- next part --
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C .. test
cd bindings/ruby && \
EXTRA_LDFLAGS="" \
LIBNOTMUCH="../../lib/libnotmuch.dylib" \
ruby extconf.rb --vendor
creating Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C bindings/ruby
linking shared-object notmuch.bundle
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib
Use "/Applications/Xcode.app/Contents/Developer/usr/bin/make V=1" to see the 
verbose compile lines.
CC  -g -O2 test/arg-test.o
CC test/arg-test
CC  -g -O2 test/hex-xcode.o
CC test/hex-xcode
CC  -g -O2 test/random-corpus.o
CC  -g -O2 test/database-test.o
CXX test/random-corpus
CC  -g -O2 test/parse-time.o
CC test/parse-time
CC  -g -O2 test/smtp-dummy.o
CC test/smtp-dummy
CXX  -g -O2 test/symbol-test.o
test/symbol-test.cc:7:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char** argv) {
 ^
1 warning generated.
CXX test/symbol-test
CXX  -g -O2 test/make-db-version.o
CXX test/make-db-version
INFO: using 2 minute timeout for tests

T000-basic: Testing the test framework itself.
 PASS   success is reported like this
 PASS   test runs if prerequisite is satisfied
 PASS   tests clean up after themselves
 PASS   tests clean up even after a failure
 PASS   failure to clean up causes the test to fail
 PASS   Ensure that test output is suppressed unless the test fails
 PASS   Ensure that -v does not suppress test output
 PASS   test that mail store was created
 PASS   mail store should be empty
 PASS   NOTMUCH_CONFIG is set and points to an existing file
 PASS   PATH is set to build directory
 FAIL   notmuch is compiled with debugging symbols
--- T000-basic.12.expected  2015-06-17 06:35:04.0 +
+++ T000-basic.12.output2015-06-17 06:35:04.0 +
@@ -1 +1 @@
-1
+0
./T000-basic.sh: line 95: readelf: command not found

T010-help-test: Testing online help
 PASS   notmuch --help
 PASS   notmuch help
 PASS   notmuch --version
 FAIL   notmuch --help tag (man pages not available)
test_must_fail notmuch --help tag >/dev/null
 PASS   notmuch help tag (man pages not available)

T020-compact: Testing "notmuch compact"
 PASS   Running compact
 PASS   Compact preserves database
 PASS   Restoring Backup
 PASS   Checking restored backup

T030-config: Testing "notmuch config"
 PASS   Get string value
 PASS   Get list value
 PASS   Set string value
 PASS   Set string value again
 PASS   Set list value
 PASS   Set list value again
 PASS   Remove key
 PASS   Remove non-existent key
 PASS   List all items
 PASS   Top level --config=FILE option
 PASS   Top level --config=FILE option changed the right file
 PASS   Read config file through a symlink
 PASS   Write config file through a symlink
 PASS   Writing config file through symlink follows symlink

T040-setup: Testing "notmuch setup"
 PASS   Notmuch new without a config suggests notmuch setup
 PASS   Create a new config interactively

T050-new: Testing "notmuch new" in several variations
 PASS   No new messages
 PASS   Single new message
 PASS   Multiple new messages
 PASS   No new messages (non-empty DB)
 PASS   New directories
 PASS   Alternate inode order
 PASS   Message moved in
 PASS   Renamed message
 PASS   Deleted message
 PASS   Renamed directory
 PASS   Deleted directory
 PASS   New directory (at end of list)
 PASS   Deleted directory (end of list)
 PASS   New symlink to directory
 PASS   New symlink to a file
 PASS   Broken symlink aborts
 PASS   New two-level directory
 PASS   Deleted two-level directory
 PASS   Support single-message mbox (deprecated)
 PASS   Skip and report non-mail files
 PASS   Ignore files and directories specified in new.ignore
 PASS   Ignore files and directories specified in new.ignore (multiple 
occurrences)
 PASS   Don't stop for ignored broken symlinks
 PASS   Quiet: No new mail.
 PASS   Quiet: new, removed and renamed messages.
 PASS   Empty tags in new.tags are forbidden
 PASS   Tags starting with '-' in new.tags are forbidden
 PASS   Invalid tags set exit code
 PASS   Xapian exception: read only files

T060-count: Testing "notmuch count" for messages and threads
 PASS   message count is the 

Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-17 Thread Jinwoo Lee
On Tue, Jun 16, 2015 at 11:23 PM, David Bremner da...@tethera.net wrote:
 At a guess, this again has to do with spaces in the pathname. Maybe this
 is fixable with more quoting, but it's really independent of mac vs
 gnu/linux. In this instance it looks like quoting test_results_path
 would help.

Ah, I thought the readelf error was a fatal one.  I re-ran `make test'
from a new directory that doesn't have spaces in its name.  It gave
different errors and I'm attaching the output.

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C .. test
cd bindings/ruby  \
EXTRA_LDFLAGS= \
LIBNOTMUCH=../../lib/libnotmuch.dylib \
ruby extconf.rb --vendor
creating Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C bindings/ruby
linking shared-object notmuch.bundle
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib
Use /Applications/Xcode.app/Contents/Developer/usr/bin/make V=1 to see the 
verbose compile lines.
CC  -g -O2 test/arg-test.o
CC test/arg-test
CC  -g -O2 test/hex-xcode.o
CC test/hex-xcode
CC  -g -O2 test/random-corpus.o
CC  -g -O2 test/database-test.o
CXX test/random-corpus
CC  -g -O2 test/parse-time.o
CC test/parse-time
CC  -g -O2 test/smtp-dummy.o
CC test/smtp-dummy
CXX  -g -O2 test/symbol-test.o
test/symbol-test.cc:7:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char** argv) {
 ^
1 warning generated.
CXX test/symbol-test
CXX  -g -O2 test/make-db-version.o
CXX test/make-db-version
INFO: using 2 minute timeout for tests

T000-basic: Testing the test framework itself.
 PASS   success is reported like this
 PASS   test runs if prerequisite is satisfied
 PASS   tests clean up after themselves
 PASS   tests clean up even after a failure
 PASS   failure to clean up causes the test to fail
 PASS   Ensure that test output is suppressed unless the test fails
 PASS   Ensure that -v does not suppress test output
 PASS   test that mail store was created
 PASS   mail store should be empty
 PASS   NOTMUCH_CONFIG is set and points to an existing file
 PASS   PATH is set to build directory
 FAIL   notmuch is compiled with debugging symbols
--- T000-basic.12.expected  2015-06-17 06:35:04.0 +
+++ T000-basic.12.output2015-06-17 06:35:04.0 +
@@ -1 +1 @@
-1
+0
./T000-basic.sh: line 95: readelf: command not found

T010-help-test: Testing online help
 PASS   notmuch --help
 PASS   notmuch help
 PASS   notmuch --version
 FAIL   notmuch --help tag (man pages not available)
test_must_fail notmuch --help tag /dev/null
 PASS   notmuch help tag (man pages not available)

T020-compact: Testing notmuch compact
 PASS   Running compact
 PASS   Compact preserves database
 PASS   Restoring Backup
 PASS   Checking restored backup

T030-config: Testing notmuch config
 PASS   Get string value
 PASS   Get list value
 PASS   Set string value
 PASS   Set string value again
 PASS   Set list value
 PASS   Set list value again
 PASS   Remove key
 PASS   Remove non-existent key
 PASS   List all items
 PASS   Top level --config=FILE option
 PASS   Top level --config=FILE option changed the right file
 PASS   Read config file through a symlink
 PASS   Write config file through a symlink
 PASS   Writing config file through symlink follows symlink

T040-setup: Testing notmuch setup
 PASS   Notmuch new without a config suggests notmuch setup
 PASS   Create a new config interactively

T050-new: Testing notmuch new in several variations
 PASS   No new messages
 PASS   Single new message
 PASS   Multiple new messages
 PASS   No new messages (non-empty DB)
 PASS   New directories
 PASS   Alternate inode order
 PASS   Message moved in
 PASS   Renamed message
 PASS   Deleted message
 PASS   Renamed directory
 PASS   Deleted directory
 PASS   New directory (at end of list)
 PASS   Deleted directory (end of list)
 PASS   New symlink to directory
 PASS   New symlink to a file
 PASS   Broken symlink aborts
 PASS   New two-level directory
 PASS   Deleted two-level directory
 PASS   Support single-message mbox (deprecated)
 PASS   Skip and report non-mail files
 PASS   Ignore files and directories specified in new.ignore
 PASS   Ignore files and directories specified in new.ignore (multiple 
occurrences)
 PASS   Don't stop for ignored broken symlinks
 PASS   Quiet: No new mail.
 PASS   Quiet: new, removed and renamed messages.
 PASS   Empty tags in new.tags are forbidden
 PASS   Tags starting with '-' in new.tags are forbidden
 PASS   Invalid tags set exit code
 PASS   Xapian exception: read only files

T060-count: Testing notmuch count for messages and threads
 PASS   message count is the default for notmuch count
 PASS   message count with 

[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-16 Thread Jinwoo Lee
On Tue, Jun 16, 2015 at 04:43 PM, Jinwoo Lee  wrote:
> Turns out my previous error was because I was running tests within Emacs
> eshell, and run_emacs failed.
>
> I tried again in a terminal and it still failed but for a different
> reason.  I don't have readelf on my Mac.

Looks like otool should be used on Mac.  But I have no idea how readelf
is used here and how it should be translated to otool.


[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-16 Thread Jinwoo Lee
Turns out my previous error was because I was running tests within Emacs
eshell, and run_emacs failed.

I tried again in a terminal and it still failed but for a different
reason.  I don't have readelf on my Mac.

$ make test
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C .. test
cd bindings/ruby && \
EXTRA_LDFLAGS="" \
LIBNOTMUCH="../../lib/libnotmuch.dylib" \
ruby extconf.rb --vendor
creating Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C bindings/ruby
linking shared-object notmuch.bundle
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib
INFO: using 2 minute timeout for tests

T000-basic: Testing the test framework itself.
./test-lib-common.sh: line 43: /Users/jinwoo/Box: No such file or directory
 PASS   success is reported like this
 PASS   test runs if prerequisite is satisfied
 PASS   tests clean up after themselves
 PASS   tests clean up even after a failure
 PASS   failure to clean up causes the test to fail
 PASS   Ensure that test output is suppressed unless the test fails
 PASS   Ensure that -v does not suppress test output
 PASS   test that mail store was created
 PASS   mail store should be empty
 PASS   NOTMUCH_CONFIG is set and points to an existing file
 FAIL   PATH is set to build directory
--- T000-basic.11.expected  2015-06-16 23:40:30.0 +
+++ T000-basic.11.output2015-06-16 23:40:30.0 +
@@ -1 +1 @@
-/Users/jinwoo/Box Sync/personal/project/notmuch
+
usage: dirname path
 FAIL   notmuch is compiled with debugging symbols
--- T000-basic.12.expected  2015-06-16 23:40:30.0 +
+++ T000-basic.12.output2015-06-16 23:40:30.0 +
@@ -1 +1 @@
-1
+0
./T000-basic.sh: line 95: readelf: command not found
./test-lib.sh: line 1062: $test_results_path: ambiguous redirect
./test-lib.sh: line 1063: $test_results_path: ambiguous redirect
./test-lib.sh: line 1064: $test_results_path: ambiguous redirect
./test-lib.sh: line 1065: $test_results_path: ambiguous redirect
./test-lib.sh: line 1066: $test_results_path: ambiguous redirect
./test-lib.sh: line 1067: $test_results_path: ambiguous redirect
make[1]: *** [test] Error 1
make: *** [test] Error 2


Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-16 Thread Jinwoo Lee
On Tue, Jun 16, 2015 at 04:43 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 Turns out my previous error was because I was running tests within Emacs
 eshell, and run_emacs failed.

 I tried again in a terminal and it still failed but for a different
 reason.  I don't have readelf on my Mac.

Looks like otool should be used on Mac.  But I have no idea how readelf
is used here and how it should be translated to otool.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-15 Thread Jinwoo Lee
> That probably will not change; IIRC bash 3.2.57 is released under GPLv2
> and bash >= 4 GPLv3. You just need to install separate bash (brew, ports,
> wherever) in order to run these tests in OS X.

I installed bash from MacPorts and ran `make test' again, but the result
is not so good.  The error message is just "make: *** [test] Error 9",
and I can't tell what exactly has failed.

Here's the log:

$ make test
cd bindings/ruby && \
EXTRA_LDFLAGS="" \
LIBNOTMUCH="../../lib/libnotmuch.dylib" \
ruby extconf.rb --vendor
creating Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C bindings/ruby
linking shared-object notmuch.bundle
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib
Use "/Applications/Xcode.app/Contents/Developer/usr/bin/make V=1" to see the 
verbose compile lines.
CC  -g -O2 test/arg-test.o
CC test/arg-test
CC  -g -O2 test/hex-xcode.o
CC test/hex-xcode
CC  -g -O2 test/random-corpus.o
CC  -g -O2 test/database-test.o
CXX test/random-corpus
CC  -g -O2 test/parse-time.o
CC test/parse-time
CC  -g -O2 test/smtp-dummy.o
CC test/smtp-dummy
CXX  -g -O2 test/symbol-test.o
test/symbol-test.cc:7:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char** argv) {
 ^
1 warning generated.
CXX test/symbol-test
CXX  -g -O2 test/make-db-version.o
CXX test/make-db-version
INFO: using 2 minute timeout for tests

T000-basic: Testing the test framework itself.
make: *** [test] Error 9


Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-15 Thread Jinwoo Lee
 That probably will not change; IIRC bash 3.2.57 is released under GPLv2
 and bash = 4 GPLv3. You just need to install separate bash (brew, ports,
 wherever) in order to run these tests in OS X.

I installed bash from MacPorts and ran `make test' again, but the result
is not so good.  The error message is just make: *** [test] Error 9,
and I can't tell what exactly has failed.

Here's the log:

$ make test
cd bindings/ruby  \
EXTRA_LDFLAGS= \
LIBNOTMUCH=../../lib/libnotmuch.dylib \
ruby extconf.rb --vendor
creating Makefile
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C bindings/ruby
linking shared-object notmuch.bundle
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib
Use /Applications/Xcode.app/Contents/Developer/usr/bin/make V=1 to see the 
verbose compile lines.
CC  -g -O2 test/arg-test.o
CC test/arg-test
CC  -g -O2 test/hex-xcode.o
CC test/hex-xcode
CC  -g -O2 test/random-corpus.o
CC  -g -O2 test/database-test.o
CXX test/random-corpus
CC  -g -O2 test/parse-time.o
CC test/parse-time
CC  -g -O2 test/smtp-dummy.o
CC test/smtp-dummy
CXX  -g -O2 test/symbol-test.o
test/symbol-test.cc:7:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char** argv) {
 ^
1 warning generated.
CXX test/symbol-test
CXX  -g -O2 test/make-db-version.o
CXX test/make-db-version
INFO: using 2 minute timeout for tests

T000-basic: Testing the test framework itself.
make: *** [test] Error 9
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-14 Thread Jinwoo Lee
On Sun, Jun 14, 2015 at 11:34 AM, David Bremner  wrote:
> Jinwoo Lee  writes:
>
>> When I apply those 2 patches from you, things seem to work.  I still get
>> warnings like below, but they don't seem severe.  I'm not sure if the
>> ruby binding actually works though.
>>
>> ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
>> x86_64 which is not the architecture being linked (i386): 
>> ../../lib/libnotmuch.dylib
>>
>
> That one is a bit worrying, but I don't know enough about OS X to know
> for sure. If you have time/interest, can you try running the tests in
>
> id:1433142542-2307-5-git-send-email-david at tethera.net
>
> Just apply the patch and make tests. That should indicate if the
> bindings are basically working.

Do you mean `make test', not `make tests'?

`make test' errors saying that the bash version must be >= 4.0.  Bash on
my mac is 3.2.57, which is the default bash installed on Yosemite.

Error: The notmuch test suite requires a bash version >= 4.0
due to use of associative arrays within the test suite.
Please try again with a newer bash (or help us fix the
test suite to be more portable). Thanks.


[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-14 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 11:53 PM, David Bremner  wrote:
> Jinwoo Lee  writes:
>
>> There are 2 problems.
>>
>> 1. The file, bindings/Makefile.local still has lib/libnotmuch.so as the
>>dependency of ruby-bindings.
>
> this is fixed in
>
>  id:1434263191-14171-1-git-send-email-david at tethera.net
>
> an updated patch sent a few minutes ago.
>
>>
>>> cd bindings/ruby && \
>>> EXTRA_LDFLAGS="" \
>>> ruby extconf.rb --vendor
>>> checking for notmuch_database_create in libnotmuch.so... no
>>> *** extconf.rb failed ***
>
> This should also be fixed by the same patch, since that test is
> eliminated.
>
>> ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
>> x86_64 which is not the architecture being linked (i386): 
>> ../../lib/libnotmuch.dylib
>
> On the other hand, this suggests there is still something broken with
> building the ruby extensions on mac. I think if noone has a better idea,
> and the updated versions of the two patches I sent to the list this
> morning don't help, I'll just add a "--without-ruby" option to the
> config script. In the long run, we probably want such an option anyway.  

When I apply those 2 patches from you, things seem to work.  I still get
warnings like below, but they don't seem severe.  I'm not sure if the
ruby binding actually works though.

ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib

Thanks, David, for the quick fix!

-jinwoo


[PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-14 Thread Jinwoo Lee
There are 2 problems.

1. The file, bindings/Makefile.local still has lib/libnotmuch.so as the
   dependency of ruby-bindings.

> make: *** No rule to make target `lib/libnotmuch.so', needed by
> `ruby-bindings'.  Stop.

2. After manually changing it to lib/libnotmuch.dylib, I still get an
   error like below:

> cd bindings/ruby && \
>   EXTRA_LDFLAGS="" \
>   ruby extconf.rb --vendor
> checking for notmuch_database_create in libnotmuch.so... no
> *** extconf.rb failed ***
> Could not create Makefile due to some reason, probably lack of
> necessary libraries and/or headers.  Check the mkmf.log file for more
> details.  You may need configuration options.

> Provided configuration options:
>   --with-opt-dir
>   --without-opt-dir
>   --with-opt-include
>   --without-opt-include=${opt-dir}/include
>   --with-opt-lib
>   --without-opt-lib=${opt-dir}/lib
>   --with-make-prog
>   --without-make-prog
>   --srcdir=.
>   --curdir
>   
> --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
> make: *** [ruby-bindings] Error 1

I tried updating extconf.rb to change libnotmuch.so to libnotmuch.dylib
but that still emit a similar error.

And the attached is the log file, mkmf.log generated in bindings/ruby.

-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: mkmf.log
URL: 

-- next part --

On Sat, Jun 13, 2015 at 10:58 PM, David Bremner  wrote:
> In particular this is supposed to help build on systems (presumably
> using a non-gnu ld) where this flag is not available.
> ---
>  bindings/Makefile.local  |  4 +++-
>  bindings/ruby/extconf.rb |  5 +++--
>  configure| 13 +
>  lib/Makefile.local   |  2 +-
>  4 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/bindings/Makefile.local b/bindings/Makefile.local
> index 16817f5..d236f01 100644
> --- a/bindings/Makefile.local
> +++ b/bindings/Makefile.local
> @@ -5,7 +5,9 @@ dir := bindings
>  # force the shared library to be built
>  ruby-bindings: lib/libnotmuch.so
>  ifeq ($(HAVE_RUBY_DEV),1)
> - cd $(dir)/ruby && ruby extconf.rb --vendor
> + cd $(dir)/ruby && \
> + EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
> + ruby extconf.rb --vendor
>   $(MAKE) -C $(dir)/ruby
>  else
>   @echo Missing dependency, skipping ruby bindings
> diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
> index 6160db2..6d5607e 100644
> --- a/bindings/ruby/extconf.rb
> +++ b/bindings/ruby/extconf.rb
> @@ -10,8 +10,9 @@ dir = File.join('..', '..', 'lib')
>  # includes
>  $INCFLAGS = "-I#{dir} #{$INCFLAGS}"
>  
> -# make sure there are no undefined symbols
> -$LDFLAGS += ' -Wl,--no-undefined'
> +if ENV['EXTRA_LDFLAGS']
> +  $LDFLAGS += " " + ENV['EXTRA_LDFLAGS']
> +end
>  
>  def have_local_library(lib, path, func, headers = nil)
>checking_for checking_message(func, lib) do
> diff --git a/configure b/configure
> index 13a8dca..b967a4e 100755
> --- a/configure
> +++ b/configure
> @@ -751,6 +751,16 @@ else
>  as_needed_ldflags=""
>  fi
>  
> +printf "Checking for -Wl,--no-undefined... "
> +if ${CC} -Wl,--no-undefined -o minimal minimal.c >/dev/null 2>&1
> +then
> +printf "Yes.\n"
> +no_undefined_ldflags="-Wl,--no-undefined"
> +else
> +printf "No (nothing to worry about).\n"
> +no_undefined_ldflags=""
> +fi
> +
>  WARN_CXXFLAGS=""
>  printf "Checking for available C++ compiler warning flags... "
>  for flag in -Wall -Wextra -Wwrite-strings; do
> @@ -955,6 +965,9 @@ RPATH_LDFLAGS = ${rpath_ldflags}
>  # Flags needed to have linker link only to necessary libraries
>  AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
>  
> +# Flags to have the linker flag undefined symbols in object files
> +NO_UNDEFINED_LDFLAGS = ${no_undefined_ldflags}
> +
>  # Whether valgrind header files are available
>  HAVE_VALGRIND = ${have_valgrind}
>  
> diff --git a/lib/Makefile.local b/lib/Makefile.local
> index f9ecd50..b58b4e8 100644
> --- a/lib/Makefile.local
> +++ b/lib/Makefile.local
> @@ -33,7 +33,7 @@ LIBRARY_SUFFIX = so
>  LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
>  SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
>  LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
> -LIBRARY_LINK_FLAG = -shared 
> -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined
> +LIBRARY_LINK_FLAG = -shared 
> -Wl,--version-script=notmuch.sym,-soname=$(SONAME) $(NO_UNDEFINED_LDFLAGS)
>  ifeq ($(PLATFORM),OPENBSD)
>  LIBRARY_LINK_FLAG += -lc
>  endif
> -- 
> 2.1.4
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-14 Thread Jinwoo Lee
There are 2 problems.

1. The file, bindings/Makefile.local still has lib/libnotmuch.so as the
   dependency of ruby-bindings.

 make: *** No rule to make target `lib/libnotmuch.so', needed by
 `ruby-bindings'.  Stop.

2. After manually changing it to lib/libnotmuch.dylib, I still get an
   error like below:

 cd bindings/ruby  \
   EXTRA_LDFLAGS= \
   ruby extconf.rb --vendor
 checking for notmuch_database_create in libnotmuch.so... no
 *** extconf.rb failed ***
 Could not create Makefile due to some reason, probably lack of
 necessary libraries and/or headers.  Check the mkmf.log file for more
 details.  You may need configuration options.

 Provided configuration options:
   --with-opt-dir
   --without-opt-dir
   --with-opt-include
   --without-opt-include=${opt-dir}/include
   --with-opt-lib
   --without-opt-lib=${opt-dir}/lib
   --with-make-prog
   --without-make-prog
   --srcdir=.
   --curdir
   
 --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
 make: *** [ruby-bindings] Error 1

I tried updating extconf.rb to change libnotmuch.so to libnotmuch.dylib
but that still emit a similar error.

And the attached is the log file, mkmf.log generated in bindings/ruby.

have_local_library: checking for notmuch_database_create in libnotmuch.dylib... 
 no

xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib-arch x86_64 -arch i386   -lruby.2.0.0  -lpthread -ldl 
-lobjc 
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
checked program was:
/* begin */
1: #include ruby.h
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib-arch x86_64 -arch i386   -lruby.2.0.0 
../../lib/libnotmuch.dylib -lpthread -ldl -lobjc 
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib
Undefined symbols for architecture i386:
  _notmuch_database_create, referenced from:
  _t in conftest-2cad94.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include ruby.h
 2: 
 3: #include notmuch.h
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int t(void) { void ((*volatile p)()); p = (void 
((*)()))notmuch_database_create; return 0; }
 8: int main(int argc, char **argv)
 9: {
10:   if (argc  100) {
11: printf(%p, t);
12:   }
13: 
14:   return 0;
15: }
/* end */

xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib-arch x86_64 -arch i386   -lruby.2.0.0 
../../lib/libnotmuch.dylib -lpthread -ldl -lobjc 
conftest.c:7:39: error: too few arguments to function call, expected 2, have 0
int t(void) { notmuch_database_create(); return 0; }
  ~~~ ^
../../lib/notmuch.h:234:1: note: 'notmuch_database_create' declared here
notmuch_status_t
^
1 error generated.
checked program was:
/* begin */
 1: #include ruby.h
 2: 
 3: #include notmuch.h
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int t(void) { notmuch_database_create(); return 0; }
 8: int main(int argc, char **argv)
 9: {
10:   if (argc  100) {
11: printf(%p, t);
12:   }
13: 
14:   return 0;
15: }
/* end */


Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-14 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 11:53 PM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 There are 2 problems.

 1. The file, bindings/Makefile.local still has lib/libnotmuch.so as the
dependency of ruby-bindings.

 this is fixed in

  id:1434263191-14171-1-git-send-email-da...@tethera.net

 an updated patch sent a few minutes ago.


 cd bindings/ruby  \
 EXTRA_LDFLAGS= \
 ruby extconf.rb --vendor
 checking for notmuch_database_create in libnotmuch.so... no
 *** extconf.rb failed ***

 This should also be fixed by the same patch, since that test is
 eliminated.

 ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
 x86_64 which is not the architecture being linked (i386): 
 ../../lib/libnotmuch.dylib

 On the other hand, this suggests there is still something broken with
 building the ruby extensions on mac. I think if noone has a better idea,
 and the updated versions of the two patches I sent to the list this
 morning don't help, I'll just add a --without-ruby option to the
 config script. In the long run, we probably want such an option anyway.  

When I apply those 2 patches from you, things seem to work.  I still get
warnings like below, but they don't seem severe.  I'm not sure if the
ruby binding actually works though.

ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: directory not found for option '-L/usr/local/lib'
ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
x86_64 which is not the architecture being linked (i386): 
../../lib/libnotmuch.dylib

Thanks, David, for the quick fix!

-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] lib, ruby: make use of -Wl,--no-undefined configurable

2015-06-14 Thread Jinwoo Lee
On Sun, Jun 14, 2015 at 11:34 AM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 When I apply those 2 patches from you, things seem to work.  I still get
 warnings like below, but they don't seem severe.  I'm not sure if the
 ruby binding actually works though.

 ld: warning: ignoring file ../../lib/libnotmuch.dylib, file was built for 
 x86_64 which is not the architecture being linked (i386): 
 ../../lib/libnotmuch.dylib


 That one is a bit worrying, but I don't know enough about OS X to know
 for sure. If you have time/interest, can you try running the tests in

 id:1433142542-2307-5-git-send-email-da...@tethera.net

 Just apply the patch and make tests. That should indicate if the
 bindings are basically working.

Do you mean `make test', not `make tests'?

`make test' errors saying that the bash version must be = 4.0.  Bash on
my mac is 3.2.57, which is the default bash installed on Yosemite.

Error: The notmuch test suite requires a bash version = 4.0
due to use of associative arrays within the test suite.
Please try again with a newer bash (or help us fix the
test suite to be more portable). Thanks.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:24 PM, Jinwoo Lee  wrote:
> That error is from 'cd bindings/ruby && ruby extconf.rb --vendor' BTW.

The contents of mkmf.log are below.  It shows a warning about
-L/usr/local/lib and I don't have the directory /usr/local/lib on my
machine.  I'm not sure if that's the cause of the error though.  I don't
write Ruby and know nothing about it.

"xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib -Wl,--no-undefined   -arch x86_64 -arch i386   -lruby.2.0.0  
-lpthread -ldl -lobjc "
ld: warning: directory not found for option '-L/usr/local/lib'
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
That error is from 'cd bindings/ruby && ruby extconf.rb --vendor' BTW.


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:11 PM, David Bremner  wrote:
> Jinwoo Lee  writes:
>
>>> I with configure has an option to skip the ruby-bindings build.
>>
>> `configure' seems to try to detect whether the ruby development tools
>> are installed.  It thinks I have them but I don't actually, and that's
>> why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
>> Makefile.config, everything's fine.
>
> Thanks for narrowing this down. Can you tell us the output of
>
> % ruby -e "require 'mkmf'" ; echo $?

This command succeeds and returns 0.

When I change the dependency of ruby-bindings from libnotmuch.so to
libnotmuch.dylib and run `make', I get errors like below.

Looks like mkmf.rb (I have no idea what this is) is provided by OS X by
default, but actually running it fails.

...
[snip]
...
checking for notmuch_database_create in libnotmuch.so... *** extconf.rb failed 
***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir

--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in
 `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:513:in
 `block in try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in
 `mktmpdir'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:510:in
 `try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:534:in
 `try_link'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:720:in
 `try_func'
from extconf.rb:19:in `block in have_local_library'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in
 `block in checking_for'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block (2 levels) in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in
 `postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in
 `checking_for'
from extconf.rb:17:in `have_local_library'
from extconf.rb:25:in `'
make: *** [ruby-bindings] Error 1



[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 01:46 PM, Jinwoo Lee  wrote:
> On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee  wrote:
>> This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
>> should be lib/libnotmuch.dylib on OS X.
>>
>> That makes `make' and `make install' fail.
>
> Even after I update the dependency to lib/libnotmuch.dylib, building
> ruby-bindings fails because I don't have the ruby development tools
> installed on my machine.
>
> I with configure has an option to skip the ruby-bindings build.

`configure' seems to try to detect whether the ruby development tools
are installed.  It thinks I have them but I don't actually, and that's
why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
Makefile.config, everything's fine.


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee  wrote:
> This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
> should be lib/libnotmuch.dylib on OS X.
>
> That makes `make' and `make install' fail.

Even after I update the dependency to lib/libnotmuch.dylib, building
ruby-bindings fails because I don't have the ruby development tools
installed on my machine.

I with configure has an option to skip the ruby-bindings build.

>
> On Fri, Jun 12, 2015 at 11:37 PM, David Bremner  wrote:
>> David Bremner  writes:
>>
>>> Because ruby generates a Makefile, we have to use recursive make.
>>> Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
>>> in the parent directory.
>>
>> Pushed the first patch in the series. Let's see if anything breaks.
>>
>> d
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


[patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
should be lib/libnotmuch.dylib on OS X.

That makes `make' and `make install' fail.

On Fri, Jun 12, 2015 at 11:37 PM, David Bremner  wrote:
> David Bremner  writes:
>
>> Because ruby generates a Makefile, we have to use recursive make.
>> Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
>> in the parent directory.
>
> Pushed the first patch in the series. Let's see if anything breaks.
>
> d
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
should be lib/libnotmuch.dylib on OS X.

That makes `make' and `make install' fail.

On Fri, Jun 12, 2015 at 11:37 PM, David Bremner da...@tethera.net wrote:
 David Bremner da...@tethera.net writes:

 Because ruby generates a Makefile, we have to use recursive make.
 Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
 in the parent directory.

 Pushed the first patch in the series. Let's see if anything breaks.

 d
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
 should be lib/libnotmuch.dylib on OS X.

 That makes `make' and `make install' fail.

Even after I update the dependency to lib/libnotmuch.dylib, building
ruby-bindings fails because I don't have the ruby development tools
installed on my machine.

I with configure has an option to skip the ruby-bindings build.


 On Fri, Jun 12, 2015 at 11:37 PM, David Bremner da...@tethera.net wrote:
 David Bremner da...@tethera.net writes:

 Because ruby generates a Makefile, we have to use recursive make.
 Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local}
 in the parent directory.

 Pushed the first patch in the series. Let's see if anything breaks.

 d
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 01:46 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 On Sat, Jun 13, 2015 at 12:59 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 This breaks Mac OS X.  ruby-bindings depends on lib/libnotmuch.so but it
 should be lib/libnotmuch.dylib on OS X.

 That makes `make' and `make install' fail.

 Even after I update the dependency to lib/libnotmuch.dylib, building
 ruby-bindings fails because I don't have the ruby development tools
 installed on my machine.

 I with configure has an option to skip the ruby-bindings build.

`configure' seems to try to detect whether the ruby development tools
are installed.  It thinks I have them but I don't actually, and that's
why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
Makefile.config, everything's fine.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:11 PM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 I with configure has an option to skip the ruby-bindings build.

 `configure' seems to try to detect whether the ruby development tools
 are installed.  It thinks I have them but I don't actually, and that's
 why my build fails.  When I manually set 'HAVE_RUBY_DEV = 0' in
 Makefile.config, everything's fine.

 Thanks for narrowing this down. Can you tell us the output of

 % ruby -e require 'mkmf' ; echo $?

This command succeeds and returns 0.

When I change the dependency of ruby-bindings from libnotmuch.so to
libnotmuch.dylib and run `make', I get errors like below.

Looks like mkmf.rb (I have no idea what this is) is provided by OS X by
default, but actually running it fails.

...
[snip]
...
checking for notmuch_database_create in libnotmuch.so... *** extconf.rb failed 
***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir

--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in
 `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:513:in
 `block in try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:88:in
 `mktmpdir'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:510:in
 `try_link0'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:534:in
 `try_link'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:720:in
 `try_func'
from extconf.rb:19:in `block in have_local_library'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in
 `block in checking_for'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block (2 levels) in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in
 `block in postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in
 `open'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in
 `postpone'
from 
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in
 `checking_for'
from extconf.rb:17:in `have_local_library'
from extconf.rb:25:in `main'
make: *** [ruby-bindings] Error 1

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
That error is from 'cd bindings/ruby  ruby extconf.rb --vendor' BTW.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [patch v3 1/4] build: integrate building ruby bindings into notmuch build process

2015-06-13 Thread Jinwoo Lee
On Sat, Jun 13, 2015 at 02:24 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 That error is from 'cd bindings/ruby  ruby extconf.rb --vendor' BTW.

The contents of mkmf.log are below.  It shows a warning about
-L/usr/local/lib and I don't have the directory /usr/local/lib on my
machine.  I'm not sure if that's the cause of the error though.  I don't
write Ruby and know nothing about it.

xcrun clang -o conftest -I../../lib 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin14
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/backward
 
-I/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 
-I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT  
  -g -Os -pipe -DHAVE_GCC_SYNC_BUILTINS conftest.c  -L. 
-L/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib -L. 
-L/usr/local/lib -Wl,--no-undefined   -arch x86_64 -arch i386   -lruby.2.0.0  
-lpthread -ldl -lobjc 
ld: warning: directory not found for option '-L/usr/local/lib'
ld: unknown option: --no-undefined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include ruby.h
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Is notmuchmail.org down?

2015-04-03 Thread Jinwoo Lee
I can't access the web site or the git repository since yesterday.  Are
we experiencing an outage?  I'm not sure if this email will be delivered
at all.

-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Is notmuchmail.org down?

2015-04-02 Thread Jinwoo Lee
I can't access the web site or the git repository since yesterday.  Are
we experiencing an outage?  I'm not sure if this email will be delivered
at all.

-jinwoo


[PATCH v2] lib: make notmuch shared library install_name be full path on Mac OS X

2015-03-04 Thread Jinwoo Lee
On Wed, Mar  4, 2015 at 02:32 PM, "J. Lewis Muir"  
wrote:
> The install_name of libnotmuch.dylib on Mac OS X is what is written
> into a program that links against it.  If it is just the name of the
> shared library file, as opposed to the full path, the program won't be
> able to find it when it runs and will abort.  Instead, the install_name
> should be the full path to the shared library (in its final installed
> location).

Thanks for this fix!  I built notmuch last night on my mac using the
prefix of "/opt/local", and it revealed this problem.  Manually moving
libnotmuch.dylib to $HOME/lib fixed it.  I'll try again once this patch
is checked in.

>
> Why does Notmuch work without this patch when installed via Homebrew?
> The answer is twofold.  One, /usr/local/lib is a special location in
> which the dynamic linker will look by default to find shared libraries.
> Homebrew highly recommends installing to /usr/local, and, assuming it
> has been configured this way, the Notmuch library will end up installed
> in /usr/local/lib, and the dynamic linker will find it.  Two, Homebrew
> globally corrects all install names in dynamically shared libraries and
> binaries for each package it installs.  So, even if the install names in
> a package's binaries and libraries are incorrect, Homebrew corrects them
> automatically, and no one ever knows.
>
> Why does Notmuch work without this patch when installed via MacPorts?
> The answer is that MacPorts applies a patch just like this patch to fix
> the same problem.


Re: [PATCH v2] lib: make notmuch shared library install_name be full path on Mac OS X

2015-03-04 Thread Jinwoo Lee
On Wed, Mar  4, 2015 at 02:32 PM, J. Lewis Muir jlm...@imca-cat.org wrote:
 The install_name of libnotmuch.dylib on Mac OS X is what is written
 into a program that links against it.  If it is just the name of the
 shared library file, as opposed to the full path, the program won't be
 able to find it when it runs and will abort.  Instead, the install_name
 should be the full path to the shared library (in its final installed
 location).

Thanks for this fix!  I built notmuch last night on my mac using the
prefix of /opt/local, and it revealed this problem.  Manually moving
libnotmuch.dylib to $HOME/lib fixed it.  I'll try again once this patch
is checked in.


 Why does Notmuch work without this patch when installed via Homebrew?
 The answer is twofold.  One, /usr/local/lib is a special location in
 which the dynamic linker will look by default to find shared libraries.
 Homebrew highly recommends installing to /usr/local, and, assuming it
 has been configured this way, the Notmuch library will end up installed
 in /usr/local/lib, and the dynamic linker will find it.  Two, Homebrew
 globally corrects all install names in dynamically shared libraries and
 binaries for each package it installs.  So, even if the install names in
 a package's binaries and libraries are incorrect, Homebrew corrects them
 automatically, and no one ever knows.

 Why does Notmuch work without this patch when installed via MacPorts?
 The answer is that MacPorts applies a patch just like this patch to fix
 the same problem.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


No love for MacPorts?

2015-02-04 Thread Jinwoo Lee
I'm using the MacPorts version of notmuch.  And I notice that it's stuck
with 0.18.1.  It looks like 0.18.2 was released in October and 0.19 in
November.  Are we not maintaining MacPorts anymore?

-jinwoo


No love for MacPorts?

2015-02-04 Thread Jinwoo Lee
I'm using the MacPorts version of notmuch.  And I notice that it's stuck
with 0.18.1.  It looks like 0.18.2 was released in October and 0.19 in
November.  Are we not maintaining MacPorts anymore?

-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
On Mon, Feb  2, 2015 at 02:15 PM, David Bremner  wrote:
> Jinwoo Lee  writes:
>
>> And what's the process for checking the code in?  I just push to the
>> repo?
>>
>> -jinwoo
>
> Hi Jinwoo;
>
> I pushed it. We're pretty miserly with push access, but once you get
> through the reviews, getting the code in is quick.

Great.

>
> Welcome aboard ;).

Thanks!  Hope I can contribute more soon.

>
> d


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
And what's the process for checking the code in?  I just push to the
repo?

-jinwoo


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
It's default value is ".", meaning all remote images will be blocked
by default.

---
Addressed review comments.
---
 emacs/notmuch-show.el | 24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..f4ad802 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,13 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)

+;; By default, block all external images to prevent privacy leaks and
+;; potential attacks.
+(defcustom notmuch-show-text/html-blocked-images "."
+  "Remote images that have URLs matching this regexp will be blocked."
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -771,14 +778,21 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; It's easier to drive shr ourselves than to work around the
   ;; goofy things `mm-shr' does (like irreversibly taking over
   ;; content ID handling).
-  (notmuch-show--insert-part-text/html-shr msg part)
+
+  ;; FIXME: If we block an image, offer a button to load external
+  ;; images.
+  (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
+   (notmuch-show--insert-part-text/html-shr msg part))
 ;; Otherwise, let message-mode do the heavy lifting
 ;;
 ;; w3m sets up a keymap which "leaks" outside the invisible region
 ;; and causes strange effects in notmuch. We set
 ;; mm-inline-text-html-with-w3m-keymap to nil to tell w3m not to
 ;; set a keymap (so the normal notmuch-show-mode-map remains).
-(let ((mm-inline-text-html-with-w3m-keymap nil))
+(let ((mm-inline-text-html-with-w3m-keymap nil)
+ ;; FIXME: If we block an image, offer a button to load external
+ ;; images.
+ (gnus-blocked-images notmuch-show-text/html-blocked-images))
   (notmuch-show-insert-part-*/* msg part content-type nth depth button

 ;; These functions are used by notmuch-show--insert-part-text/html-shr
@@ -797,11 +811,7 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; shr strips the "cid:" part of URL, but doesn't
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
-(first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images "."))
+(first (notmuch-show--get-cid-content cid))
 (shr-insert-document dom)
 t))

-- 
2.2.2



[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
On Mon, Feb  2, 2015 at 12:32 PM, Tomi Ollila  wrote:
> On Mon, Feb 02 2015, Jinwoo Lee  wrote:
>
>> It's default value is ".", meaning all remote images will be blocked
>> by default.
>>
>> ---
>> Addressed review comments.
>
> Ok, looks good to me. David can perhaps amend away the (accidental)
> whitespace change in the last hunk ?

Ah, sorry about that.  I can revert if needed.

>
> Tomi
>
>
>> ---
>>  emacs/notmuch-show.el | 27 +++
>>  1 file changed, 19 insertions(+), 8 deletions(-)
>>
>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
>> index 66350d4..5d939bb 100644
>> --- a/emacs/notmuch-show.el
>> +++ b/emacs/notmuch-show.el
>> @@ -136,6 +136,13 @@ indentation."
>>:type 'boolean
>>:group 'notmuch-show)
>>  
>> +;; By default, block all external images to prevent privacy leaks and
>> +;; potential attacks.
>> +(defcustom notmuch-show-text/html-blocked-images "."
>> +  "Remote images that have URLs matching this regexp will be blocked."
>> +  :type '(choice (const nil) regexp)
>> +  :group 'notmuch-show)
>> +
>>  (defvar notmuch-show-thread-id nil)
>>  (make-variable-buffer-local 'notmuch-show-thread-id)
>>  (put 'notmuch-show-thread-id 'permanent-local t)
>> @@ -771,14 +778,21 @@ will return nil if the CID is unknown or cannot be 
>> retrieved."
>>;; It's easier to drive shr ourselves than to work around the
>>;; goofy things `mm-shr' does (like irreversibly taking over
>>;; content ID handling).
>> -  (notmuch-show--insert-part-text/html-shr msg part)
>> +
>> +  ;; FIXME: If we block an image, offer a button to load external
>> +  ;; images.
>> +  (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
>> +(notmuch-show--insert-part-text/html-shr msg part))
>>  ;; Otherwise, let message-mode do the heavy lifting
>>  ;;
>>  ;; w3m sets up a keymap which "leaks" outside the invisible region
>>  ;; and causes strange effects in notmuch. We set
>>  ;; mm-inline-text-html-with-w3m-keymap to nil to tell w3m not to
>>  ;; set a keymap (so the normal notmuch-show-mode-map remains).
>> -(let ((mm-inline-text-html-with-w3m-keymap nil))
>> +(let ((mm-inline-text-html-with-w3m-keymap nil)
>> +  ;; FIXME: If we block an image, offer a button to load external
>> +  ;; images.
>> +  (gnus-blocked-images notmuch-show-text/html-blocked-images))
>>(notmuch-show-insert-part-*/* msg part content-type nth depth 
>> button
>>  
>>  ;; These functions are used by notmuch-show--insert-part-text/html-shr
>> @@ -797,17 +811,14 @@ will return nil if the CID is unknown or cannot be 
>> retrieved."
>> ;; shr strips the "cid:" part of URL, but doesn't
>> ;; URL-decode it (see RFC 2392).
>> (let ((cid (url-unhex-string url)))
>> - (first (notmuch-show--get-cid-content cid)
>> -;; Block all external images to prevent privacy leaks and
>> -;; potential attacks.  FIXME: If we block an image, offer a
>> -;; button to load external images.
>> -(shr-blocked-images "."))
>> + (first (notmuch-show--get-cid-content cid))
>>  (shr-insert-document dom)
>>  t))
>>  
>>  (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
>>;; This handler _must_ succeed - it is the handler of last resort.
>> -  (notmuch-mm-display-part-inline msg part content-type 
>> notmuch-show-process-crypto)
>> +  (notmuch-mm-display-part-inline msg part content-type
>> +  notmuch-show-process-crypto)
>>t)
>>  
>>  ;; Functions for determining how to handle MIME parts.
>> -- 
>> 2.2.2
>>
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
Thanks for the review, guys.  Sent yet another patch.  BTW I'm not sure
if I should specify --in-reply-to when sending updates.

-jinwoo


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
It's default value is ".", meaning all remote images will be blocked
by default.

---
Addressed review comments.
---
 emacs/notmuch-show.el | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..5d939bb 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,13 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)

+;; By default, block all external images to prevent privacy leaks and
+;; potential attacks.
+(defcustom notmuch-show-text/html-blocked-images "."
+  "Remote images that have URLs matching this regexp will be blocked."
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -771,14 +778,21 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; It's easier to drive shr ourselves than to work around the
   ;; goofy things `mm-shr' does (like irreversibly taking over
   ;; content ID handling).
-  (notmuch-show--insert-part-text/html-shr msg part)
+
+  ;; FIXME: If we block an image, offer a button to load external
+  ;; images.
+  (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
+   (notmuch-show--insert-part-text/html-shr msg part))
 ;; Otherwise, let message-mode do the heavy lifting
 ;;
 ;; w3m sets up a keymap which "leaks" outside the invisible region
 ;; and causes strange effects in notmuch. We set
 ;; mm-inline-text-html-with-w3m-keymap to nil to tell w3m not to
 ;; set a keymap (so the normal notmuch-show-mode-map remains).
-(let ((mm-inline-text-html-with-w3m-keymap nil))
+(let ((mm-inline-text-html-with-w3m-keymap nil)
+ ;; FIXME: If we block an image, offer a button to load external
+ ;; images.
+ (gnus-blocked-images notmuch-show-text/html-blocked-images))
   (notmuch-show-insert-part-*/* msg part content-type nth depth button

 ;; These functions are used by notmuch-show--insert-part-text/html-shr
@@ -797,17 +811,14 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; shr strips the "cid:" part of URL, but doesn't
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
-(first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images "."))
+(first (notmuch-show--get-cid-content cid))
 (shr-insert-document dom)
 t))

 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
   ;; This handler _must_ succeed - it is the handler of last resort.
-  (notmuch-mm-display-part-inline msg part content-type 
notmuch-show-process-crypto)
+  (notmuch-mm-display-part-inline msg part content-type
+ notmuch-show-process-crypto)
   t)

 ;; Functions for determining how to handle MIME parts.
-- 
2.2.2



Re: [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
And what's the process for checking the code in?  I just push to the
repo?

-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
On Mon, Feb  2, 2015 at 02:15 PM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 And what's the process for checking the code in?  I just push to the
 repo?

 -jinwoo

 Hi Jinwoo;

 I pushed it. We're pretty miserly with push access, but once you get
 through the reviews, getting the code in is quick.

Great.


 Welcome aboard ;).

Thanks!  Hope I can contribute more soon.


 d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
It's default value is ., meaning all remote images will be blocked
by default.

---
Addressed review comments.
---
 emacs/notmuch-show.el | 24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..f4ad802 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,13 @@ indentation.
   :type 'boolean
   :group 'notmuch-show)
 
+;; By default, block all external images to prevent privacy leaks and
+;; potential attacks.
+(defcustom notmuch-show-text/html-blocked-images .
+  Remote images that have URLs matching this regexp will be blocked.
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -771,14 +778,21 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; It's easier to drive shr ourselves than to work around the
   ;; goofy things `mm-shr' does (like irreversibly taking over
   ;; content ID handling).
-  (notmuch-show--insert-part-text/html-shr msg part)
+
+  ;; FIXME: If we block an image, offer a button to load external
+  ;; images.
+  (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
+   (notmuch-show--insert-part-text/html-shr msg part))
 ;; Otherwise, let message-mode do the heavy lifting
 ;;
 ;; w3m sets up a keymap which leaks outside the invisible region
 ;; and causes strange effects in notmuch. We set
 ;; mm-inline-text-html-with-w3m-keymap to nil to tell w3m not to
 ;; set a keymap (so the normal notmuch-show-mode-map remains).
-(let ((mm-inline-text-html-with-w3m-keymap nil))
+(let ((mm-inline-text-html-with-w3m-keymap nil)
+ ;; FIXME: If we block an image, offer a button to load external
+ ;; images.
+ (gnus-blocked-images notmuch-show-text/html-blocked-images))
   (notmuch-show-insert-part-*/* msg part content-type nth depth button
 
 ;; These functions are used by notmuch-show--insert-part-text/html-shr
@@ -797,11 +811,7 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; shr strips the cid: part of URL, but doesn't
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
-(first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images .))
+(first (notmuch-show--get-cid-content cid))
 (shr-insert-document dom)
 t))
 
-- 
2.2.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
On Mon, Feb  2, 2015 at 12:32 PM, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Mon, Feb 02 2015, Jinwoo Lee jinwo...@gmail.com wrote:

 It's default value is ., meaning all remote images will be blocked
 by default.

 ---
 Addressed review comments.

 Ok, looks good to me. David can perhaps amend away the (accidental)
 whitespace change in the last hunk ?

Ah, sorry about that.  I can revert if needed.


 Tomi


 ---
  emacs/notmuch-show.el | 27 +++
  1 file changed, 19 insertions(+), 8 deletions(-)

 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
 index 66350d4..5d939bb 100644
 --- a/emacs/notmuch-show.el
 +++ b/emacs/notmuch-show.el
 @@ -136,6 +136,13 @@ indentation.
:type 'boolean
:group 'notmuch-show)
  
 +;; By default, block all external images to prevent privacy leaks and
 +;; potential attacks.
 +(defcustom notmuch-show-text/html-blocked-images .
 +  Remote images that have URLs matching this regexp will be blocked.
 +  :type '(choice (const nil) regexp)
 +  :group 'notmuch-show)
 +
  (defvar notmuch-show-thread-id nil)
  (make-variable-buffer-local 'notmuch-show-thread-id)
  (put 'notmuch-show-thread-id 'permanent-local t)
 @@ -771,14 +778,21 @@ will return nil if the CID is unknown or cannot be 
 retrieved.
;; It's easier to drive shr ourselves than to work around the
;; goofy things `mm-shr' does (like irreversibly taking over
;; content ID handling).
 -  (notmuch-show--insert-part-text/html-shr msg part)
 +
 +  ;; FIXME: If we block an image, offer a button to load external
 +  ;; images.
 +  (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
 +(notmuch-show--insert-part-text/html-shr msg part))
  ;; Otherwise, let message-mode do the heavy lifting
  ;;
  ;; w3m sets up a keymap which leaks outside the invisible region
  ;; and causes strange effects in notmuch. We set
  ;; mm-inline-text-html-with-w3m-keymap to nil to tell w3m not to
  ;; set a keymap (so the normal notmuch-show-mode-map remains).
 -(let ((mm-inline-text-html-with-w3m-keymap nil))
 +(let ((mm-inline-text-html-with-w3m-keymap nil)
 +  ;; FIXME: If we block an image, offer a button to load external
 +  ;; images.
 +  (gnus-blocked-images notmuch-show-text/html-blocked-images))
(notmuch-show-insert-part-*/* msg part content-type nth depth 
 button
  
  ;; These functions are used by notmuch-show--insert-part-text/html-shr
 @@ -797,17 +811,14 @@ will return nil if the CID is unknown or cannot be 
 retrieved.
 ;; shr strips the cid: part of URL, but doesn't
 ;; URL-decode it (see RFC 2392).
 (let ((cid (url-unhex-string url)))
 - (first (notmuch-show--get-cid-content cid)
 -;; Block all external images to prevent privacy leaks and
 -;; potential attacks.  FIXME: If we block an image, offer a
 -;; button to load external images.
 -(shr-blocked-images .))
 + (first (notmuch-show--get-cid-content cid))
  (shr-insert-document dom)
  t))
  
  (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
;; This handler _must_ succeed - it is the handler of last resort.
 -  (notmuch-mm-display-part-inline msg part content-type 
 notmuch-show-process-crypto)
 +  (notmuch-mm-display-part-inline msg part content-type
 +  notmuch-show-process-crypto)
t)
  
  ;; Functions for determining how to handle MIME parts.
 -- 
 2.2.2

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
It's default value is ., meaning all remote images will be blocked
by default.

---
Addressed review comments.
---
 emacs/notmuch-show.el | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..5d939bb 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,13 @@ indentation.
   :type 'boolean
   :group 'notmuch-show)
 
+;; By default, block all external images to prevent privacy leaks and
+;; potential attacks.
+(defcustom notmuch-show-text/html-blocked-images .
+  Remote images that have URLs matching this regexp will be blocked.
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -771,14 +778,21 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; It's easier to drive shr ourselves than to work around the
   ;; goofy things `mm-shr' does (like irreversibly taking over
   ;; content ID handling).
-  (notmuch-show--insert-part-text/html-shr msg part)
+
+  ;; FIXME: If we block an image, offer a button to load external
+  ;; images.
+  (let ((shr-blocked-images notmuch-show-text/html-blocked-images))
+   (notmuch-show--insert-part-text/html-shr msg part))
 ;; Otherwise, let message-mode do the heavy lifting
 ;;
 ;; w3m sets up a keymap which leaks outside the invisible region
 ;; and causes strange effects in notmuch. We set
 ;; mm-inline-text-html-with-w3m-keymap to nil to tell w3m not to
 ;; set a keymap (so the normal notmuch-show-mode-map remains).
-(let ((mm-inline-text-html-with-w3m-keymap nil))
+(let ((mm-inline-text-html-with-w3m-keymap nil)
+ ;; FIXME: If we block an image, offer a button to load external
+ ;; images.
+ (gnus-blocked-images notmuch-show-text/html-blocked-images))
   (notmuch-show-insert-part-*/* msg part content-type nth depth button
 
 ;; These functions are used by notmuch-show--insert-part-text/html-shr
@@ -797,17 +811,14 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; shr strips the cid: part of URL, but doesn't
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
-(first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images .))
+(first (notmuch-show--get-cid-content cid))
 (shr-insert-document dom)
 t))
 
 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
   ;; This handler _must_ succeed - it is the handler of last resort.
-  (notmuch-mm-display-part-inline msg part content-type 
notmuch-show-process-crypto)
+  (notmuch-mm-display-part-inline msg part content-type
+ notmuch-show-process-crypto)
   t)
 
 ;; Functions for determining how to handle MIME parts.
-- 
2.2.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-02-02 Thread Jinwoo Lee
Thanks for the review, guys.  Sent yet another patch.  BTW I'm not sure
if I should specify --in-reply-to when sending updates.

-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-01-30 Thread Jinwoo Lee
Can someone take a look please?

On Thu, Jan 29, 2015 at 01:35 PM, Jinwoo Lee  wrote:
> It's default value is ".", meaning all remote images will be blocked
> by default.
>
> ---
> This time setting gnus-blocked-images from the correct place.
> ---
>  emacs/notmuch-show.el | 23 ++-
>  1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 66350d4..6f38e0c 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -136,6 +136,11 @@ indentation."
>:type 'boolean
>:group 'notmuch-show)
>  
> +(defcustom notmuch-show-text/html-blocked-images "."
> +  "Remote images that have URLs matching this regexp will be blocked."
> +  :type '(choice (const nil) regexp)
> +  :group 'notmuch-show)
> +
>  (defvar notmuch-show-thread-id nil)
>  (make-variable-buffer-local 'notmuch-show-thread-id)
>  (put 'notmuch-show-thread-id 'permanent-local t)
> @@ -798,16 +803,24 @@ will return nil if the CID is unknown or cannot be 
> retrieved."
>  ;; URL-decode it (see RFC 2392).
>  (let ((cid (url-unhex-string url)))
>(first (notmuch-show--get-cid-content cid)
> - ;; Block all external images to prevent privacy leaks and
> - ;; potential attacks.  FIXME: If we block an image, offer a
> - ;; button to load external images.
> - (shr-blocked-images "."))
> + ;; By default, block all external images to prevent privacy
> + ;; leaks and potential attacks.  FIXME: If we block an image,
> + ;; offer a button to load external images.
> + (shr-blocked-images notmuch-show-text/html-blocked-images))
>  (shr-insert-document dom)
>  t))
>  
>  (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
>;; This handler _must_ succeed - it is the handler of last resort.
> -  (notmuch-mm-display-part-inline msg part content-type 
> notmuch-show-process-crypto)
> +
> +  ;; By default, block all external images to prevent privacy leaks
> +  ;; and potential attacks.  FIXME: If we block an image, offer a
> +  ;; button to load external images.
> +  ;; Note that GNUS-BLOCKED-IMAGES is effective only when
> +  ;; MM-TEXT-HTML-RENDERER is 'gnus-w3m.
> +  (let ((gnus-blocked-images notmuch-show-text/html-blocked-images))
> +(notmuch-mm-display-part-inline msg part content-type
> + notmuch-show-process-crypto))
>t)
>  
>  ;; Functions for determining how to handle MIME parts.
> -- 
> 2.2.2


Re: [PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-01-30 Thread Jinwoo Lee
Can someone take a look please?

On Thu, Jan 29, 2015 at 01:35 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 It's default value is ., meaning all remote images will be blocked
 by default.

 ---
 This time setting gnus-blocked-images from the correct place.
 ---
  emacs/notmuch-show.el | 23 ++-
  1 file changed, 18 insertions(+), 5 deletions(-)

 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
 index 66350d4..6f38e0c 100644
 --- a/emacs/notmuch-show.el
 +++ b/emacs/notmuch-show.el
 @@ -136,6 +136,11 @@ indentation.
:type 'boolean
:group 'notmuch-show)
  
 +(defcustom notmuch-show-text/html-blocked-images .
 +  Remote images that have URLs matching this regexp will be blocked.
 +  :type '(choice (const nil) regexp)
 +  :group 'notmuch-show)
 +
  (defvar notmuch-show-thread-id nil)
  (make-variable-buffer-local 'notmuch-show-thread-id)
  (put 'notmuch-show-thread-id 'permanent-local t)
 @@ -798,16 +803,24 @@ will return nil if the CID is unknown or cannot be 
 retrieved.
  ;; URL-decode it (see RFC 2392).
  (let ((cid (url-unhex-string url)))
(first (notmuch-show--get-cid-content cid)
 - ;; Block all external images to prevent privacy leaks and
 - ;; potential attacks.  FIXME: If we block an image, offer a
 - ;; button to load external images.
 - (shr-blocked-images .))
 + ;; By default, block all external images to prevent privacy
 + ;; leaks and potential attacks.  FIXME: If we block an image,
 + ;; offer a button to load external images.
 + (shr-blocked-images notmuch-show-text/html-blocked-images))
  (shr-insert-document dom)
  t))
  
  (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
;; This handler _must_ succeed - it is the handler of last resort.
 -  (notmuch-mm-display-part-inline msg part content-type 
 notmuch-show-process-crypto)
 +
 +  ;; By default, block all external images to prevent privacy leaks
 +  ;; and potential attacks.  FIXME: If we block an image, offer a
 +  ;; button to load external images.
 +  ;; Note that GNUS-BLOCKED-IMAGES is effective only when
 +  ;; MM-TEXT-HTML-RENDERER is 'gnus-w3m.
 +  (let ((gnus-blocked-images notmuch-show-text/html-blocked-images))
 +(notmuch-mm-display-part-inline msg part content-type
 + notmuch-show-process-crypto))
t)
  
  ;; Functions for determining how to handle MIME parts.
 -- 
 2.2.2
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 01:39 PM, Jinwoo Lee  wrote:
> Sent another patch.  I couldn't test it with gnus-w3m though because I
> don't have w3m on my machine now.

I installed w3m and verified that my patch works with gnus-w3m too.


[PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 12:57 PM, Jinwoo Lee  wrote:
> On Thu, Jan 29, 2015 at 12:25 PM, Tomi Ollila  wrote:
>> Thanks for your contribution. You seem to have taken my suggestion
>> literally just that it IIRC now only sets those when using shr renderer --
>> setting of gnus-blocked images should be in other code path... i am not
>> sure though i am sending this using mobile phi0one terminal and checking
>> for sure is just too PITA ;\
>
> Ouch.  I was stupid.  I'll send an update soon.
>

Sent another patch.  I couldn't test it with gnus-w3m though because I
don't have w3m on my machine now.


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-01-29 Thread Jinwoo Lee
It's default value is ".", meaning all remote images will be blocked
by default.

---
This time setting gnus-blocked-images from the correct place.
---
 emacs/notmuch-show.el | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..6f38e0c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)

+(defcustom notmuch-show-text/html-blocked-images "."
+  "Remote images that have URLs matching this regexp will be blocked."
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,16 +803,24 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
 (first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images "."))
+   ;; By default, block all external images to prevent privacy
+   ;; leaks and potential attacks.  FIXME: If we block an image,
+   ;; offer a button to load external images.
+   (shr-blocked-images notmuch-show-text/html-blocked-images))
 (shr-insert-document dom)
 t))

 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
   ;; This handler _must_ succeed - it is the handler of last resort.
-  (notmuch-mm-display-part-inline msg part content-type 
notmuch-show-process-crypto)
+
+  ;; By default, block all external images to prevent privacy leaks
+  ;; and potential attacks.  FIXME: If we block an image, offer a
+  ;; button to load external images.
+  ;; Note that GNUS-BLOCKED-IMAGES is effective only when
+  ;; MM-TEXT-HTML-RENDERER is 'gnus-w3m.
+  (let ((gnus-blocked-images notmuch-show-text/html-blocked-images))
+(notmuch-mm-display-part-inline msg part content-type
+   notmuch-show-process-crypto))
   t)

 ;; Functions for determining how to handle MIME parts.
-- 
2.2.2



[PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 12:25 PM, Tomi Ollila  wrote:
> On Thu, Jan 29 2015, Jinwoo Lee  wrote:
>
>> On Thu, Jan 29, 2015 at 12:58 AM, Tomi Ollila  wrote:
>>> On Thu, Jan 29 2015, David Bremner  wrote:
>>>
>>>> Jinwoo Lee  writes:
>>>>
>>>>> + (shr-blocked-images (if notmuch-show-block-remote-images
>>>>> + "."
>>>>> +   shr-blocked-images)))
>>>>>  (shr-insert-document dom)
>>>>>  t))
>>>>
>>>> Ideally such a customization would apply to all html renders. I think
>>>> Tomi did some experiments with w3m and friends, I _think_ they respect
>>>> gnus-blocked-images, but maybe Tomi can comment.
>>>
>>> I did M-x debug-on-entry RET open-network-stream RET  (or an equivalent of
>>> t that in elisp, but the code I did is now lost & forgotten ;/
>>>
>>> The docstring relevant to the renderers below it at the end of this email.
>>>
>>> 'gnus-w3m respect gnus-blocked-images
>>>
>>> I could not run 'w3m on that system... nor 'w3
>>>
>>> There was no effect with 'w3m-standalone -- in this case I'd think it is up
>>> to w3m binary to load external stuff or not. I presume the same is the
>>> case with 'links, 'lynx, 'html2text and nil
>>>
>>> So, to add to David's suggestion maybe just set both gnus-blocked-images
>>> and shr-blocked-images to the value of
>>> notmuch-show-text/html-blocked-images
>>
>> All right.  I sent another patch that does this.  Thanks, guys!
>
> Thanks for your contribution. You seem to have taken my suggestion
> literally just that it IIRC now only sets those when using shr renderer --
> setting of gnus-blocked images should be in other code path... i am not
> sure though i am sending this using mobile phi0one terminal and checking
> for sure is just too PITA ;\

Ouch.  I was stupid.  I'll send an update soon.

>
> Tomi
>
>>
>>>
>>>
>>> Tomi
>>>
>>>
>>> mm-text-html-renderer is a variable defined in `mm-decode.el'.
>>> Its value is shr
>>>
>>> Documentation:
>>> Render of HTML contents.
>>> It is one of defined renderer types, or a rendering function.
>>> The defined renderer types are:
>>> `shr': use the built-in Gnus HTML renderer;
>>> `gnus-w3m': use Gnus renderer based on w3m;
>>> `w3m': use emacs-w3m;
>>> `w3m-standalone': use plain w3m;
>>> `links': use links;
>>> `lynx': use lynx;
>>> `w3': use Emacs/W3;
>>> `html2text': use html2text;
>>> nil: use external viewer (default web browser).
>>>
>>>
>>>> d
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


Emacs: Notmuch logo is not displayed when using ELPA package

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 11:49 AM, David Bremner  wrote:
> Jinwoo Lee  writes:
>>
>> Yes MELPA, that is.  Sorry.  So it's not fixable from our side?
>>
>
> Correct, it would only be possible to fix on the MELPA side.

OK.  I'll have to abandon the MELPA version then :)

>
> d


Emacs: Notmuch logo is not displayed when using ELPA package

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 10:58 AM, David Bremner  wrote:
> Jinwoo Lee  writes:
>
>> TIL notmuch shows a logo at the top of the Emacs buffer!
>>
>> I've been using the ELPA package so far and it didn't show the logo.  I
>> switched to my local git repo to test my changes and realized that we
>> have a logo!
>>
>> Anyone know why the ELPA package wouldn't show it?
>
> Maybe you mean MELPA?  I guess there is no notmuch package in the
> official emacs ELPA archive. Anyway, I had a quick look at the MELPA
> recipe and they just copy *.el, rather than running the notmuch build
> system. Somewhat unsurprisingly, a few small things break (that I know
> of, the logo and the correct definition of version of
> notmuch-emacs-version).

Yes MELPA, that is.  Sorry.  So it's not fixable from our side?

>
> d


Emacs: Notmuch logo is not displayed when using ELPA package

2015-01-29 Thread Jinwoo Lee
I mistakenly sent from a wrong account.  Sending again...

--

TIL notmuch shows a logo at the top of the Emacs buffer!

I've been using the ELPA package so far and it didn't show the logo.  I
switched to my local git repo to test my changes and realized that we
have a logo!

Anyone know why the ELPA package wouldn't show it?

-jinwoo


privacy problem: text/html parts pull in network resources

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 10:03 AM, Daniel Kahn Gillmor  wrote:
> On Wed 2015-01-28 18:57:25 -0500, Jinwoo Lee wrote:
>> Do you mind if I add a boolean defcustom, which determines whether to
>> block remote images?  Its default value will be T (block), but people
>> who want to see remote images can customize it.
>
> I have no objection to this kind of knob in an already fiddly config
> space.  In the other thread, i see the discussion of whether this should
> expose something fancier than a boolean, but given the number of
> possible rendering backends, i don't know how well we can support any of
> these options reliably.
>
> What should notmuch do when the customization variable is set to t
> (block remote images) but the html rendering backend doesn't support
> blocking remote images?
>
> It seems dangerous/disingenuous to offer the option to the user but not
> be able to enforce it in this case.  Should having this set to t
> restrict the range of html renderers to only those that we can force to
> respect it?

I'm not very knowledgeable in the notmuch codebase, but I think I agree
with your concern about this customization variable being dangerous or
misleading users.

+1 to restricting renderers.

>
> --dkg
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 12:58 AM, Tomi Ollila  wrote:
> On Thu, Jan 29 2015, David Bremner  wrote:
>
>> Jinwoo Lee  writes:
>>
>>> +   (shr-blocked-images (if notmuch-show-block-remote-images
>>> +   "."
>>> + shr-blocked-images)))
>>>  (shr-insert-document dom)
>>>  t))
>>
>> Ideally such a customization would apply to all html renders. I think
>> Tomi did some experiments with w3m and friends, I _think_ they respect
>> gnus-blocked-images, but maybe Tomi can comment.
>
> I did M-x debug-on-entry RET open-network-stream RET  (or an equivalent of
> t that in elisp, but the code I did is now lost & forgotten ;/
>
> The docstring relevant to the renderers below it at the end of this email.
>
> 'gnus-w3m respect gnus-blocked-images
>
> I could not run 'w3m on that system... nor 'w3
>
> There was no effect with 'w3m-standalone -- in this case I'd think it is up
> to w3m binary to load external stuff or not. I presume the same is the
> case with 'links, 'lynx, 'html2text and nil
>
> So, to add to David's suggestion maybe just set both gnus-blocked-images
> and shr-blocked-images to the value of
> notmuch-show-text/html-blocked-images

All right.  I sent another patch that does this.  Thanks, guys!

>
>
> Tomi
>
>
> mm-text-html-renderer is a variable defined in `mm-decode.el'.
> Its value is shr
>
> Documentation:
> Render of HTML contents.
> It is one of defined renderer types, or a rendering function.
> The defined renderer types are:
> `shr': use the built-in Gnus HTML renderer;
> `gnus-w3m': use Gnus renderer based on w3m;
> `w3m': use emacs-w3m;
> `w3m-standalone': use plain w3m;
> `links': use links;
> `lynx': use lynx;
> `w3': use Emacs/W3;
> `html2text': use html2text;
> nil: use external viewer (default web browser).
>
>
>> d


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-01-29 Thread Jinwoo Lee
It's default value is ".", meaning all remote images will be blocked
by default.
---
 emacs/notmuch-show.el | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..cc6aca9 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)

+(defcustom notmuch-show-text/html-blocked-images "."
+  "Remote images that have URLs matching this regexp will be blocked."
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,10 +803,11 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
 (first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images "."))
+   ;; By default, block all external images to prevent privacy
+   ;; leaks and potential attacks.  FIXME: If we block an image,
+   ;; offer a button to load external images.
+   (shr-blocked-images notmuch-show-text/html-blocked-images)
+   (gnus-blocked-images notmuch-show-text/html-blocked-images))
 (shr-insert-document dom)
 t))

-- 
2.2.2



[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-01-29 Thread Jinwoo Lee
It's default value is ., meaning all remote images will be blocked
by default.
---
 emacs/notmuch-show.el | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..cc6aca9 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation.
   :type 'boolean
   :group 'notmuch-show)
 
+(defcustom notmuch-show-text/html-blocked-images .
+  Remote images that have URLs matching this regexp will be blocked.
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,10 +803,11 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
 (first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images .))
+   ;; By default, block all external images to prevent privacy
+   ;; leaks and potential attacks.  FIXME: If we block an image,
+   ;; offer a button to load external images.
+   (shr-blocked-images notmuch-show-text/html-blocked-images)
+   (gnus-blocked-images notmuch-show-text/html-blocked-images))
 (shr-insert-document dom)
 t))
 
-- 
2.2.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 12:58 AM, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Thu, Jan 29 2015, David Bremner da...@tethera.net wrote:

 Jinwoo Lee jinwo...@gmail.com writes:

 +   (shr-blocked-images (if notmuch-show-block-remote-images
 +   .
 + shr-blocked-images)))
  (shr-insert-document dom)
  t))

 Ideally such a customization would apply to all html renders. I think
 Tomi did some experiments with w3m and friends, I _think_ they respect
 gnus-blocked-images, but maybe Tomi can comment.

 I did M-x debug-on-entry RET open-network-stream RET  (or an equivalent of
 t that in elisp, but the code I did is now lost  forgotten ;/

 The docstring relevant to the renderers below it at the end of this email.

 'gnus-w3m respect gnus-blocked-images

 I could not run 'w3m on that system... nor 'w3

 There was no effect with 'w3m-standalone -- in this case I'd think it is up
 to w3m binary to load external stuff or not. I presume the same is the
 case with 'links, 'lynx, 'html2text and nil

 So, to add to David's suggestion maybe just set both gnus-blocked-images
 and shr-blocked-images to the value of
 notmuch-show-text/html-blocked-images

All right.  I sent another patch that does this.  Thanks, guys!



 Tomi


 mm-text-html-renderer is a variable defined in `mm-decode.el'.
 Its value is shr

 Documentation:
 Render of HTML contents.
 It is one of defined renderer types, or a rendering function.
 The defined renderer types are:
 `shr': use the built-in Gnus HTML renderer;
 `gnus-w3m': use Gnus renderer based on w3m;
 `w3m': use emacs-w3m;
 `w3m-standalone': use plain w3m;
 `links': use links;
 `lynx': use lynx;
 `w3': use Emacs/W3;
 `html2text': use html2text;
 nil: use external viewer (default web browser).


 d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Emacs: Notmuch logo is not displayed when using ELPA package

2015-01-29 Thread Jinwoo Lee
I mistakenly sent from a wrong account.  Sending again...

--

TIL notmuch shows a logo at the top of the Emacs buffer!

I've been using the ELPA package so far and it didn't show the logo.  I
switched to my local git repo to test my changes and realized that we
have a logo!

Anyone know why the ELPA package wouldn't show it?

-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: privacy problem: text/html parts pull in network resources

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 10:03 AM, Daniel Kahn Gillmor d...@fifthhorseman.net 
wrote:
 On Wed 2015-01-28 18:57:25 -0500, Jinwoo Lee wrote:
 Do you mind if I add a boolean defcustom, which determines whether to
 block remote images?  Its default value will be T (block), but people
 who want to see remote images can customize it.

 I have no objection to this kind of knob in an already fiddly config
 space.  In the other thread, i see the discussion of whether this should
 expose something fancier than a boolean, but given the number of
 possible rendering backends, i don't know how well we can support any of
 these options reliably.

 What should notmuch do when the customization variable is set to t
 (block remote images) but the html rendering backend doesn't support
 blocking remote images?

 It seems dangerous/disingenuous to offer the option to the user but not
 be able to enforce it in this case.  Should having this set to t
 restrict the range of html renderers to only those that we can force to
 respect it?

I'm not very knowledgeable in the notmuch codebase, but I think I agree
with your concern about this customization variable being dangerous or
misleading users.

+1 to restricting renderers.


 --dkg
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Emacs: Notmuch logo is not displayed when using ELPA package

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 10:58 AM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 TIL notmuch shows a logo at the top of the Emacs buffer!

 I've been using the ELPA package so far and it didn't show the logo.  I
 switched to my local git repo to test my changes and realized that we
 have a logo!

 Anyone know why the ELPA package wouldn't show it?

 Maybe you mean MELPA?  I guess there is no notmuch package in the
 official emacs ELPA archive. Anyway, I had a quick look at the MELPA
 recipe and they just copy *.el, rather than running the notmuch build
 system. Somewhat unsurprisingly, a few small things break (that I know
 of, the logo and the correct definition of version of
 notmuch-emacs-version).

Yes MELPA, that is.  Sorry.  So it's not fixable from our side?


 d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Emacs: Notmuch logo is not displayed when using ELPA package

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 11:49 AM, David Bremner da...@tethera.net wrote:
 Jinwoo Lee jinwo...@gmail.com writes:

 Yes MELPA, that is.  Sorry.  So it's not fixable from our side?


 Correct, it would only be possible to fix on the MELPA side.

OK.  I'll have to abandon the MELPA version then :)


 d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 12:25 PM, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Thu, Jan 29 2015, Jinwoo Lee jinwo...@gmail.com wrote:

 On Thu, Jan 29, 2015 at 12:58 AM, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Thu, Jan 29 2015, David Bremner da...@tethera.net wrote:

 Jinwoo Lee jinwo...@gmail.com writes:

 + (shr-blocked-images (if notmuch-show-block-remote-images
 + .
 +   shr-blocked-images)))
  (shr-insert-document dom)
  t))

 Ideally such a customization would apply to all html renders. I think
 Tomi did some experiments with w3m and friends, I _think_ they respect
 gnus-blocked-images, but maybe Tomi can comment.

 I did M-x debug-on-entry RET open-network-stream RET  (or an equivalent of
 t that in elisp, but the code I did is now lost  forgotten ;/

 The docstring relevant to the renderers below it at the end of this email.

 'gnus-w3m respect gnus-blocked-images

 I could not run 'w3m on that system... nor 'w3

 There was no effect with 'w3m-standalone -- in this case I'd think it is up
 to w3m binary to load external stuff or not. I presume the same is the
 case with 'links, 'lynx, 'html2text and nil

 So, to add to David's suggestion maybe just set both gnus-blocked-images
 and shr-blocked-images to the value of
 notmuch-show-text/html-blocked-images

 All right.  I sent another patch that does this.  Thanks, guys!

 Thanks for your contribution. You seem to have taken my suggestion
 literally just that it IIRC now only sets those when using shr renderer --
 setting of gnus-blocked images should be in other code path... i am not
 sure though i am sending this using mobile phi0one terminal and checking
 for sure is just too PITA ;\

Ouch.  I was stupid.  I'll send an update soon.


 Tomi




 Tomi


 mm-text-html-renderer is a variable defined in `mm-decode.el'.
 Its value is shr

 Documentation:
 Render of HTML contents.
 It is one of defined renderer types, or a rendering function.
 The defined renderer types are:
 `shr': use the built-in Gnus HTML renderer;
 `gnus-w3m': use Gnus renderer based on w3m;
 `w3m': use emacs-w3m;
 `w3m-standalone': use plain w3m;
 `links': use links;
 `lynx': use lynx;
 `w3': use Emacs/W3;
 `html2text': use html2text;
 nil: use external viewer (default web browser).


 d
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 12:57 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 On Thu, Jan 29, 2015 at 12:25 PM, Tomi Ollila tomi.oll...@iki.fi wrote:
 Thanks for your contribution. You seem to have taken my suggestion
 literally just that it IIRC now only sets those when using shr renderer --
 setting of gnus-blocked images should be in other code path... i am not
 sure though i am sending this using mobile phi0one terminal and checking
 for sure is just too PITA ;\

 Ouch.  I was stupid.  I'll send an update soon.


Sent another patch.  I couldn't test it with gnus-w3m though because I
don't have w3m on my machine now.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: Add a defcustom that specifies regexp for blocked remote images.

2015-01-29 Thread Jinwoo Lee
It's default value is ., meaning all remote images will be blocked
by default.

---
This time setting gnus-blocked-images from the correct place.
---
 emacs/notmuch-show.el | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..6f38e0c 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation.
   :type 'boolean
   :group 'notmuch-show)
 
+(defcustom notmuch-show-text/html-blocked-images .
+  Remote images that have URLs matching this regexp will be blocked.
+  :type '(choice (const nil) regexp)
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,16 +803,24 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
 (first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images .))
+   ;; By default, block all external images to prevent privacy
+   ;; leaks and potential attacks.  FIXME: If we block an image,
+   ;; offer a button to load external images.
+   (shr-blocked-images notmuch-show-text/html-blocked-images))
 (shr-insert-document dom)
 t))
 
 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)
   ;; This handler _must_ succeed - it is the handler of last resort.
-  (notmuch-mm-display-part-inline msg part content-type 
notmuch-show-process-crypto)
+
+  ;; By default, block all external images to prevent privacy leaks
+  ;; and potential attacks.  FIXME: If we block an image, offer a
+  ;; button to load external images.
+  ;; Note that GNUS-BLOCKED-IMAGES is effective only when
+  ;; MM-TEXT-HTML-RENDERER is 'gnus-w3m.
+  (let ((gnus-blocked-images notmuch-show-text/html-blocked-images))
+(notmuch-mm-display-part-inline msg part content-type
+   notmuch-show-process-crypto))
   t)
 
 ;; Functions for determining how to handle MIME parts.
-- 
2.2.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] Add a defcustom for whether to block remote images by default.

2015-01-29 Thread Jinwoo Lee
On Thu, Jan 29, 2015 at 01:39 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 Sent another patch.  I couldn't test it with gnus-w3m though because I
 don't have w3m on my machine now.

I installed w3m and verified that my patch works with gnus-w3m too.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Add a defcustom for whether to block remote images by default.

2015-01-28 Thread Jinwoo Lee
---
 emacs/notmuch-show.el | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..bc48922 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)

+(defcustom notmuch-show-block-remote-images t
+  "Block remote images by default."
+  :type 'boolean
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,10 +803,12 @@ will return nil if the CID is unknown or cannot be 
retrieved."
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
 (first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images "."))
+   ;; By default, block all external images to prevent privacy
+   ;; leaks and potential attacks.  FIXME: If we block an image,
+   ;; offer a button to load external images.
+   (shr-blocked-images (if notmuch-show-block-remote-images
+   "."
+ shr-blocked-images)))
 (shr-insert-document dom)
 t))

-- 
2.2.2



privacy problem: text/html parts pull in network resources

2015-01-28 Thread Jinwoo Lee
On Tue, Jan 27, 2015 at 08:44 PM, Jinwoo Lee  wrote:
> On Tue, Jan 27, 2015 at 07:47 PM, Daniel Kahn Gillmor  fifthhorseman.net> wrote:
>> On Sun 2015-01-25 12:51:43 -0500, David Bremner wrote:
>>> Daniel Kahn Gillmor  writes:
>>>
>>>> If i send a message with a text/html part (either it's only text/html,
>>>> or all parts are rendered, or it's multipart/alternative with only a
>>>> text/html subpart) and that HTML has >>> src="http://example.org/test.png"/> in it, then notmuch will make a
>>>> network request for that image.
>>>>
>>>> This is a privacy disaster, because it enables an e-mail sender to use
>>>> "web bugs" to tell when a given notmuch user has opened their e-mail.
>>>
>>> I've just pushed Austin's shr related series to master, so this problem
>>> should be fixed as of commit b74ed1c. One tradeoff that we should at
>>> least remark in NEWS, if not actually fix, is that I think there is now
>>> no way to view such images in notmuch.  I don't know offhand what other
>>> html renderers will do.
>>
>> thanks for this, David and Austin!
>>
>> Other html-rendering mail clients that are privacy-conscious will often
>> provide a button or mechanism to indicate that some remote resources
>> were requested by the page but weren't fetched (e.g. a button saying
>> something like [Load Remote Images...]).  I have no idea who actually
>> clicks on those buttons (or why), though, and even if we wanted them,
>> we'd only want to add a button on an image that actually had remote
>> network resources to load, and i don't know how we'd get that
>> information propagated back up the rendering stack to make such a
>> display decision.   So i'm fine with leaving it this way for now.
>
> Well, most promotional emails contain remote images and their contents
> are incomprehensible without those images.  I ignore most of them but I
> do read a few of those promotional emails.  It would be great to have a
> UI for loading remote resources.

Do you mind if I add a boolean defcustom, which determines whether to
block remote images?  Its default value will be T (block), but people
who want to see remote images can customize it.

>
>>
>> --dkg
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch


Re: privacy problem: text/html parts pull in network resources

2015-01-28 Thread Jinwoo Lee
On Tue, Jan 27, 2015 at 08:44 PM, Jinwoo Lee jinwo...@gmail.com wrote:
 On Tue, Jan 27, 2015 at 07:47 PM, Daniel Kahn Gillmor 
 d...@fifthhorseman.net wrote:
 On Sun 2015-01-25 12:51:43 -0500, David Bremner wrote:
 Daniel Kahn Gillmor d...@fifthhorseman.net writes:

 If i send a message with a text/html part (either it's only text/html,
 or all parts are rendered, or it's multipart/alternative with only a
 text/html subpart) and that HTML has img
 src=http://example.org/test.png/ in it, then notmuch will make a
 network request for that image.

 This is a privacy disaster, because it enables an e-mail sender to use
 web bugs to tell when a given notmuch user has opened their e-mail.

 I've just pushed Austin's shr related series to master, so this problem
 should be fixed as of commit b74ed1c. One tradeoff that we should at
 least remark in NEWS, if not actually fix, is that I think there is now
 no way to view such images in notmuch.  I don't know offhand what other
 html renderers will do.

 thanks for this, David and Austin!

 Other html-rendering mail clients that are privacy-conscious will often
 provide a button or mechanism to indicate that some remote resources
 were requested by the page but weren't fetched (e.g. a button saying
 something like [Load Remote Images...]).  I have no idea who actually
 clicks on those buttons (or why), though, and even if we wanted them,
 we'd only want to add a button on an image that actually had remote
 network resources to load, and i don't know how we'd get that
 information propagated back up the rendering stack to make such a
 display decision.   So i'm fine with leaving it this way for now.

 Well, most promotional emails contain remote images and their contents
 are incomprehensible without those images.  I ignore most of them but I
 do read a few of those promotional emails.  It would be great to have a
 UI for loading remote resources.

Do you mind if I add a boolean defcustom, which determines whether to
block remote images?  Its default value will be T (block), but people
who want to see remote images can customize it.



 --dkg
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] Add a defcustom for whether to block remote images by default.

2015-01-28 Thread Jinwoo Lee
---
 emacs/notmuch-show.el | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..bc48922 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation.
   :type 'boolean
   :group 'notmuch-show)
 
+(defcustom notmuch-show-block-remote-images t
+  Block remote images by default.
+  :type 'boolean
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,10 +803,12 @@ will return nil if the CID is unknown or cannot be 
retrieved.
   ;; URL-decode it (see RFC 2392).
   (let ((cid (url-unhex-string url)))
 (first (notmuch-show--get-cid-content cid)
-   ;; Block all external images to prevent privacy leaks and
-   ;; potential attacks.  FIXME: If we block an image, offer a
-   ;; button to load external images.
-   (shr-blocked-images .))
+   ;; By default, block all external images to prevent privacy
+   ;; leaks and potential attacks.  FIXME: If we block an image,
+   ;; offer a button to load external images.
+   (shr-blocked-images (if notmuch-show-block-remote-images
+   .
+ shr-blocked-images)))
 (shr-insert-document dom)
 t))
 
-- 
2.2.2

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


privacy problem: text/html parts pull in network resources

2015-01-27 Thread Jinwoo Lee
On Tue, Jan 27, 2015 at 07:47 PM, Daniel Kahn Gillmor  wrote:
> On Sun 2015-01-25 12:51:43 -0500, David Bremner wrote:
>> Daniel Kahn Gillmor  writes:
>>
>>> If i send a message with a text/html part (either it's only text/html,
>>> or all parts are rendered, or it's multipart/alternative with only a
>>> text/html subpart) and that HTML has >> src="http://example.org/test.png"/> in it, then notmuch will make a
>>> network request for that image.
>>>
>>> This is a privacy disaster, because it enables an e-mail sender to use
>>> "web bugs" to tell when a given notmuch user has opened their e-mail.
>>
>> I've just pushed Austin's shr related series to master, so this problem
>> should be fixed as of commit b74ed1c. One tradeoff that we should at
>> least remark in NEWS, if not actually fix, is that I think there is now
>> no way to view such images in notmuch.  I don't know offhand what other
>> html renderers will do.
>
> thanks for this, David and Austin!
>
> Other html-rendering mail clients that are privacy-conscious will often
> provide a button or mechanism to indicate that some remote resources
> were requested by the page but weren't fetched (e.g. a button saying
> something like [Load Remote Images...]).  I have no idea who actually
> clicks on those buttons (or why), though, and even if we wanted them,
> we'd only want to add a button on an image that actually had remote
> network resources to load, and i don't know how we'd get that
> information propagated back up the rendering stack to make such a
> display decision.   So i'm fine with leaving it this way for now.

Well, most promotional emails contain remote images and their contents
are incomprehensible without those images.  I ignore most of them but I
do read a few of those promotional emails.  It would be great to have a
UI for loading remote resources.

>
> --dkg
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Re: privacy problem: text/html parts pull in network resources

2015-01-27 Thread Jinwoo Lee
On Tue, Jan 27, 2015 at 07:47 PM, Daniel Kahn Gillmor d...@fifthhorseman.net 
wrote:
 On Sun 2015-01-25 12:51:43 -0500, David Bremner wrote:
 Daniel Kahn Gillmor d...@fifthhorseman.net writes:

 If i send a message with a text/html part (either it's only text/html,
 or all parts are rendered, or it's multipart/alternative with only a
 text/html subpart) and that HTML has img
 src=http://example.org/test.png/ in it, then notmuch will make a
 network request for that image.

 This is a privacy disaster, because it enables an e-mail sender to use
 web bugs to tell when a given notmuch user has opened their e-mail.

 I've just pushed Austin's shr related series to master, so this problem
 should be fixed as of commit b74ed1c. One tradeoff that we should at
 least remark in NEWS, if not actually fix, is that I think there is now
 no way to view such images in notmuch.  I don't know offhand what other
 html renderers will do.

 thanks for this, David and Austin!

 Other html-rendering mail clients that are privacy-conscious will often
 provide a button or mechanism to indicate that some remote resources
 were requested by the page but weren't fetched (e.g. a button saying
 something like [Load Remote Images...]).  I have no idea who actually
 clicks on those buttons (or why), though, and even if we wanted them,
 we'd only want to add a button on an image that actually had remote
 network resources to load, and i don't know how we'd get that
 information propagated back up the rendering stack to make such a
 display decision.   So i'm fine with leaving it this way for now.

Well, most promotional emails contain remote images and their contents
are incomprehensible without those images.  I ignore most of them but I
do read a few of those promotional emails.  It would be great to have a
UI for loading remote resources.


 --dkg
 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: escape % in header line format

2015-01-22 Thread Jinwoo Lee
Yup.  It works!  Thanks for the quick fix.  Is this going to be merged
to HEAD soon?

-jinwoo

On Thu, Jan 22, 2015 at 12:37 AM, David Bremner  wrote:
> We set header-line-format to the message subject, but if the subject
> contains percents, the next character is interpreted as a formatting
> control, which is not desired.
> ---
>
> You're correct of course. I have no idea how my testing convinced me
> the previous version worked.
>
> emacs/notmuch-show.el | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 9f6fe07..87b4881 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1198,7 +1198,11 @@ function is used."
>(notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags 
> (notmuch-show-get-tags
>  
>;; Set the header line to the subject of the first message.
> -  (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re 
> (notmuch-show-get-subject
> +  (setq header-line-format
> + (replace-regexp-in-string "%" "%%"
> + (notmuch-sanitize
> +  (notmuch-show-strip-re
> +   (notmuch-show-get-subject)
>  
>(run-hooks 'notmuch-show-hook
>  
> -- 
> 2.1.4


[PATCH] emacs: escape % in header line format

2015-01-22 Thread Jinwoo Lee
Thanks, David.  But I don't think it's the correct fix.  REPLACE-STRING
seems to replace a string in a buffer, not a string given as a param.
And it's for interactive use only.

-jinwoo

On Wed, Jan 21, 2015 at 11:18 PM, David Bremner  wrote:
> We set header-line-format to the message subject, but if the subject
> contains percents, the next character is interpreted as a formatting
> control, which is not desired.
> ---
>
> Ironically you have to apply this patch to read it's subject properly
> ;).  There is whitespace change here because the original line was way
> too long.
>
>  emacs/notmuch-show.el | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
> index 9f6fe07..4258d43 100644
> --- a/emacs/notmuch-show.el
> +++ b/emacs/notmuch-show.el
> @@ -1198,7 +1198,11 @@ function is used."
>(notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags 
> (notmuch-show-get-tags
>  
>;; Set the header line to the subject of the first message.
> -  (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re 
> (notmuch-show-get-subject
> +  (setq header-line-format
> + (replace-string "%" "%%"
> + (notmuch-sanitize
> +  (notmuch-show-strip-re
> +   (notmuch-show-get-subject)
>  
>(run-hooks 'notmuch-show-hook
>  
> -- 
> 2.1.4


Re: [PATCH] emacs: escape % in header line format

2015-01-22 Thread Jinwoo Lee
Thanks, David.  But I don't think it's the correct fix.  REPLACE-STRING
seems to replace a string in a buffer, not a string given as a param.
And it's for interactive use only.

-jinwoo

On Wed, Jan 21, 2015 at 11:18 PM, David Bremner da...@tethera.net wrote:
 We set header-line-format to the message subject, but if the subject
 contains percents, the next character is interpreted as a formatting
 control, which is not desired.
 ---

 Ironically you have to apply this patch to read it's subject properly
 ;).  There is whitespace change here because the original line was way
 too long.

  emacs/notmuch-show.el | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
 index 9f6fe07..4258d43 100644
 --- a/emacs/notmuch-show.el
 +++ b/emacs/notmuch-show.el
 @@ -1198,7 +1198,11 @@ function is used.
(notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags 
 (notmuch-show-get-tags
  
;; Set the header line to the subject of the first message.
 -  (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re 
 (notmuch-show-get-subject
 +  (setq header-line-format
 + (replace-string % %%
 + (notmuch-sanitize
 +  (notmuch-show-strip-re
 +   (notmuch-show-get-subject)
  
(run-hooks 'notmuch-show-hook
  
 -- 
 2.1.4
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: escape % in header line format

2015-01-22 Thread Jinwoo Lee
Yup.  It works!  Thanks for the quick fix.  Is this going to be merged
to HEAD soon?

-jinwoo

On Thu, Jan 22, 2015 at 12:37 AM, David Bremner da...@tethera.net wrote:
 We set header-line-format to the message subject, but if the subject
 contains percents, the next character is interpreted as a formatting
 control, which is not desired.
 ---

 You're correct of course. I have no idea how my testing convinced me
 the previous version worked.

 emacs/notmuch-show.el | 6 +-
  1 file changed, 5 insertions(+), 1 deletion(-)

 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
 index 9f6fe07..87b4881 100644
 --- a/emacs/notmuch-show.el
 +++ b/emacs/notmuch-show.el
 @@ -1198,7 +1198,11 @@ function is used.
(notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags 
 (notmuch-show-get-tags
  
;; Set the header line to the subject of the first message.
 -  (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re 
 (notmuch-show-get-subject
 +  (setq header-line-format
 + (replace-regexp-in-string % %%
 + (notmuch-sanitize
 +  (notmuch-show-strip-re
 +   (notmuch-show-get-subject)
  
(run-hooks 'notmuch-show-hook
  
 -- 
 2.1.4
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Percent symbol is not shown in the global subject line in the Emacs notmuch-show buffer

2015-01-21 Thread Jinwoo Lee
When reading an email thread with Emacs client of notmuch, there are two
places where the email subject is displayed -- one at the top of the
buffer, and per each email in the thread.

When the subject contains '%' in it, the global subject line at the top
of the buffer doesn't show it and the subject looks weird.  Say I have
an email with subject "100% increase in latency", the top line will say
"100increase in latency".  Note that the space after the '%' symbol is
also removed.  The subject line per email shows it fine.

Can this be fixed?  I'm very annoyed by this :)

Thanks,
-jinwoo


Percent symbol is not shown in the global subject line in the Emacs notmuch-show buffer

2015-01-21 Thread Jinwoo Lee
When reading an email thread with Emacs client of notmuch, there are two
places where the email subject is displayed -- one at the top of the
buffer, and per each email in the thread.

When the subject contains '%' in it, the global subject line at the top
of the buffer doesn't show it and the subject looks weird.  Say I have
an email with subject 100% increase in latency, the top line will say
100increase in latency.  Note that the space after the '%' symbol is
also removed.  The subject line per email shows it fine.

Can this be fixed?  I'm very annoyed by this :)

Thanks,
-jinwoo
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch