Big picture:
I have set up a dedicated mail server using exim & Cyrus.
Users do not login to the box - except via pop/imap or IMP (a
webmail application).
Users want to be able to forward mail to colleagues when not in
the office. I provide a web page (hacked into IMP) where they can
enter a list of forwarding addresses. The file always exists, but
when they 'switch' forwarding on it is linked to a name that exim
tests for as part of mail delivery.
This works well, another part allows vacation replies to be returned
to senders. The exim configuration to do this is:
vacationforward:
driver = redirect
require_files = /var/vacation/$local_part/forward.active
file = /var/vacation/$local_part/forward.active
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
What is now wanted is the ability to decide if mail is still delivered
to the user or if the user never gets to see it. Some want one, some the
other. A simple radio button & action in the web front end & I can do any
setup needed.
My question is how to configure exim. What I need is to have an 'unseen' to
continue & deliver to the user's mailbox. The easy/obvious way is to have
another very similar rule that checks a slightly different file name
and includes the verb 'unseen'. I don't like that for aesthetic reasons
(excessive code, clutter) and wondered if there was a neater way.
So what I want to do is to include 'unseen' on some condition - ideally checking
a file status. I did look at filters, since they allow a nice if/then/endif
but they don't allow checks on files.
I don't want to pass it on to another program because I would then loose
the nice sanity checks that exim does - consider where someone forwards it
to the department mail list - of which they are a member.
Any ideas ?
My ideal would be to check a file permission rather than create a different file.
So as a suggestion for future syntax, it would be nice if I could append to the
above. It would not affect the running of the router, just an option:
if file_executable /var/vacation/$local_part/forward.active
then unseen
endif
--
Alain Williams
#include <std_disclaimer.h>