[Top] [All Lists]

Re: [Nmh-workers] forms expert

2005-10-11 07:29:46

I hesitate to call myself an "expert", but here goes.

In the message dated: Wed, 05 Oct 2005 12:25:13 EDT,
The pithy ruminations from Michael Richardson on 
<[Nmh-workers] forms expert> were:
=> Is there anyone with a deep understanding of the forms stuff, i.e.
=> Mail/components and Mail/replcomps. Of the code.
=> I have been trying to get replcomps to fill in a From: if it sees
=> certain things in To: or CC:. In perl:

Ah, yes, that problem.

=>      if($to =~ /xelerance.com/ || $cc =~ /xelerance.com/) {
=>             $from = "mcr@xelerance.com";
=>         }
=> At one point, what happened was that this worked, but the field which
=> had to xelerance.com got removed. Now it just doesn't work at all.

In my case, just changing $from wasn't enough (I wanted the Fcc and .sig to 
change too). I ended up writing a front-end to repl (attached) that does what 
you want. I'd really love to see it improved--or ideally, to have the concept 
incorportated into the next+1 release.

My version of repl relies on getting environment variables to populate fields 
(From, Fcc) in the reply:

%(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\
%(void(width))%(putaddr To: )
%<(nonnull)%(void(width))%(putaddr cc: )\n%>\
%(void(getenv REPLMASQ))From: %(putstr)
Reply-To: %(putstr)
%(void(getenv REPLMASQFCC))Fcc: %(putstr)
Subject: %<{subject}Re: %{subject}%>
%<{message-id}%<{date}In-Reply-To: Your message of "%<(nodate{date})%{date}%|%(p
retty{date})%>%>." %{message-id}\nReferences: %{message-id}%<{references} %{refe

Take a look at the attached script, try the "-h" or "--wrap--D" options (yes, 
all those dashes are required), and try not to laugh too much. Suggestions & 
bug fixes are welcome.


=> I will try again with the 1.1rc4, I think I'm running older code again.
=> My goal is to put together some kind of simpler test harness that I
=> can use to excercise the code.
=> - -- 
=> ]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls 
=> ]   Michael Richardson,    Xelerance Corporation, Ottawa, ON    |net 
=> ] mcr@xelerance.com      http://www.sandelman.ottawa.on.ca/mcr/ |device 
=> ] panic("Just another Debian GNU/Linux using, kernel hacking, security 
guy"); [
=> Version: GnuPG v1.2.2 (GNU/Linux)
=> Comment: Finger me for keys
=> iQCVAwUBQ0P+ZYqHRg3pndX9AQHdswP+LjhjhjQPMBPpjgJcfZbNQLmq/FyaI+y0
=> d4JzPtDHdV4NTs1MgVoBMCYT6QDk9bF5JwDgXaozuOD//0K0PGV/1VHVpTg+ZF62
=> L9HKbbQOlucDcBFt8DaCnKnAdWxvst+5+dRvp1JIi9EXnYEupq+aXI5+IvWAGaWz
=> igcCSuM3Nkk=
=> =n/QW
=> -----END PGP SIGNATURE-----
=> _______________________________________________
=> Nmh-workers mailing list
=> Nmh-workers@nongnu.org
=> http://lists.nongnu.org/mailman/listinfo/nmh-workers

Attachment: replwrap.pl
Description: replwrap.pl

Nmh-workers mailing list
<Prev in Thread] Current Thread [Next in Thread>