From: Martin K. <mk...@gm...> - 2014-09-15 13:27:24
|
On Mon, 15 Sep 2014, Matthias Andree wrote: > Am 10.09.2014 um 10:47 schrieb Martin Koeppe: > >> IMO all these SSL related options should be server options, not user >> options, as they apply before any user name is transmitted to the >> server, so there should be no need have it configured differently for >> every user. Ok, the server could behave diferently after user logon >> depending on the previously negotiated connection. But then I could >> have 2 different poll sections for the same server. > > I have always wondered if we should be adding some notion of scope to > settings, but this would then have to go along with parenthesizing > (perhaps using curly braces) of some form, perhaps apply defaults ... to > ... end defaults statements. > > Sooner or later I will have to rewrite the bison parser because it > invariably must leak memory and has some minor quirks, but have not > decided on a solution. If you need to / want to do some incompatible changes anyway, why not switch to a totally different config file format? The one that bind uses (basically C like) would be my favorite. With the C-style /* multi-line comments */ the skip keyword isn't needed anymore IMO. Also powershell comments would be ok: "#" for single line, "<#" start comment, and "#>" end comment. Then a config could look like this: { server = "pop.example.com" ssl = "none" poll { user = "pop-server-user" pass = "SECRET" sendto = "user@domain.local" } /* nested defaults */ { ssl = starttls sendto = "user2@domain.local" poll { user = "user2" pass = "123456" verbose = yes // to debug this particular poll } poll { user = "user3" pass = "7890" keep = yes // overwrite default } // continue nested defaults block keep = no fetchall = yes } // end of nested defaults block } { server = "another.server.com" poll { /* ... */ } } There are 2 types of blocks, default blocks (unnamed above) which can be thought as inner tree nodes, and poll blocks (leaf nodes). The whole file can be thought of being in a big default block (root node), where the compiled-in defaults are listed. No limit for the nesting level. Poll blocks must not contain any other blocks. A poll is done for each poll block. No difference between server and user options, as it may be desirable to move e.g. the account name used on several servers to a default block. The poll block must just have enough options in it and above in the tree to do the poll. A minimal config for only one account could just look like: poll { server = "servername" user = "user" pass = "*" sendto = "loc@l" } Or even like this: server = "servername" user = "user" pass = "*" /* sometimes the same password is used for several accounts */ sendto = "loc@l" poll {} I only use fetchmail for POP3 polls with single-drop. So maybe not all of fetchmail's functions can be covered with this. Block names and option names can be changed of course. A ";" like in C might be appended to each line. Or, as in powershell, is optional, unless you want to specify 2 options on one line, where you could delimit both of these with a ";". OTOH if there are multi-line values (certificates?), then always a terminating ";" might be good, unless the block ends anyway. Just as an idea. Martin |