To decide what to do with a given email, Exim has a list of Routers, which are tried in order. The first one to "accept" delivery for a given email address, does so. The Router specifies which Transport to use, and the Transport says how
to deliver and is where you might specify a command.
So to do something special, add a new Router after the "local_user" Router; this assumes that the first Routers handle remote email, then you handle local emails with what's left.
Think carefully about what should cause an email address to Verify, so that it exists when asked. Putting "no_verify" on a Router might help in some cases.
You probably want an "accept" Router (which does no address processing, it just says "take it", after all the pre-conditions are met) and have that reference a Transport which is "driver = pipe", so called because in Unix, when we handle data with a program, we often 'pipe' the data into a process running that program.
How Exim processes email (explains pre-conditions):http://www.exim.org/exim-html-current/doc/html/spec_html/ch-how_exim_receives_and_delivers_mail.html
The default configuration file explained:http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_default_configuration_file.html
So on one machine, where I'm running PGP keyserver software, my Exim configuration file has this Router (after "begin routers" and before the next "begin"):
driver = accept
local_parts = keysync : pgp-keys : pgp-public-keys
transport = sks_insert
and this Transport (after "begin transports" and before the next "begin"):
driver = pipe
command = /usr/local/bin/sks_add_mail /var/sks
user = sks
current_directory = /var/sks