[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: |
Tue, 18 Aug 2020 18:23:08 +0100 |
Hi Conrad,
> > > scan -format "%{to} %{cc}" -width 1000
These days, -width can take 0 to mean infinite.
Some more examples to study.
$ cat 1
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
$
$ scan -width 0 -forma '%{to} : %{cc} : %{resent-to} : %{resent-cc}' +$PWD
Foo Bar <foo@bar.example.com>, xyzzy@example.com : Xyzzy
<xyzzy2@example.com> : postmaster@example.com : abuse@example.com
$
$ scan -width 0 -forma '%(addr{to}) : %(addr{cc}) : %(addr{resent-to}) :
%(addr{resent-cc})' +$PWD
foo@bar.example.com : xyzzy2@example.com : postmaster@example.com :
abuse@example.com
$
$ scan -width 0 -forma '%{to} : %{cc} : %{resent-to} : %{resent-cc}' +$PWD |
> grep -Eo '[^ <]+@[^> ]+' |
> sort -u
abuse@example.com
foo@bar.example.com
postmaster@example.com
xyzzy2@example.com
xyzzy@example.com
$
--
Cheers, Ralph.
Re: One-liner to retrieve an email's recipients?, kat, 2020/08/18