Personalized "user has left company" notice message
You can use the "autoreply" driver to send automated reply messages. It is normally used for vacation messages, but it is of course capable of sending back any kind of mail.
Roughly, what you need is a router, which (depending on some condition) redirects the message to the transport using the autoreply driver. The router is something like this:
vacation_reply:
driver=accept
domains = +local_domains
senders = ! ^.*-request@.*:\
! ^bounce-.*@.*:\
! ^.*-bounce@.*:\
! ^owner-.*@.*:\
! ^postmaster@.*:\
! ^webmaster@.*:\
! ^listmaster@.*:\
! ^mailer-daemon@.*:\
! ^root@.*:\
! ^noreply@.*
condition=${lookup mysql {\
select email from vacation where \
email='${quote_mysql$local_part}@${quote_mysql:$domain}'\
and active='y'\
}}
no_expn
transport=vacation_transport
unseen
no_verify
The router above is a snippet about vacation, again, but you should have no problem rewriting this. Also, it uses mysql as a backend, so your config will be slightly different if you use files for example, but you get the idea...
Having the router, you need a transport (in this example, it is called "vacation_transport"), which is something like this:
vacation_transport:
driver=autoreply
from= ${lookup mysql {\
select concat('"',name,'" <',username,'>') \
from mailbox where username='${local_part}@${domain}' AND active=1 \
}}
to= ${lookup mysql {\
select '${quote_mysql:$sender_address}' \
from vacation where email='${local_part}@${domain}' and active='y' \
}}
subject= ${lookup mysql {\
select subject from vacation \
where email='${local_part}@${domain}' and active='y' \
}}
text= ${lookup mysql {\
select body from vacation \
where email='${local_part}@${domain}' and active='y' \
}}
Again, it is using a mysql backend (it is a copy-paste from the same config file, ofcoz). The point is to set the "from", "to", "subject" and "text" variables. The autoreply transport will use these to compose the reply mail. If you need to notify the sender about the user's absence, you can remove the lookups, and for the most part you can include a static text. Again, this example is about vacation mails, where the user can customize his/her message.
See this page about the autoreply driver: http://wiki.exim.org/EximAutoReply
Also, the exim documentation is useful as well.