Mercurial > docs > master
comparison discussion.roff @ 138:cc35686f359e
Wrote about profile reading.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Wed, 04 Jul 2012 16:28:39 +0200 |
parents | 470d5db0c06c |
children | b7b81ae9c9d8 |
comparison
equal
deleted
inserted
replaced
137:83681ad27ec8 | 138:cc35686f359e |
---|---|
102 recipient addresses from the message header, and hand the message | 102 recipient addresses from the message header, and hand the message |
103 over to the MSA. | 103 over to the MSA. |
104 For example, a wrapper script for qmail would be: | 104 For example, a wrapper script for qmail would be: |
105 .VS | 105 .VS |
106 #!/bin/sh | 106 #!/bin/sh |
107 # ignore command line arguments | 107 exec qmail-inject # ignore command line arguments |
108 exec qmail-inject | |
109 VE | 108 VE |
110 The requirement to parse the recipient addresses out of the message header | 109 The requirement to parse the recipient addresses out of the message header |
111 is likely to be removed in the future. | 110 is likely to be removed in the future. |
112 Then mmh would give the recipient addresses as command line arguments. | 111 Then mmh would give the recipient addresses as command line arguments. |
113 This appears to be the better interface. | 112 This appears to be the better interface. |
3273 | 3272 |
3274 | 3273 |
3275 | 3274 |
3276 .H2 "Profile Reading | 3275 .H2 "Profile Reading |
3277 .P | 3276 .P |
3278 FIXME XXX | 3277 The MH profile contains the configuration for the user-specific MH setup. |
3279 | 3278 MH tools read the profile right after starting up, |
3280 commit 3e017a7abbdf69bf0dff7a4073275961eda1ded8 | 3279 as it contains the location of the user's mail storage |
3281 Author: markus schnalke <meillo@marmaro.de> | 3280 and similar settings that influence the whole setup. |
3282 Date: Wed Jun 27 14:23:35 2012 +0200 | 3281 Further more, the profile contains the default switches for the tools, |
3283 | 3282 hence, it must be read before the command line switches are processed. |
3284 spost: Read profile and context now. Removed -library switch. | 3283 .P |
3285 spost is a full part of the mmh toolchest, hence, it shall read the | 3284 For historic reasons, some MH tools did not read the profile and context. |
3286 profile/context. This will remove the need to pass profile information | 3285 Among them were |
3287 from send to spost via command line switches. | 3286 .Pn post /\c |
3288 In January 2012, there had been a discussion on the nmh-workers ML | 3287 .Pn spost , |
3289 whether post should read the profile/context. There wasn't a clear | 3288 .Pn mhmail , |
3290 answer. It behavior was mainly motivated by the historic situation, | 3289 and |
3291 it seems. My opinion on the topic goes into the direction that every | 3290 .Pn slocal . |
3292 tool that is part of the mmh toolchest should read the profile. That | 3291 The reason why these tools ignored the profile were not clearly stated. |
3293 is a clear and simple concept. Using MH tools without wanting to | 3292 During the discussion on the nmh-workers mailing list, |
3294 interact with MH (like mhmail had been) is no more a practical problem. | 3293 .[ |
3295 | 3294 nmh-workers levine post profile |
3296 commit 32d4f9daaa70519be3072479232ff7be0500d009 | 3295 .] |
3297 Author: markus schnalke <meillo@marmaro.de> | 3296 David Levine posted an explanation, quoting John Romine: |
3298 Date: Wed Jun 27 13:15:47 2012 +0200 | 3297 .QS |
3299 | 3298 I asked John Romine and here's what he had to say, which |
3300 mhmail: Read the context! | 3299 agrees and provides an example that convinces me: |
3301 mhmail will change from a mailx-replacment to an alternative to | 3300 .QS |
3302 `comp -ed prompter', thus being a send front-end. Hence, mhmail | 3301 My take on this is that post should not be called by |
3303 should not stay outside the profile/context respecting mmh toolchest. | 3302 users directly, and it doesn't read the .mh_profile |
3304 | 3303 (only front-end UI programs read the profile). |
3305 | 3304 .QP |
3306 slocal | 3305 For example, there can be contexts where post is called |
3307 | 3306 by a helper program (like 'mhmail') which may be run by |
3307 a non-MH user. We don't want this to prompt the user | |
3308 to create an MH profile, etc. | |
3309 .QP | |
3310 My suggestion would be to have send pass a (hidden) | |
3311 `\-fileproc proc' option to post if needed. You could also | |
3312 use an environment variable (I think send/whatnow do | |
3313 this). | |
3314 .QE | |
3315 I think that's the way to go. My personal preference is to use a command line option, not an environment variable. | |
3316 .QE | |
3317 .P | |
3318 To solve the problem of | |
3319 .Pn post | |
3320 not honoring the | |
3321 .Pe fileproc | |
3322 profile entry, | |
3323 the community roughly agreed that a switch | |
3324 .Sw -fileproc | |
3325 should be added to | |
3326 .Pn post | |
3327 to be able to pass a different fileproc. | |
3328 I strongly disagree with this approach because it does not solve | |
3329 the problem; it only removes a single symptom. | |
3330 The problem is that | |
3331 .Pn post | |
3332 does not behave as expected. | |
3333 But all programs should behave as expected. | |
3334 Clear and simple concepts are a precondition for this. | |
3335 Hence, the real solution is having all MH tools read the profile. | |
3336 .P | |
3337 Yet, the problem has a further aspect. | |
3338 It mainly originates in | |
3339 .Pn mhmail . | |
3340 .Pn mhmail | |
3341 was intended to be a replacement for | |
3342 .Pn mailx | |
3343 on systems with MH installations. | |
3344 .Pn mhmail | |
3345 should have been able to use just like | |
3346 .Pn mailx , | |
3347 but sending the message via MH's | |
3348 .Pn post | |
3349 instead of | |
3350 .Pn sendmail . | |
3351 Using | |
3352 .Pn mhmail | |
3353 should not be influenced by the question whether the user had | |
3354 MH set up for himself or not. | |
3355 .Pn mhmail | |
3356 did not read the profile as this requests the user to set up MH | |
3357 if not done yet. | |
3358 As | |
3359 .Pn mhmail | |
3360 used | |
3361 .Pn post , | |
3362 .Pn post | |
3363 could not read the profile neither. | |
3364 This is the reason why | |
3365 .Pn post | |
3366 does not read the profile. | |
3367 This is the reason for the actual problem. | |
3368 It was not much of a problem because | |
3369 .Pn post | |
3370 was not intended to be used by users directly. | |
3371 .Pn send | |
3372 is the interactive front-end to | |
3373 .Pn post . | |
3374 .Pn send | |
3375 read the profile and passed all relevant values on the command line to | |
3376 .Pn post | |
3377 \(en an awkward solution. | |
3378 .P | |
3379 The important insight is that | |
3380 .Pn mhmail | |
3381 is no true MH tool. | |
3382 The concepts broke because this outlandish tool was treated as any other | |
3383 MH tool. | |
3384 Instead it should have been treated accordingly to its foreign style. | |
3385 The solution is not to prevent the tools reading the profile but | |
3386 to instruct them reading a different profile. | |
3387 .Pn mhmail | |
3388 could have set up a well-defined profile and caused all MH tools | |
3389 in the session use it by exporting an environment variable. | |
3390 With this approach, no special cases would have been introduced, | |
3391 no surprises would have been caused. | |
3392 By writing a clean-profile-wrapper, the concept could have been | |
3393 generalized orthogonally to the whole MH toolchest. | |
3394 Then Rose's motivation behind the decision that | |
3395 .Pn post | |
3396 ignores the profile, as quoted by Jeffrey Honig, | |
3397 .[ | |
3398 nmh-workers post profile | |
3399 .] | |
3400 would have become possible: | |
3401 .QS | |
3402 when you run mh commands in a script, you want all the defaults to be | |
3403 what the man page says. | |
3404 when you run a command by hand, then you want your own defaults... | |
3405 .QE | |
3406 .LP | |
3407 Yet, I consider this explanation short-sighted. | |
3408 We should rather regard theses two cases as just two different MH setups, | |
3409 based on two different profiles. | |
3410 Mapping such problems on the concepts of switching between different | |
3411 profiles, solves them once for all. | |
3412 .P | |
3413 In mmh, the wish to have | |
3414 .Pn mhmail | |
3415 as as replacement for | |
3416 .Pn mailx | |
3417 is considered obsolete. | |
3418 Mmh's | |
3419 .Pn mhmail | |
3420 does no longer cover this use-case. | |
3421 Currently, | |
3422 .Pn mhmail | |
3423 is in a transition state. | |
3424 .Ci 32d4f9daaa70519be3072479232ff7be0500d009 | |
3425 It may become a front-end to | |
3426 .Pn comp , | |
3427 which provides an interface more convenient in some cases. | |
3428 In this case, | |
3429 .Pn mhmail | |
3430 will become an ordinary MH tool, reading the profile. | |
3431 If, however, this idea will not convince, then | |
3432 .Pn mhmail | |
3433 will be removed. | |
3434 .P | |
3435 Every program in the mmh toolchest reads the profile. | |
3436 The only exception is | |
3437 .Pn slocal , | |
3438 which is not considered part of the mmh toolchest. | |
3439 This MDA is only distributed with mmh, currently. | |
3440 Mmh has no | |
3441 .Pn post | |
3442 program, but | |
3443 .Pn spost , | |
3444 which now reads the profile. | |
3445 .Ci 3e017a7abbdf69bf0dff7a4073275961eda1ded8 | |
3446 With this change, | |
3447 .Pn send | |
3448 and | |
3449 .Pn spost | |
3450 can be considered to be merged. | |
3451 Direct invocations of | |
3452 .Pn spost | |
3453 are only done by the to-be-changed | |
3454 .Pn mhmail | |
3455 implementation and by | |
3456 .Pn rcvdist , | |
3457 which will require rework. | |
3458 .P | |
3459 The | |
3460 .Fu context_foil() | |
3461 function to pretend to have read an empty profile was removed. | |
3462 .Ci 68af8da96bea87a5541988870130b6209ce396f6 | |
3463 All mmh tools read the profile. | |
3308 | 3464 |
3309 | 3465 |
3310 | 3466 |
3311 .H2 "Standard Libraries | 3467 .H2 "Standard Libraries |
3312 .P | 3468 .P |