Hi guys,
Right this one has got me stumped. I have searched the archives, the wiki and 
the general web and I can't find the right recipe to get this working 
correctly.  

I have two Exim server sites which have said they absolutely must have Out of 
Office AutoReplies - the users have said that it's so important that they are 
prepaired to ditch Exim and Squirrelmail and go for MS Exchange - just for Out 
of Office! 
Seemed total overkill to me to go to all the Expence of Exchange when all they 
want is Out of Office. "I'll fix it" I said. Well that was days ago and I have 
made progress but can't quite crack it.

1. The system must be controlled by the users which means using the Autorespond 
plugin via Squirrelmail. There are two plugin options for Squirrelmail one 
called "Local User Autoresponder and Mail Forwarder" and one called 
"Autorespond". I've installed both but only the Autorespond one works out of 
the box so that is what I am using - the other just gives a blank screen. 
Autorespond required the 'vacation' program so I've installed the BSD port for 
Linux (http://www.csamuel.org/software/vacation) from source .

When a user turns on 'Auto Replys' in Squirrelmail the Autorespond plugin puts 
a .forward file in the users home directory containing a pipe vacation command 
containing the username and any alias. Exim is supposed to then execute this 
and the vacation command then uses the contents of the vacation.msg file to 
construct an auto reply email which Exim then sends back to the sender.
The only trouble with this is that it just doesn't work all the sender gets 
back is a mail delivery failure message saying following:

A message that you sent could not be delivered to one or more of its 
recipients. This is a permanent error. The following address(es) failed:

  pipe to |/usr/bin/vacation  -a bobm
    generated by [email protected]
    local delivery failed

The following text was generated during the delivery attempt:

------ pipe to |/usr/bin/vacation  -a bobm
       generated by [email protected] ------

usage: vacation [ -I ]
or:    vacation [ -j ] [ -a alias ] [ -h hostname ] [ -tN ] [ -r ] login   



This seems to be saying that the vacation command failed. However I can't work 
out why - the syntax of the .forward file seems OK  to me ?

"|/usr/bin/vacation  -a bobm"


So I gave up with the vacation command and tried to use Exim's builtin vacation 
command emulation. So I now have this in my exim.conf file:



# ROUTERS CONFIGURATION

begin routers
...
send_to_smarthost:
...
dnslookup:
...
spam_admin:
...
system_aliases:
...
userforward:
...
procmail:
...
## This router delivers a "vacation" message if a file called 'vacation.msg'
# exists in the users home dir.

uservacation:
  driver = accept
  domains = +local_domains
check_local_user
## user = $local_part
 # User to put message in a file called vacation.msg
  require_files = $home/.vacation.msg
 ## do not reply to errors or lists
  condition =  ${if or { \
               {match {$h_precedence:} {(?i)junk|bulk|list}} \
               {eq {$sender_address} {}} \
               } {no} {yes}}
 no_expn
 # Do not reply to errors or bounces or lists
  senders = ! ^.*-request@.*:\
           ! ^bounce-.*@.*:\
           ! ^.*-bounce@.*:\
           ! ^owner-.*@.*:\
           ! ^postmaster@.*:\
           ! ^webmaster@.*:\
           ! ^listmaster@.*:\
           ! ^mailer-daemon@.*:\
           ! ^root@.*
  transport = uservacation_transport
  unseen
 user = $local_part
  no_verify

localuser:
...
#TRANSPORTS CONFIGURATION

remote_smtp:
...

remote_msa:
...
# This transport is used for vacation messages
#
uservacation_transport:
  driver = autoreply
  file = $home/.vacation.msg
  file_expand
  user = $local_part
  once = $home/.vacation.db
  ## to use a flat file instead of a db specify once_file_size
  ## once_file_size = 2K
  once_repeat = 7d
  from = [email protected]
  to = $sender_address
  subject = "Out of Office AutoReply: $h_subject"

procmail:
...
local_delivery:
...
address_pipe:
...
address_file:
...
address_reply:
...


The above seems to produce an auto reply. I have to bodge the squirrelmail 
Autorespond so that it writes to a bogus .forward file - called .forward-off 
just so Exim wont pick it up. But the problem with this setup is that if I send 
an email to the a user's alias they get a reply from the users actual username 
- the Autorespond plugin was supposed to fix this by using the -a switch to the 
vacation command. But I cant seem to be able to do this with Exim's vacation 
functionality ?

The other (realtively minor) issue is that when the auto reply comes back I get 
"From:  [email protected]; on behalf of; [email protected]" as the server is 
on a different domain from the email domain. Is there a way to fix this I 
wonder ? 

If I have to live without the alias reply functionality then I can on one site 
as they don't use aliases but the other users all use aliases as their email 
address so - not sure where I go - its all a bit of a bodge really. Once site I 
can probably get away OK with it but not the other. I guess I'd have to change 
all their user names to be the same as the alias then delete the aliases from 
/etc/aliases. But surely there must be a better way ?


Also I mention here that I'm not a programmer and my programming skills are 
limited to commenting out bits and changing variables - with a general 
understanding of what the code is doing.


Thanks for any help.

Best regards.
Mike.





-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to