nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Dealing with missing From: header during send.

2012-01-09 23:22:23
On Mon, Jan 9, 2012 at 9:05 PM, Ken Hornstein wrote:
I do the same thing as you, and I would like the same thing.  There are
technical issues (you don't normally have access to the identity you received
the message at when repl gets it), but we could at least make it work
better than we do now.

It seems it should be doable via mh-format expressions, but
either I do not fully understand the engine's behavior or
it has some serious bugs.

It seems I am unable to access a component more than once
in some cases.  When I do, the second time, I get nothing.

Here is something that I tried for replcomps (I've added
special lines to highlight the expressions of interest):

  %(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\
  %<(nonnull)%(void(width))%(putaddr To: )\n%>\
  %(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\
  %<(nonnull)%(void(width))%(putaddr cc: )\n%>\
  %<{fcc}Fcc: %{fcc}\n%>\
  ----------------- <CODE-OF-INTEREST> ---------------
  %(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\
  %(formataddr{to})%(formataddr{cc})%(formataddr(me))\
  %<(match example1.com)From: earl(_at_)example1(_dot_)com\n\
  %?(match example2.com)From: ehood(_at_)example2(_dot_)com\n\
  %|From: earl(_at_)earlhood(_dot_)com\n%>\
  ----------------- </CODE-OF-INTEREST> ---------------
  %<{subject}Subject: Re: %(putstr(trim{subject}))\n%>\
  %<{message-id}In-reply-to: %{message-id}\n%>\
  %<{message-id}References: %<{references}%(void{references})%(trim)%(putstr) %>
              %(void{message-id})%(trim)%(putstr)\n%>\
  --------
  On %(lmonth{date}) %(mday{date}), %(year{date}) at \
  %02(putnumf(hour{date})):%02(putnumf(min{date})), \
  %<{from}%(friendly{from})%|you%> wrote:

In the CODE-OF-INTEREST, I try to gather all the addresses
in the original message into the string register so I
can then do a match against for a given domain so I can
output a different From:.

The problem is that my match checks always fail, even though
that I know the To: of the message being replied to has
example1.com in it.

Adding the following before or after match block, I do NOT
get an XXX: header printed:

  %<(nonnull)%(putaddr XXX: )\n\%>\

If I do not do the nonnull check, repl hangs.

If I put my CODE-OF-INTEREST at the top of replcomps,
then setting of the To: in the repl draft does not work.

Maybe I do not fully get mh-format expressions, but this
behavior is odd.  I would figure that references to
message components are immutable.

As an aside, it would be nice if named registers (i.e "variables")
were supported.  Maybe it is time to come up with a replacement
for mh-format.

--ewh

P.S. I am running a local dev build based on nmh 1.3, so I
do not know if the new nmh 1.4 includes any changes to
mh-format.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>