nmh-workers
[Top][All Lists]
Advanced

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

Re: One-liner to retrieve an email's recipients?


From: Ralph Corderoy
Subject: Re: One-liner to retrieve an email's recipients?
Date: Wed, 19 Aug 2020 09:25:10 +0100

Hi Conrad,

> I cottoned on to using
>
>   %(formataddr {to})%(formataddr {cc})%(putstr)
>
> as a merge trick, but there's no way of applying %(addr) to a list,
> right?  So your nice grep regexp there looks like it'd be one of the
> best ways of extracting the pure addresses after all..?

Ken's explained that side of things.  I did have another idea.

    $ cat 2
    from: me@here.example.com
    to: Foo Bar <foo@bar.example.com>, xyzzy@example.com
    cc: Xyzzy <xyzzy2@example.com>
    resent-to: postmaster@example.com
    resent-cc: abuse@example.com
    $
    $ whom 2
    whom: illegal header line -- resent-to:
    whom: illegal header line -- resent-cc:
    whom: re-format message and try again
    $
    $ sed -i 's/^resent-//' 2
    $ whom 2
      -- Network Recipients --
      foo at bar.example.com
      xyzzy at example.com
      xyzzy2 at example.com
      postmaster at example.com
      abuse at example.com
    $

-- 
Cheers, Ralph.



reply via email to

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