]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
6 years agoview: remove X-PI-TS reference
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 03:33:59 +0000 (03:33 +0000)]
view: remove X-PI-TS reference

We haven't needed this since we integrated threading
and dropped Email::Abstract and Mail::Thread usage.

6 years agosearchidx: get rid of pointless index_blob wrapper
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 00:40:09 +0000 (00:40 +0000)]
searchidx: get rid of pointless index_blob wrapper

This used to lookup the message in git, but no longer, so
remove a needless indirection layer and call add_message
directly.

6 years agosearchidx*: name child subprocesses
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 00:29:51 +0000 (00:29 +0000)]
searchidx*: name child subprocesses

This makes viewing "ps" output nicer.

6 years agosearchidxpart: chomp line before splitting
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 00:19:51 +0000 (00:19 +0000)]
searchidxpart: chomp line before splitting

This was adding a needless newline into doc_data

6 years agouse PublicInbox::MIME consistently
Eric Wong (Contractor, The Linux Foundation) [Fri, 23 Feb 2018 18:33:34 +0000 (18:33 +0000)]
use PublicInbox::MIME consistently

It works around some bugs in older Email::MIME which we'll
find useful.

6 years agosearchidxpart: binmode
Eric Wong (Contractor, The Linux Foundation) [Fri, 23 Feb 2018 02:28:53 +0000 (02:28 +0000)]
searchidxpart: binmode

Probably unnecessary, but set binmode for consistency across
platforms.

6 years agov2writable: cleanup unused pipes in partitions
Eric Wong (Contractor, The Linux Foundation) [Fri, 23 Feb 2018 02:26:45 +0000 (02:26 +0000)]
v2writable: cleanup unused pipes in partitions

Leaking these pipes to child processes wasn't harmful, but
made determining relationships and dataflow between processes
more confusing.

6 years agov2/ui: retry DB reopens in a few more places
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 21:17:53 +0000 (21:17 +0000)]
v2/ui: retry DB reopens in a few more places

Relying more on Xapian requires retrying reopens in more
places to ensure it does not fall down and show errors to
the user.

6 years agov2/ui: some hacky things to get the PSGI UI to show up
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 07:15:54 +0000 (07:15 +0000)]
v2/ui: some hacky things to get the PSGI UI to show up

Fortunately, Xapian multiple database support makes things
easier but we still need to handle the skeleton DB separately.

6 years agov2writable: warn on duplicate Message-IDs
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 19:10:31 +0000 (19:10 +0000)]
v2writable: warn on duplicate Message-IDs

This should give us an idea of how much a problem deduplication
will be.

6 years agosearchidxpart: increase pipe size for partitions
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 17:55:37 +0000 (17:55 +0000)]
searchidxpart: increase pipe size for partitions

We want to reduce the time in the main V2Writable process
spends writing to the pipe, as the main process itself is
the primary source of contention.

While we're at it, always flush after writing to ensure
the child sees it at once.  (Grr... Perl doesn't use writev)

6 years agov2writable: round-robin to partitions based on article number
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 17:55:35 +0000 (17:55 +0000)]
v2writable: round-robin to partitions based on article number

Instead of relying on the git object_id hash to partition,
round-robin to these partitions based on the NNTP article
number.  This reduces the partition pipes as a source of
contention when two (or more) sequential messages end up
going to the same partition.

6 years agov2: parallelize Xapian indexing
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 01:49:08 +0000 (01:49 +0000)]
v2: parallelize Xapian indexing

The parallelization requires splitting Msgmap, text+term
indexing, and thread-linking out into separate processes.

git-fast-import is fast, so we don't bother parallelizing it.

Msgmap (SQLite) and thread-linking (Xapian) must be serialized
because they rely on monotonically increasing numbers (NNTP
article number and internal thread_id, respectively).

We handle msgmap in the main process which drives fast-import.
When the article number is retrieved/generated, we write the
entire message to per-partition subprocesses via pipes for
expensive text+term indexing.

When these per-partition subprocesses are done with the
expensive text+term indexing, they write SearchMsg (small data)
to a shared pipe (inherited from the main V2Writable process)
back to the threader, which runs its own subprocess.

The number of text+term Xapian partitions is chosen at import
and can be made equal to the number of cores in a machine.

V2Writable --> Import -> git-fast-import
           \-> SearchIdxThread -> Msgmap (synchronous)
           \-> SearchIdxPart[n] -> SearchIdx[*]
   \-> SearchIdxThread -> SearchIdx ("threader", a subprocess)

[* ] each subprocess writes to threader

6 years agoimport_vger_from_mbox: use PublicInbox::MIME and avoid clobbering
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 17:55:36 +0000 (17:55 +0000)]
import_vger_from_mbox: use PublicInbox::MIME and avoid clobbering

It is less confusing without the clobber assignment; and
PublicInbox::MIME exists to workaround bugs in older
Email::MIME (which is in Debian 9 (stretch))

6 years agoimport_vger_from_inbox: allow "-V" option
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 05:17:40 +0000 (05:17 +0000)]
import_vger_from_inbox: allow "-V" option

This will let us quickly test between v2 and v1 inboxes.

6 years agov2: support Xapian + SQLite indexing
Eric Wong (Contractor, The Linux Foundation) [Tue, 20 Feb 2018 21:00:21 +0000 (21:00 +0000)]
v2: support Xapian + SQLite indexing

This is too slow, currently.  Working with only 2017 LKML
archives:

         git-only: ~1 minute
     git + SQLite: ~12 minutes
git+Xapian+SQlite: ~45 minutes

So yes, it looks like we'll need to parallelize Xapian indexing,
at least.

6 years agogit: reload alternates file on missing blob
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Feb 2018 20:07:11 +0000 (20:07 +0000)]
git: reload alternates file on missing blob

Since we'll be adding new repositories to the `alternates' file
in git, we must restart the `git cat-file --batch' process as
git currently does not detect changes to the alternates file
in long-running cat-file processes.

Don't bother with the `--batch-check' process since we won't be
using it with v2.

6 years agov2writable: initial cut for repo-rotation
Eric Wong (Contractor, The Linux Foundation) [Sat, 17 Feb 2018 10:19:47 +0000 (10:19 +0000)]
v2writable: initial cut for repo-rotation

Wrap the old Import package to enable creating new repos based
on size thresholds.  This is better than relying on time-based
rotation as LKML traffic seems to be increasing.

6 years agowww: stop assuming mainrepo == git_dir
Eric Wong (Contractor, The Linux Foundation) [Fri, 16 Feb 2018 03:54:37 +0000 (03:54 +0000)]
www: stop assuming mainrepo == git_dir

It won't be in v2

6 years agosearch: stop assuming Message-ID is unique
Eric Wong (Contractor, The Linux Foundation) [Fri, 16 Feb 2018 02:59:11 +0000 (02:59 +0000)]
search: stop assuming Message-ID is unique

In general, they are, but there's no way for or general purpose
mail server to enforce that.  This is a step in allowing us
to handle more corner cases which existing lists throw at us.

6 years agoextmsg: fix broken Xapian MID lookup
Eric Wong (Contractor, The Linux Foundation) [Fri, 16 Feb 2018 00:17:16 +0000 (00:17 +0000)]
extmsg: fix broken Xapian MID lookup

This likely has no real world implications, though, as we
fall back to Msgmap lookups anyways.

Broken since commit 7eeadcb62729b0efbcb53cd9b7b181897c92cf9a
("search: remove unnecessary abstractions and functionality")

6 years agoimport: allow the epoch (0s) as a valid time
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 23:20:20 +0000 (23:20 +0000)]
import: allow the epoch (0s) as a valid time

Despite email not existing until 1971; "Jan 1, 1970 00:00:00"
seems like a common default timestamp for some test emails
to use as a Date: header.

6 years agoimport: quiet down warnings from bogus From: lines
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 09:27:55 +0000 (09:27 +0000)]
import: quiet down warnings from bogus From: lines

There's a lot of crap in archives and git-fast-import
accepts empty names and email addresses for authors
just fine.

6 years agoscripts/import_vger_from_mbox: use v2 layout for import
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 01:12:18 +0000 (01:12 +0000)]
scripts/import_vger_from_mbox: use v2 layout for import

Big lists are orders of magnitude more efficient with v2.

6 years agoimport: pass "raw" dates to git-fast-import(1)
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 01:10:06 +0000 (01:10 +0000)]
import: pass "raw" dates to git-fast-import(1)

For LKML, it appears we need an even more liberal parser than
RFC2822 date parser in git.  I have not validated Date::Parse
parses dates correctly, but this at least prevents
git-fast-import(1) from choking.

6 years agoaddress: extract more characters from email addresses
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 00:25:53 +0000 (00:25 +0000)]
address: extract more characters from email addresses

There's a lot of weird characters which show up in LKML archives
which we did not support before.  Furthermore, allow spaces
before the '>' in the From: line as at least some non-spam
poster used it.

6 years agosearchidx: fix comment around next_thread_id
Eric Wong (Contractor, The Linux Foundation) [Wed, 14 Feb 2018 08:20:38 +0000 (08:20 +0000)]
searchidx: fix comment around next_thread_id

I decided not to copy the notmuch implementation regarding
serialization of integers to Xapian metadata.

6 years agosearch: free up 'Q' prefix for a real unique identifier
Eric Wong (Contractor, The Linux Foundation) [Tue, 13 Feb 2018 03:02:56 +0000 (03:02 +0000)]
search: free up 'Q' prefix for a real unique identifier

This will allow easier-compatibility with v2 code which will
introduce content_id as the unique identifier.
The old "XMID" becomes "XM" as a free text searchable term.
"Q" becomes "XMID" as a boolean prefix.

There's no user-visible changes in this, but there needs to
be a schema version bump later on...
(more changes planned which can affect v1)

6 years agoimport: APIs to support v2 use
Eric Wong (Contractor, The Linux Foundation) [Wed, 14 Feb 2018 00:30:33 +0000 (00:30 +0000)]
import: APIs to support v2 use

Wrap "get-mark" and "checkpoint" commands for git-fast-import
while documenting/cementing parts of the API.

6 years agoscripts/import_vger_from_mbox: support --dry-run option
Eric Wong (Contractor, The Linux Foundation) [Tue, 13 Feb 2018 18:39:40 +0000 (18:39 +0000)]
scripts/import_vger_from_mbox: support --dry-run option

This can be useful for getting baseline of performance
of just Email::MIME and Date: header parsing.  We'll need
to do some Date: header parsing for LKML since there are
some wonky date formats which causes the git RFC822 parser
to choke.

6 years agosearchmsg: add mid_mime import for _extract_mid
Eric Wong (Contractor, The Linux Foundation) [Tue, 13 Feb 2018 02:58:56 +0000 (02:58 +0000)]
searchmsg: add mid_mime import for _extract_mid

Oops, I guess this code was never called and may not be
needed.  But for now, import it so it can run properly.

6 years agocontent_id: add test case
Eric Wong (Contractor, The Linux Foundation) [Mon, 12 Feb 2018 23:09:07 +0000 (23:09 +0000)]
content_id: add test case

6 years agot/import: test for last_object_id insertion
Eric Wong (Contractor, The Linux Foundation) [Mon, 12 Feb 2018 17:55:52 +0000 (17:55 +0000)]
t/import: test for last_object_id insertion

Check for this before doing the Xapian-based v2 importer.

6 years agoimport: initial handling for v2
Eric Wong (Contractor, The Linux Foundation) [Sat, 10 Feb 2018 05:13:19 +0000 (05:13 +0000)]
import: initial handling for v2

Call order will need to change a bit since this is going to be
tied to Xapian

6 years agoimport: begin supporting this without ssoma.lock
Eric Wong (Contractor, The Linux Foundation) [Fri, 9 Feb 2018 23:38:03 +0000 (23:38 +0000)]
import: begin supporting this without ssoma.lock

We'll reuse this class in v2, but won't be utilizing
per-git-repository ssoma.lock files.

Meanwhile, stop treating ::Inbox objects as an afterthought
and allow importing name and email into them.

6 years agoimport: stop writing legacy ssoma.index by default
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 17:21:36 +0000 (17:21 +0000)]
import: stop writing legacy ssoma.index by default

For machines which have never seen ssoma, they don't need the
index so stop creating it.

6 years agoscripts/import_vger_from_mbox: relax From_ line match slightly
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 03:49:51 +0000 (03:49 +0000)]
scripts/import_vger_from_mbox: relax From_ line match slightly

The mboxes I got from cregit have two spaces after the email
address, while the "git format-patch" output I'm used to dealing
with only has one space.

It's still a "strict" match in that it checks for something
resembling a timestamp, but it relaxes the number of spaces
between the email address and date.

6 years agowatch_maildir: allow '-' in mail filename
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 03:32:05 +0000 (03:32 +0000)]
watch_maildir: allow '-' in mail filename

Hostnames can contain '-' and this allows public-inbox-watch(1)
to work on machines which generate Maildir files with '-' in
them.

6 years agoAUTHORS: add The Linux Foundation
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 02:39:41 +0000 (02:39 +0000)]
AUTHORS: add The Linux Foundation

I'll be working as a contractor for The Linux Foundation on v2
in an effort to support LKML and associated lists.

6 years agopublic-inbox 1.0.0 v1.0.0
Eric Wong [Thu, 8 Feb 2018 02:25:19 +0000 (02:25 +0000)]
public-inbox 1.0.0

Might as well, this release is mostly to serve as a checkpoint
for the start of new development on v2 stuff mentioned in the
TODO.

6 years agoMANIFEST: add AUTHORS file
Eric Wong [Thu, 8 Feb 2018 02:24:45 +0000 (02:24 +0000)]
MANIFEST: add AUTHORS file

6 years agoadd AUTHORS file
Eric Wong [Wed, 7 Feb 2018 21:14:03 +0000 (21:14 +0000)]
add AUTHORS file

This can be useful for tarball distributions which lack full git
history.

6 years agoupdate copyrights for 2018
Eric Wong [Wed, 7 Feb 2018 19:56:45 +0000 (19:56 +0000)]
update copyrights for 2018

Using update-copyrights from gnulib

While we're at it, use the SPDX identifier for AGPL-3.0+ to
ease mechanical processing.

6 years agoview: allow expanding directly to "nested" view
Eric Wong [Sat, 3 Feb 2018 02:50:46 +0000 (02:50 +0000)]
view: allow expanding directly to "nested" view

Sometimes, it can be desirable to jump directly to the "nested"
view when viewing a thread skeleton.  This makes it possible.
While we're at it, shorten some of the text to ensure it still
fits in 80 columns.

6 years agoview: close <pre> in reply instructions
Eric Wong [Tue, 30 Jan 2018 18:17:47 +0000 (18:17 +0000)]
view: close <pre> in reply instructions

We leave the mailto: link out when obfuscating address, so
do not stuff the "</pre>" closing tag into it.  Instead,
keep the closing tag in the same context as the opening one,
making it easier to keep track of.

6 years agoreply: follow obfuscation rules for HTML in sh args
Eric Wong [Mon, 29 Jan 2018 13:04:09 +0000 (13:04 +0000)]
reply: follow obfuscation rules for HTML in sh args

Namely, we do not want to obfuscate the mail address of the
site itself.

6 years agoview: adjust wording for reply-to-list configs
Eric Wong [Mon, 29 Jan 2018 11:49:56 +0000 (11:49 +0000)]
view: adjust wording for reply-to-list configs

This makes the wording less confusing when showing archives
for lists where the convention is reply-to-list.
I still hate reply-to-list, but it's still better than no
archives or list at all.

6 years agoatom: show metadata before message body
Eric Wong [Fri, 26 Jan 2018 21:54:00 +0000 (21:54 +0000)]
atom: show metadata before message body

This can allow streaming parsers (SAX) to work a little more
efficiently as they can handle/discard all the metadata before
the big content.

6 years agodoc/design_www: adjust some wording and URLs around CSS
Eric Wong [Thu, 25 Jan 2018 06:30:03 +0000 (06:30 +0000)]
doc/design_www: adjust some wording and URLs around CSS

I still hate that CSS is over-used, but colors are useful
and perhaps using them for highlighting won't be too bad;
but user-supplied colors will ALWAYS be supported.

6 years agoTODO: notes about v2 format for giant archives
Eric Wong [Tue, 16 Jan 2018 22:18:16 +0000 (22:18 +0000)]
TODO: notes about v2 format for giant archives

Inspired by interest in LKML archival:

https://public-inbox.org/meta/d5546b24-5840-4ae9-d25b-5e3e737ed73b@linuxfoundation.org

6 years agohval: only allow domain obfuscation in address
Eric Wong [Tue, 16 Jan 2018 05:08:22 +0000 (05:08 +0000)]
hval: only allow domain obfuscation in address

Obfuscating username portions of the email address leads
to having subsequent parts of the address not being obfuscated;
which could mean we show someone else's email entirely.

In other words, obfuscating "john.doe@example.com" becomes
might mean "doe@example.com" is picked up by scanners.

In other news, email address obfuscation is still a horrible
usability issue and only exists to appease misguided people.

6 years agoview: avoid deduping a single word in subject skeletons
Eric Wong [Thu, 21 Dec 2017 00:58:01 +0000 (00:58 +0000)]
view: avoid deduping a single word in subject skeletons

It is usually pointless to replace a single word with a '"' character.

6 years agosearch: force large mbox result downloads to POST
Eric Wong [Fri, 8 Dec 2017 20:54:09 +0000 (20:54 +0000)]
search: force large mbox result downloads to POST

This should prevent crawlers (including most robots.txt ignoring
ones) from burning our CPU time without severely compromising
usability for humans.

6 years agosearchview: nofollow on mbox downloads
Eric Wong [Thu, 7 Dec 2017 20:30:07 +0000 (20:30 +0000)]
searchview: nofollow on mbox downloads

Some search results are gigantic, and search engines are
unlikely to be able to handle gzipped mboxes anyways.

6 years agosearch: allow downloading search results as mbox
Eric Wong [Wed, 29 Nov 2017 09:33:17 +0000 (09:33 +0000)]
search: allow downloading search results as mbox

Allowing downloading of all search results as an gzipped mboxrd
file can be convenient for some users.

6 years agoview: avoid warning from negative repeat counts
Eric Wong [Wed, 29 Nov 2017 09:29:24 +0000 (09:29 +0000)]
view: avoid warning from negative repeat counts

Perl 5.22 started warning about this.

6 years agosearchview: s/threaded/nested/
Eric Wong [Wed, 29 Nov 2017 09:23:38 +0000 (09:23 +0000)]
searchview: s/threaded/nested/

We want to be consistent with the view change in
commit b223e6f49debb99b9132bc85d97a065ebcee00b9

6 years agowatch: use "spam" in commit message for removals
Eric Wong [Thu, 16 Nov 2017 19:23:49 +0000 (19:23 +0000)]
watch: use "spam" in commit message for removals

This makes it easy to identify the reason for message removals.

6 years agolearn: use "spam" as subject for removal commits (part #2)
Eric Wong [Thu, 16 Nov 2017 19:21:06 +0000 (19:21 +0000)]
learn: use "spam" as subject for removal commits (part #2)

We need to use the correct subject when doing global scanning,
too.  In fact, the per-recipient spam training path is entirely
redundant at this point.

6 years agolearn: use "spam" as subject for removal commits
Eric Wong [Thu, 16 Nov 2017 18:48:39 +0000 (18:48 +0000)]
learn: use "spam" as subject for removal commits

Sometimes an email is an innocent removal "rm" for a
misdirected, off-topic post, while most removed messages are
"spam".  Allow anybody to look at history and easily distinguish
the reason for removing the message.

6 years agoview: s/threaded/nested/ in view
Eric Wong [Wed, 18 Oct 2017 21:28:52 +0000 (21:28 +0000)]
view: s/threaded/nested/ in view

We always do threading, so perhaps it's not a good name.
"Nested" is probably more appropriate and closer to what
people are used to seeing.

6 years agombox: support inline filename via Content-Disposition header
Eric Wong [Wed, 4 Oct 2017 22:54:23 +0000 (22:54 +0000)]
mbox: support inline filename via Content-Disposition header

This is hopefully more sensical than "raw" files from
resulting downloads.

6 years agosearch: try to fill in ghosts when generating thread skeleton
Eric Wong [Tue, 3 Oct 2017 19:43:30 +0000 (19:43 +0000)]
search: try to fill in ghosts when generating thread skeleton

Since we attempt to fill in threads by Subject, our thread
skeletons can cross actual thread IDs, leading to the
possibility of false ghosts showing up in the skeleton.
Try to fill in the ghosts as well as possible by performing
a message lookup.

6 years agothreading: deal with improperly-terminated References headers
Eric Wong [Mon, 2 Oct 2017 22:19:16 +0000 (22:19 +0000)]
threading: deal with improperly-terminated References headers

We should not blindly join References and In-Reply-To headers
as a single string, because some messages can have an open
angle brace '<' in References: without a corresponding '>'.

6 years agowww: Atom stream respects timezone
Eric Wong [Thu, 13 Jul 2017 22:47:29 +0000 (22:47 +0000)]
www: Atom stream respects timezone

Oops, we must not discard the timezone when parsing dates
for the Atom stream.

6 years agoMANIFEST: add hosted list
Eric Wong [Thu, 13 Jul 2017 22:46:29 +0000 (22:46 +0000)]
MANIFEST: add hosted list

6 years agodoc: add ruby-dev mirror to the list of hosted mirrors
Eric Wong [Sun, 2 Jul 2017 21:43:51 +0000 (21:43 +0000)]
doc: add ruby-dev mirror to the list of hosted mirrors

It seems Xapian is not prepared for Japanese, unfortunately.

https://public-inbox.org/meta/20170702213657.GA5312@dcvr/

6 years agodoc: add a list of hosted archives for external projects
Eric Wong [Fri, 30 Jun 2017 18:47:33 +0000 (18:47 +0000)]
doc: add a list of hosted archives for external projects

This will hopefully increase visibility of some archives.

6 years agoview: cull redundant phrases in subjects
Eric Wong [Thu, 29 Jun 2017 21:48:30 +0000 (21:48 +0000)]
view: cull redundant phrases in subjects

There is no need to show the same phrases over and over again
in thread skeletons, it adds to visual noise and makes things
more difficult to read.

6 years agoscripts/import_maildir: rewrite to use Import
Eric Wong [Thu, 29 Jun 2017 07:14:28 +0000 (07:14 +0000)]
scripts/import_maildir: rewrite to use Import

This will be much faster and invoking -mda for every message.

6 years agohval: only perform one substitution when obfuscating
Eric Wong [Thu, 29 Jun 2017 00:10:38 +0000 (00:10 +0000)]
hval: only perform one substitution when obfuscating

Only one substitution character is necessary when obfuscating
email addresses.

6 years agomsgmap: reduce constant usage
Eric Wong [Mon, 26 Jun 2017 18:13:57 +0000 (18:13 +0000)]
msgmap: reduce constant usage

It is needless bloat and doesn't seem to help with readability,
in retrospect, either.

6 years agowatch: avoid potential race condition while quitting
Eric Wong [Mon, 26 Jun 2017 17:44:41 +0000 (17:44 +0000)]
watch: avoid potential race condition while quitting

We must not trigger future activity when initializing
a -watch shutdown.

6 years agotests: deal with the removal of '.' from @INC in newer Perl
Eric Wong [Mon, 26 Jun 2017 04:34:13 +0000 (04:34 +0000)]
tests: deal with the removal of '.' from @INC in newer Perl

Oops, this is needed for Perl 5.22 (tested 5.24.1) since '.'
was removed due to security problems.  Fwiw, I consider this
change to Perl an overreaction and do not agree with it.

6 years agowatch: commit changes to fast-import sooner
Eric Wong [Mon, 26 Jun 2017 02:56:03 +0000 (02:56 +0000)]
watch: commit changes to fast-import sooner

We should make changes visible sooner, even during
lengthy scans.

6 years agowatch: use "self-inotify-tempfile trick" for quit
Eric Wong [Sat, 24 Jun 2017 22:26:28 +0000 (22:26 +0000)]
watch: use "self-inotify-tempfile trick" for quit

This should be more reliable and safer as it'll ensure
existing fast-import instances are shut down properly.

6 years agowatch: improve fairness during full rescans
Eric Wong [Sat, 24 Jun 2017 07:33:44 +0000 (07:33 +0000)]
watch: improve fairness during full rescans

We need to ensure new messages are being processed
fairly during full rescans, so have the ->scan subroutine
yield and reschedule itself.  Additionally, having a
long-running task inside the signal handler is dangerous
and subject to reentrancy bugs.

Due to the limitations of the Filesys::Notify::Simple interface,
we cannot rely on multiplexing I/O interfaces (select, IO::Poll,
Danga::Socket, etc...) for this.  Forking a separate process
was considered, but it is more expensive for a mostly-idle
process.

So, we use a variant of the "self-pipe trick" via inotify (or
whatever Filesys::Notify::Simple gives us).  Instead of writing
to our own pipe, we write to a file in our own temporary
directory watched by Filesys::Notify::Simple to trigger events
in signal handlers.

6 years agospamc: retry on EINTR
Eric Wong [Sat, 24 Jun 2017 00:52:10 +0000 (00:52 +0000)]
spamc: retry on EINTR

Signals can fire on us at any time if we're using blocking sysread.

6 years agowatch: ensure HUP causes the scanner to be reloaded
Eric Wong [Sat, 24 Jun 2017 00:00:04 +0000 (00:00 +0000)]
watch: ensure HUP causes the scanner to be reloaded

Otherwise the old watcher may run indefinitely

6 years agomda: set List-ID correctly according to RFC2919
Eric Wong [Mon, 26 Jun 2017 03:05:39 +0000 (03:05 +0000)]
mda: set List-ID correctly according to RFC2919

Oops, due to an old mistake , List-ID was set incorrectly
in the MDA.  This could cause some breakage w.r.t. mail filters.

6 years agolinkify: handle URLs in parenthesized statements
Eric Wong [Fri, 23 Jun 2017 22:42:34 +0000 (22:42 +0000)]
linkify: handle URLs in parenthesized statements

Sometimes, URLs exist at the end of parethesized statements,
and we shouldn't unnecessarily capture that.

(example: https://public-inbox.org/ruby-core/20170623032722.GA8124@dcvr/)

6 years agoallow admins to configure non-obfuscated addresses/domains
Eric Wong [Fri, 23 Jun 2017 20:23:07 +0000 (20:23 +0000)]
allow admins to configure non-obfuscated addresses/domains

We will also treat all known list addresses as non-obfuscated.

By setting publicinbox.noObfuscate in ~/.public-inbox/config,
this will allow users to disable address obfuscation on a
per-domain or per-address basis.

6 years agoconfig: assume lists have multiple addresses
Eric Wong [Fri, 23 Jun 2017 19:41:51 +0000 (19:41 +0000)]
config: assume lists have multiple addresses

This should simplify the rest of our code for handling
the do-not-obfuscate list.

6 years agoview: add newline before mailto: instructions in reply
Eric Wong [Fri, 23 Jun 2017 09:51:47 +0000 (09:51 +0000)]
view: add newline before mailto: instructions in reply

This is necessary to retain consistent spacing around bullet
points.

Fixes: 666844ae42b5b17f ("reply: handle address obfuscation :<")
6 years agombox: show application/mbox for obfuscated inboxes
Eric Wong [Fri, 23 Jun 2017 03:39:08 +0000 (03:39 +0000)]
mbox: show application/mbox for obfuscated inboxes

Sigh, yet another place to handle obfuscation for misguided
people who expect it.  Maybe this will do something to prevent
spammers from getting addresses, while still allowing the
"curl $URL | git am" use case to work.

6 years agoreply: handle address obfuscation :<
Eric Wong [Fri, 23 Jun 2017 02:25:33 +0000 (02:25 +0000)]
reply: handle address obfuscation :<

We can show users a lightly-obfuscated Bourne shell command
for invoking "git send-email" for address obfuscation.  However,
I'm not sure if the mailto: arg will work effectively since
URL encoding is probably too well-known to be effective.

6 years agosearchidx: fallback to lookup on pre-set article numbers
Eric Wong [Fri, 23 Jun 2017 01:43:21 +0000 (01:43 +0000)]
searchidx: fallback to lookup on pre-set article numbers

Yet another hiccup from reusing pre-set article numbers on
various ruby-lang.org mailing lists.  This was causing messages
to not appear to NNTP readers which use XOVER.

6 years agomsgmap: ignore duplicates instead of dying
Eric Wong [Fri, 23 Jun 2017 01:19:46 +0000 (01:19 +0000)]
msgmap: ignore duplicates instead of dying

This prevents public-inbox-watch from dying when reloading
(and thus rescanning) already-imported directories.

6 years agowatchmaildir: deal with rejected (100) messages
Eric Wong [Fri, 23 Jun 2017 00:47:23 +0000 (00:47 +0000)]
watchmaildir: deal with rejected (100) messages

The RubyLang filter is strict about what messages it rejects, so
the spam learning path will not auto-train or remove messages
missing X-Mail-Count headers.

6 years agotest for PublicInbox::Filter::RubyLang
Eric Wong [Thu, 22 Jun 2017 21:25:39 +0000 (21:25 +0000)]
test for PublicInbox::Filter::RubyLang

This will make it easier to prevent breakage in the future.

6 years agofilter/rubylang: reuse altid entry from inbox object
Eric Wong [Thu, 22 Jun 2017 21:04:53 +0000 (21:04 +0000)]
filter/rubylang: reuse altid entry from inbox object

This allows users to DRY up their config a bit and avoid
specifying altid twice when reusing the NNTP-centric msgmap
for [ruby-*:\d+] serial numbers.

My current work-in-progress ~/.public-inbox/config entry
for the ruby-core list is:

------8<-------
[publicinbox "ruby-core"]
address = ruby-core@ruby-lang.org
url = //public-inbox.org/ruby-core
mainrepo = /path/to/ruby-core.git
newsgroup = inbox.comp.lang.ruby.core
watchheader = List-Id:<ruby-core.ruby-lang.org>
altid = serial:ruby-core:file=msgmap.sqlite3
watch = maildir:/path/to/Maildir/.INBOX.ruby
filter = PublicInbox::Filter::RubyLang

6 years agomsgmap: mid_insert ignores duplicates instead of die-ing
Eric Wong [Thu, 22 Jun 2017 19:51:23 +0000 (19:51 +0000)]
msgmap: mid_insert ignores duplicates instead of die-ing

This will allow smoother imports as occasional Message-ID
duplicates happen and the best we can do is ignore the
second one.

6 years agoadd filter for RubyLang lists
Eric Wong [Wed, 21 Jun 2017 23:33:49 +0000 (23:33 +0000)]
add filter for RubyLang lists

Unfortunately, it appears we have to reject this and instead add
support filtering at View time(*), due to DKIM signatures in
messages from ruby-lang.org.

(*) which may not be worth it

6 years agoimport: fix encoding issues from weird "raw" emails
Eric Wong [Tue, 20 Jun 2017 22:06:54 +0000 (22:06 +0000)]
import: fix encoding issues from weird "raw" emails

This seems to allow weirdly-encoded "raw" emails in
  blade.nagaokaut.ac.jp/ruby/ruby-core/*
to be handled without difficulties.

6 years agoview: implement optional address obfuscation
Eric Wong [Fri, 16 Jun 2017 02:03:32 +0000 (02:03 +0000)]
view: implement optional address obfuscation

This is lightly-tested and seems to work.  I'm still
hesitant to support this, but the alternative of receiving death
threats for displaying unobfuscated addresses seems to
be not worth it.

6 years agoreply: support Reply-To
Eric Wong [Wed, 14 Jun 2017 00:10:53 +0000 (00:10 +0000)]
reply: support Reply-To

Reply-To is common and probably should've been supported,
since day one, but we won't omit other addresses, either.

6 years agoreplyto parameter support
Eric Wong [Wed, 14 Jun 2017 00:10:52 +0000 (00:10 +0000)]
replyto parameter support

This allows us to support centralized mailing lists (which suck,
but better than no mailing list at all).

6 years agoview: split out reply logic into its own module
Eric Wong [Wed, 14 Jun 2017 00:10:51 +0000 (00:10 +0000)]
view: split out reply logic into its own module

We'll be adding more reply options for centralized mailing
lists.  So split out the logic so it's easy-to-find.
Organizing code is hard :<

6 years agosearchidx: remove messages correctly from Xapian index
Eric Wong [Thu, 15 Jun 2017 23:07:58 +0000 (23:07 +0000)]
searchidx: remove messages correctly from Xapian index

This fixes a bug introduced in
commit 7eeadcb62729b0efbcb53cd9b7b181897c92cf9a
("search: remove unnecessary abstractions and functionality")

6 years agosearch: allow searching within mail diffs
Eric Wong [Wed, 14 Jun 2017 00:14:48 +0000 (00:14 +0000)]
search: allow searching within mail diffs

This can be tied into a repository browser to browse
in-flight topics on a mailing list.