Hi,
I have an intern coming to work for a couple of months in the summer. Neither of us will be python experts, but part of the point is to learn, right?
I'd like him to work on some aspects of Mailman 3.
I plan to get LMTP working to my taste, by (a) rejecting messages for non-existent lists at RCTP time, and (b) rejecting messages from unwanted sender addresses at RCPT time. I Think (a) will be easy to achieve, and (b) only slightly more challenging.
So, I'm after ideas for what to do next. I'm vaguely thinking about (c) integration (which will probably begin from working up a specification for exactly what that means), and possibly (d) user interface design for end users and list admins.
Any suggestions for (c) and (d) or alternative areas that need some focus would be useful.
Also, can you give me pointers to a good place to learn about doctest, please?
Finally, is there any overview documentation for developers new to the Mailman architecture?
-- Ian Eiloart IT Services, University of Sussex x3148
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On May 2, 2008, at 10:59 AM, Ian Eiloart wrote:
I have an intern coming to work for a couple of months in the
summer. Neither of us will be python experts, but part of the point
is to learn, right?
Absolutely!
I'd like him to work on some aspects of Mailman 3.
I plan to get LMTP working to my taste, by (a) rejecting messages
for non-existent lists at RCTP time, and (b) rejecting messages from
unwanted sender addresses at RCPT time. I Think (a) will be easy to
achieve, and (b) only slightly more challenging.
This sounds great. With (b) there could be multiple list-specific
policies, so we should make this pluggable.
So, I'm after ideas for what to do next. I'm vaguely thinking about
(c) integration (which will probably begin from working up a
specification for exactly what that means), and possibly (d) user
interface design for end users and list admins.Any suggestions for (c) and (d) or alternative areas that need some
focus would be useful.
By user interface design do you mean the web u/i? None of that really
works in MM3 right now. Some of the other work happening in the REST
interface may allow us to separate the web u/i too.
Also, can you give me pointers to a good place to learn about
doctest, please?Finally, is there any overview documentation for developers new to
the Mailman architecture?
Actually these two subjects go hand-in-hand, although there should be
better overview documentation.
I'm a big fan of separate file doctests (as opposed to docstring
doctests which I'm not a fan of at all). The important thing to
remember is that doctests are documentation first and tests second.
Or another way of saying it is that doctests are testable documentation.
This is important because you really want to take care to write the
narrative of a doctest in a clear and concise way. I'm experimenting
with this idea that all tests can be done using doctest, with two
different audiences in mind. First is the developer (or user) who
wants to understand a piece of the system, and the second is maybe a
maintainer who wants to write comprehensive unit tests with total
coverage. I don't know if I can achieve "all tests are doctests", but
I'm trying.
Although it's a bit centered on docstring doctests (which I don't
like), the Python doctest module has some good background: http://www.python.org/doc/current/lib/module-doctest.html
From there, search the Mailman 3 tree for 'doc/' subdirectories.
All .txt files in those directories are doctests. There's a little
bit of harness hooking in mailman/tests/test_documentation.py,
including the doctest flags that I think are the most useful. A good
(well, recent ;) example of a doctest that I like is mailman/doc/
chains.txt.
I think it's better to have fewer magical globs in the doctest harness
and do most of the work, including imports in the doctest. It's just
a better way to explain how a particular subsystem works or how you
would use it.
Use ellipsis liberally but judiciously to improve readability. Always
be as explicit as possible in showing return values. E.g. it's better
to have something like this:
>>> chain.name
'reject'
than this:
>>> chain.name == 'reject'
True
because when the latter fails, it's more difficult to figure the
problem out. The one common exception is in printing the value None
because None doesn't show up in the interactive prompt. E.g. instead of
>>> chain.foobar = None
>>> chain.foobar
>>> chain.baz = 7
do this:
>>> chain.foobar = None
>>> print chain.foobar
None
>>> chain.baz = 7
I'm beginning to think that its better to print strings than return
them because ascii strs and unicodes print with the same value, but
have different reprs, and the u-prefixes are annoying.
Does any of that help? You should definitely look at the Mailman 3
code and I'll be happy to answer any more questions you might have.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin)
iEYEARECAAYFAkggojkACgkQ2YZpQepbvXHOSACgnUcbW7CMi9mvLXfWgVAxzimv BhEAnj439jpogZTMm+h25uzq7pDE5HWq =evuZ -----END PGP SIGNATURE-----
--On 6 May 2008 14:23:53 -0400 Barry Warsaw <barry@list.org> wrote:
I plan to get LMTP working to my taste, by (a) rejecting messages for non-existent lists at RCTP time, and (b) rejecting messages from unwanted sender addresses at RCPT time. I Think (a) will be easy to achieve, and (b) only slightly more challenging.
This sounds great. With (b) there could be multiple list-specific policies, so we should make this pluggable.
The intention is to get the policy from the list. The simplest way to do it would be to treat "reject" as an SMTP time reject, rather than a bounce. At my site, at least, I would not offer "bounce" as a choice if smtp rejection is available.
Indeed, we currently recommend that list owners don't use "reject".
-- Ian Eiloart IT Services, University of Sussex x3148
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On May 7, 2008, at 5:23 AM, Ian Eiloart wrote:
I plan to get LMTP working to my taste, by (a) rejecting messages for non-existent lists at RCTP time, and (b) rejecting messages from unwanted sender addresses at RCPT time. I Think (a) will be easy to achieve, and (b) only slightly more challenging.
This sounds great. With (b) there could be multiple list-specific policies, so we should make this pluggable.
The intention is to get the policy from the list. The simplest way
to do it would be to treat "reject" as an SMTP time reject, rather
than a bounce. At my site, at least, I would not offer "bounce" as a
choice if smtp rejection is available.Indeed, we currently recommend that list owners don't use "reject".
Interesting. I'll have to think about this, but it seems to me that
if you wanted to turn off 'reject' in Mailman 3, you'd have to end up
disabling that chain (for things that make it past LMTP). For the
LMTP hooks, it should be no problem, because I think the way you're
going to do it is to just do the SMTP-reject if the right rules match
during the LMTP phase, i.e. that part of the system wouldn't run the
full chain processor.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin)
iEYEARECAAYFAkgw2nEACgkQ2YZpQepbvXEBuQCdHVpYJDNa4RLgUwSOTrm/C7Bz ajkAnRpdrFYH3tTbEUfnhBXsQL33bsZA =xk4G -----END PGP SIGNATURE-----
--On 6 May 2008 14:23:53 -0400 Barry Warsaw <barry@list.org> wrote:
Does any of that help? You should definitely look at the Mailman 3 code and I'll be happy to answer any more questions you might have.
I'm sure all of that will help when I get into the kitchen, but I'm having problems finding the right street. I thought I'd be able to leap right in, but the more I look, the more I find that I need a map. Perhaps something describing the lifecycle of a typical email, and which bits of top level code are responsible for handling it at which stage. Or maybe just a recommended order for reading the doctests would do the job.
With that understanding, I can follow the API calls to get at the detail.
-- Ian Eiloart IT Services, University of Sussex x3148
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On May 7, 2008, at 5:37 AM, Ian Eiloart wrote:
Does any of that help? You should definitely look at the Mailman 3
code and I'll be happy to answer any more questions you might have.I'm sure all of that will help when I get into the kitchen, but I'm
having problems finding the right street. I thought I'd be able to
leap right in, but the more I look, the more I find that I need a
map. Perhaps something describing the lifecycle of a typical email,
and which bits of top level code are responsible for handling it at
which stage. Or maybe just a recommended order for reading the
doctests would do the job.With that understanding, I can follow the API calls to get at the
detail.
I would definitely start with the docs in mailman/queue/docs. These
describe the various queues, what their responsibilities are, where
they get mail from and where they send mail to. Most messages will
come in via the lmtp or incoming queues, so think of these as the
entrances for email into the system.
There are some general docs in mailman/docs which describe the data
objects you'll be dealing with, such as users, addresses, mailing
lists, etc.
Next, look at the mailman/pipeline/docs for how the message pipeline
processor works, and at mailman/rules/docs for how the individual rule
implementations work.
If that still doesn't help, let me know and I will attempt to add more
doctests to fill in the gaps.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin)
iEYEARECAAYFAkgw3FEACgkQ2YZpQepbvXGsBQCfaa37srmcZ5iQpo0NEra70TUX 8+YAoKjk1KmCb8qre6R5Ff8mTodLFDn5 =hE8+ -----END PGP SIGNATURE-----
participants (3)
-
Barry Warsaw
-
Ian Eiloart
-
Stephen J. Turnbull