~sircmpwn/aerc

2 2

Running a script on email load

Tomasz Tunguz
Details
Message ID
<CAIQHAYWO7L4.KJ88ZNTAKEOD@Toms-MacBook-Pro.local>
DKIM signature
pass
Download raw message
Is there a way to run a script as an email is loaded? I'd like to scrape the email address and add to khard to build up my address book?

Thanks!
Tomasz Tunguz
Details
Message ID
<CAIT6VJNP660.1FHUWJLQGO8VY@Toms-MacBook-Pro.local>
In-Reply-To
<CAIQHAYWO7L4.KJ88ZNTAKEOD@Toms-MacBook-Pro.local> (view parent)
DKIM signature
pass
Download raw message
I read the documentation and added this line to aerc.conf

 new-email=exec khard.sh %a %n

 but it doesn't trigger the script which creates the khard. manually, it works executing with exec or term. thanks for the help!

On Thu Apr 8, 2021 at 4:33 PM PDT, Tomasz Tunguz wrote:
> Is there a way to run a script as an email is loaded? I'd like to scrape
> the email address and add to khard to build up my address book?
>
> Thanks!
Details
Message ID
<20210412162036.wp7btafzbirlbhsw@feather.localdomain>
In-Reply-To
<CAIT6VJNP660.1FHUWJLQGO8VY@Toms-MacBook-Pro.local> (view parent)
DKIM signature
pass
Download raw message
On Thu, Apr 08, 2021 at 06:41:00PM -0700, Tomasz Tunguz wrote:
> I read the documentation and added this line to aerc.conf
>  new-email=exec khard.sh %a %n
>  but it doesn't trigger the script which creates the khard. manually, it works executing with exec or term. thanks for the help!

> Is there a way to run a script as an email is loaded? I'd like to scrape
> the email address and add to khard to build up my address book?

You're going to have a bad time using the new email trigger for that.
That thing is really only meant to fire off a notification, nothing more.
It only triggers for the active mailbox and only in very specific circumstances
(meaning actually having the recent imap flag).

Better might be to use a specific tool that does the indexing directly from within
IMAP if you use that.
If you anyhow in the email into a maildir then it's much easier, just do the
indexing after you've fetched the email with the sync tool.

Cheers,
Reto
Reply to thread Export thread (mbox)