[Exim] forwar and local deliver with mysql

Página Inicial
Delete this message
Reply to this message
Autor: Kai Riasol Gonzalez
Data:  
Para: exim-users
Assunto: [Exim] forwar and local deliver with mysql
hi

i´m using exim 3.35 with mysql support under debian. i have all forwards and local users in a mysql.
now i want that one local user also have a forward, how can i do this. i can´t use the forward file,
because i use this with a webmailer for autoreply.

thx

kai

my exim.conf
######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
#                       ORDER DOES NOT MATTER                        #
#     Only one appropriate transport is called for each delivery.    #
######################################################################


# This transport is used for local delivery to user mailboxes. On debian
# systems group mail is used so we can write to the /var/spool/mail
# directory. (The alternative, which most other unixes use, is to deliver
# as the user's own group, into a sticky-bitted directory)


local_delivery:
driver = appendfile
group = mail
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
return_path_add = true
no_from_hack
# file = /var/spool/mail/${local_part}
directory = /home/${local_part}/Maildir
maildir_format

address_pipe:
driver = pipe
path = /usr/bin:/bin:/usr/local/bin:/usr/local/www/cgi-bin/openwebmail/
return_output

# This transport is used for handling file addresses generated by alias
# or .forward files.

address_file:
driver = appendfile
envelope_to_add = true
return_path_add = true

address_directory:
driver = appendfile
no_from_hack
prefix = ""
suffix = ""
maildir_format

address_reply:
driver = autoreply


procmail_pipe:
driver = pipe
command = "/usr/bin/procmail"
return_path_add
delivery_date_add
envelope_to_add
# check_string = "From "
# escape_string = ">From "
suffix = ""

#spamcheck:
# driver = pipe
# # command = /usr/sbin/exim -oMr spam-scanned -bS
# transport_filter = /usr/bin/spamc -u ${local_part}
# bsmtp = all
# home_directory = "/tmp"
# current_directory = "/tmp"
# # must use a privileged user to set $received_protocol on the way back in!
# user = mail
## group = mail
# return_path_add = false
# log_output = true
# return_fail_output = true
# prefix =
# suffix =

# This transport is used for delivering messages over SMTP connections.

remote_smtp:
driver = smtp
# authenticate_hosts = smarthost.isp.com

# To use SMTP AUTH when sending to a particular host, such as your ISP's
# smarthost, uncomment and edit the above line, and also the example
# client-side authenticators at the bottom of the file



######################################################################
#                      DIRECTORS CONFIGURATION                       #
#             Specifies how local addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#   A local address is passed to each in turn until it is accepted.  #
######################################################################


# This allows local delivery to be forced, avoiding alias files and
# forwarding.

#spamcheck_director:
# # do not use this director when verifying a local-part at SMTP-time
# no_verify
# #condition = "${if and { {!def:h_X-Spam-Flag:} {!eq {$received_protocol}{spam-scanned}} {!eq
{$received_protocol}{local}} } {1}{0}}"
# driver = smartuser
# transport = spamcheck

real_local:
prefix = real
driver = localuser
transport = local_delivery

system_aliases:
driver = aliasfile
file_transport = address_file
pipe_transport = address_pipe
file = /etc/aliases
search_type = lsearch
# user = list
# Uncomment the above line if you are running smartlist

userforward:
driver = forwardfile
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
directory_transport = address_directory
no_verify
check_ancestor
no_check_local_user
file = /opt/mail/${domain}/${local_part}/.forward
modemask = 002
filter
user = mail
group = mail

# This director runs procmail for users who have a .procmailrc file

procmail:
driver = localuser
transport = procmail_pipe
require_files = ${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail
no_verify

virtual_user:
driver = aliasfile
search_type = mysql
file_transport = address_file
directory_transport = address_directory
query = "select target from alias where alias_user='${local_part}' and (alias_domain='${domain}' or
alias_domain IS NULL)"
include_domain = true

mysql_aliases:
driver = aliasfile
file_transport = address_file
directory_transport = address_directory
pipe_transport = address_pipe
search_type = mysql
query = "SELECT maildir FROM users where id = '$local_part@$domain';"
user = mail
group = mail

localuser:
driver = localuser
transport = local_delivery