Re: [exim] Auto reply

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Pool, Joel
Ημερομηνία:  
Προς: pierrot_92230, Exim-users
Αντικείμενο: Re: [exim] Auto reply
This is the way i did it using a filter this is my first go and probably
could be cleaned up a bit.

Create a addresslist:

addresslist auto_reply_support = /etc/exim/auto-reply/auto-reply-support

Set the filter file and filter transport Parameters:

system_filter = /etc/exim/filter-exim
system_filter_reply_transport = support_auto_reply

I created a seperate ACL becasue i had to reply to many different email
addresses with different mail messages.

acl_autoreply:

  warn   recipients     = +auto_reply_support
         message        = X-auto-reply-support: YES
         add_header     = X-auto-reply-support: YES


accept

Here is the ACL bits in the Recipeint ACL:

accept hosts          = !+relay_from_hosts
         acl            = acl_autoreply


the Transport:

support_auto_reply:
driver = autoreply
user = exim

and finally the cotents of /etc/exim/filter-exim i filter by the header
a attached via the ACL. Notice that i attach the message as well at this
time. and remove the header i added to the message as cleanup.

if $h_X-auto-reply-support: is "YES" then
mail
to $reply_address
from support@???
expand file /etc/exim/auto-reply/auto-reply-support.msg.txt
log /var/log/exim/auto-reply-support.log
subject "Auto-Reply from Mydomain Customer Support"
headers remove "X-auto-reply-support:"
endif

Hope this works for you


-----Original Message-----
From: exim-users-bounces@??? [mailto:exim-users-bounces@exim.org]
On Behalf Of pierre master
Sent: Tuesday, September 14, 2010 9:26
To: Exim-users@???
Subject: [exim] Auto reply

Hi,

I have search for a solution to automatically send a respond mail when a
a
special mailbox received a mail but i alwayws arrive on the vacation
solution.

Actually i have an exim 4.71-40.el5 on a CentOS Linux SMTPIN2
2.6.18-194.3.1.el5PAE #1 SMP Thu May 13 13:48:44 EDT 2010 i686 i686 i386
GNU/Linux

My exim conf :

# Macros definition
DELAY_INPUT = 10s

....

ACL

....

######################################################################
#                      ROUTERS CONFIGURATION                         #
######################################################################
begin routers



manual_domain:
  driver = manualroute
  local_part_suffix = +*
  local_part_suffix_optional
  condition = ${if !eq\
                {${lookup{$domain}wildlsearch{TRANSPORT_MAP}}}{}\
                {true}{false}\
               }
  route_data = ${lookup{$domain}wildlsearch{TRANSPORT_MAP}}
  transport = remote_smtp
  no_more


system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
file_transport = address_file
pipe_transport = address_pipe



######################################################################
#                     TRANSPORTS CONFIGURATION                       #
######################################################################
begin transports


devnull:
driver = pipe
command = "/bin/cat"

remote_smtp:
  driver           = smtp
  headers_remove   = Received
  rcpt_include_affixes
  delivery_date_add
  envelope_to_add
  hosts_avoid_tls = *


address_pipe:
driver = pipe
return_output

address_file:
driver = appendfile
maildir_format
delivery_date_add
envelope_to_add
return_path_add

address_reply:
driver = autoreply


######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################
begin retry


*                      *           F,15m,1m; G,1h,15m,1.5; F,3d,1h



######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################
begin rewrite



######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################
begin authenticators




Exim actually forwards all mails to an exchange server.

I would like when a user test@??? received a mail, an
automatic
respond send him :

Sorry the user to trie to join is no longer available. Thanks .....



My idea is to create a router like :



user_leave:
  driver = accept
  domains = +local_domains
  # user to put away message in a file called vacation.msg
  require_files = /root/user_leave.msg
  # do not reply to errors or lists or with ADV in the subject
  condition =  ${if or { \
                {match {$receiver_address} {test@???} \
                } {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 = user_leave_transport
  unseen
  no_verify


######################################################################
#                      TRANSPORTS CONFIGURATION                      #
#...


user_leave_transport:
   driver = autoreply
   file =/root/user_leave.msg
   file_expand
   from = $local_part@???
   to = $sender_address
   subject = "Re: $h_subject"
   # text that will be included in message above
   text = "This is an automatic reply.  Please feel free to send
additional\n\
           mail, as only this one notice will be generated.\n\
           ================================================\n\n"



But of course it is not working.
I don t know if i need to create a local user to do this ,
if $receiver_address exit or if it is recipients, if i can place a
message
in /root/user_leave.msg or in /home/exim or /home

Thanks for you help.

Pierre, a french user
--
## List details at http://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/




** Statement from CaridianBCT Inc. **

Confidential and/or privileged information may be contained in this message and any attachments. If you are not the intended recipient you should not copy or forward this message and should destroy it immediately. Any Disclosure, copying, distribution and/or any other use of this communication by anyone other than the intended recipient is strictly prohibited and may be unlawful. The opinions, conclusions and other information in this message do not necessarily represent the views and/or opinions of the employer.

** End of statement **