On Sun, 21 Jul 2002 16:37:21 -0500
Hal DeVore <haldevore@acm.org> wrote:
>>>>>> On Fri, 19 Jul 2002, "J" == J C Lawrence wrote:
J> What would be great is if I could build the relevant comp file
J> dynamically at runtime.
> Sure.  Use the "folder change" hooks.  Create a proc named
> Hook_FolderChangeSomething (where "Something" is meaningful and likely
> to be unique in the universe just in case you distribute this to
> others).  Put the proc in a file in your ~/.tk/exmh directory,
> regenerate the tclIndex, restart exmh.
> In that proc you can do anything you want, like rewrite your
> ~/Mail/comp file.
Yeah, that would work, tho there are race conditions and likely/possible
ugly side effects (eg unintentionally left-over comp files).  I've ended
up taking a very different route: TMDA (http://www.tmda.net).  In
particular I use TMDA outbound filters to add custom plus addresses to
the messages I send to specific lists.
For example, for the tmda-users list I want a From: address of
claw+tmda@kanga.nu, so the relevant outbound filter is:
to tmda-users@libertine.org ext=tmda
which rewrites my From: header transparently.  When I get next month's
batch of password reminders from Mailman lists I'll be running about
resubscribing to each list either with a standard plus address or a
TMDA-based sender address (ie an address which only the list in question
is able to send mail to).
-+-
Getting TMDA fully happy with nmh was a minor pain.
Reasons:
nmh, like MH, by default delivers outbound mail via SMTP to port 25 on
a defined host.  The port number cannot be configured (it calls
getservbyname() which does a lookup against "smtp" in /etc/services).
Ergo, you are constrained to use tell nmh to use tmda-sendmail instead
of SMTP.
Using sendmail as the delivery method under MH instead of SMTP is not
recommended as is loses a number of useful bits of robustness in mail
delivery failure modes.  Further, when nmh is configured to use
sendmail instead of SMTP nmh's whom tool calls sendmail as follows:
.../sendmail/ -m -t -i -bv
which creates problems:
Postfix does not support "-bv" and returns in error
Exim does not support "-t" with "-bv" and returns in error
Don't mention Qmail.  I won't use it.
"whom" is far too useful as a component tool in MH to lose.
It would be nice if someone gave the new crew working on nmh a shout
about this.  The "-bv" option to sendmail is pretty damned close to
being Allman sendmail specific and thus unfriendly to other MTAs.
Further there are many cases where it would be useful to configure a
non-standard port to deliver outbound mail to via SMTP.  nmh's
current insistence on only using port 25 (or as specified in
/etc/services) is a pain.
I've worked out a hack to use TMDA with Exim while retaining nmh's
"whom" support using Exim's system filter:
0) Make sure that the following options are set in ~/.tmda/config:
DATADIR
ALLOW_MODE_640
CRYPT_KEY_FILE
FINGERPRINT
1) chgrp everything in and under ~/.tmda to group "mail".
2) Configure Exim as per the current TMDA HOW-TO.
3) Set the following options in exim.conf:
message_filter = "/etc/exim/filter"
message_filter_pipe_transport = address_pipe
4) /etc/exim/filter reads:
# Exim filter
testprint "local_part: ${local_part: $h_From:}"
testprint "domain: ${domain: $h_From:}"
if "$h_X-tmda-fingerprint:" is "" and
"${domain: $h_From:}" is "kanga.nu" and
"${if exists {/home/${local_part:$h_From:}/.tmda} {true}{false}}" is "true"
then
pipe "/usr/bin/tmda-inject -c /home/${local_part:$h_From:}/.tmda/config"
finish
endif
Yes, that assumes that all user directories are under /home and that
they use ~/.tmda/config instead of ~/.tmdarc.  Hack appropriately for
your setup.
Basic explanation:
Exim sends all outbound mail thru the system filter (if one is
configured) before attempting delivery.  The above system filter
extracts the user from the From: address and pipes the message thru
that user's TMDA setup via tmda-inject.
The system filter runs as the same user as Exim, thus the requirement
for the chgrp mail.  If your Exim installation runs as a different
user, chgrp as appropriate.
It should be fairly easy to do something similar under Postfix, but I
haven't investigated that end.
Notes:
This requires that all outbound mail that is to be processed with TMDA
has a From: header which references a local user (suffixes are fine),
and that the From: address is fully qualified with a known domain.  If
you're vhosting the above setup would be fairly trivial to extend for
other domains and $HOME paths.  I'm not vhosting on my desktop and so
don't care.  You could also qualify on envelope or other headers if
you wish.
A nice side effect of this approach for those running shared mail
servers is that ALL users who have TMDA configs instantly get TMDA
support for their outbound mail -- and in a manner that is less
complex and less prone to end-user error than the typical TMDA
configuration.
Caveat Emptor.
ObNote: I've also written a small patch against TMDA 0.58 to add a
"hold" delivery method (identical to "confirm" except it sends no
confirmation requests -- very useful for testing configs or doing
silent sidetracking of mail).
--
J C Lawrence
---------(*)                Satan, oscillate my metallic sonatas.
claw@kanga.nu               He lived as a devil, eh?
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.
_______________________________________________
Exmh-users mailing list
Exmh-users@redhat.com
https://listman.redhat.com/mailman/listinfo/exmh-users