[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Earl Hood
Subject: Re: [Nmh-workers] Dealing with missing From: header during send.
Date: Mon, 9 Jan 2012 23:22:14 -0600

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%>\
  %<(nonnull)%(void(width))%(putaddr cc: )\n%>\
  %<{fcc}Fcc: %{fcc}\n%>\
  ----------------- <CODE-OF-INTEREST> ---------------
  %(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\
  %<(match example1.com)From: address@hidden
  %?(match example2.com)From: address@hidden
  %|From: address@hidden>\
  ----------------- </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) %>
  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.


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]