On Tue, 2017-07-18 at 15:46 +0200, David Demelier wrote: > Hello all, > > I've installed patchwork 2.0.0-rc4 as described in the deployment guide. > I've got almost everything working (uwsgi, nginx, database and getmail). > Getmail receives patches as well and delivers them to patchwork, however > nothing is shown in the appropriate project. > > I guess I have something misconfigured in the patchwork admin page. > > From my mailing list headers: > > - List-Id: Test Mailing List > - List-Post: <mailto:test (AT) malikania.fr> > > I have created the following project in the administration page: > > - Linkname: test > - Name: Test > - Listid: Test Mailing List > - Listemail: test (A) malikania.fr
Patchwork supports two ways of identifying what project a patch belongs to [1]: by providing a 'listid' value (only possible with the 'parsearchive' tool), or by extracting a suitable value for the header. In both cases, the provided/extracted listid value is compared against the values stored in the 'Project.listid' field [2]. For the latter case (extracting the value from headers), we check for three headers: 'List-ID', 'X-Mailing-List', or 'X-list' [3]. It doesn't do anything with the List-Post header. If any of these must be present in the mails, then their value must match one of the following regexes [4]: .*<([^>]+)>.* Any string inside a set of angle brackets. This can include words with spaces. or ^([\S]+)$ Any string that doesn't include a space. Based on the RFC that defines the List-Id header [4], it's expected that the header will "appear like a host name in a domain of the list owner" [5]. As such, Patchwork appears to be doing the correct thing here. Unfortunately, it also means that your header, 'Test Mailing List', is not acceptable as it is not surrounded by brackets and contains spaces. There are two courses of action here. You could change (or ask the list admin to change) the list ID to abide by that spec and update Patchwork's configuration accordingly. That would mean you'd probably use something like 'test.malikania.fr'. Alternatively, you could modify Patchwork to accept space in the List-ID header. This would mean converting the second regex to a catch-all/wildcard regex. It's worth pointing out that I don't like this option as its not spec compliant, and I would not be inclined to take this patch upstream. You'd have to carry this patch locally. I'll be sure to add all of this information to the documentation for deployers who encounter this issue in the future. In any case, do let me know how you get on. Cheers, Stephen [1] https://github.com/getpatchwork/patchwork/blob/v2.0.0-rc4/patchwork/parser. py#L861-L864 [2] https://github.com/getpatchwork/patchwork/blob/v2.0.0-rc4/patchwork/parser. py#L145 [3] https://github.com/getpatchwork/patchwork/blob/v2.0.0-rc4/patchwork/parser. py#L49 [4] https://github.com/getpatchwork/patchwork/blob/v2.0.0-rc4/patchwork/parser. py#L153-L154 [5] https://www.ietf.org/rfc/rfc2919.txt [6] http://www.rfcreader.com/#rfc2919_line74 _______________________________________________ Patchwork mailing list [email protected] https://lists.ozlabs.org/listinfo/patchwork
