[exim] error when testing .mailfilter

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Michael Worobcuk
Datum:  
To: exim users
Betreff: [exim] error when testing .mailfilter
Hi,
I got fast and good advice here in me first posting, thanks for that.
I am trying now to set up a mailfilter with maildrop.

I have two questions:

1.
[hanno: /home/hanno]>sudo cat .mailfilter
#Exim filter
echo "hallo"

[hanno: /home/hanno]>sudo exim -bf .mailfilter < Maildir/.Michael/cur/ 
1172559191.M952493P1292V00000063I003E8897_0.HannosServer,S=1529:2,S
Return-path taken from "Return-path:" header line
Return-path = mail@???
Sender      = root@???
Recipient   = root@???
Testing Exim filter file ".mailfilter"


Filter error: unknown filtering command "echo" near line 2 of filter
file

what am I doing wrong ?

2.
Here is what I tried for my exim router and transport, I am not shure
if it is working, since I still have problems telling the mailfilter
to say "hallo" (...),
could anyone give me some advice or a sample how doing it better ?
THANK YOU VERY MUCH

:


######################################################################
#                      ROUTERS CONFIGURATION                         #
#               Specifies how addresses are handled                  #
######################################################################
#     THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT!       #
# An address is passed to each router in turn until it is accepted.  #
######################################################################


begin routers


dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 10.0.0.0/24
no_more

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



userforward:
driver = redirect
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
file = $home/.forward
# allow_filter
no_verify
no_expn
check_ancestor
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply
condition = ${if exists{$home/.forward} {yes} {no} }

# SpamAssassin
spamcheck_router:
no_verify
check_local_user
# When to scan a message :
# - it isn't already flagged as spam
# - it isn't already scanned
condition = "${if and { {!def:h_X-Spam-Flag:} {!eq
{$received_protocol}{spam-scanned}}} {1}{0}}"
driver = accept
transport = spamcheck



#maildrop:
#driver = accept
#check_local_user
#require_files = ${home}/.maildroprc
#transport = maildrop_pipe

localuser:
driver = accept
check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
transport = local_delivery
cannot_route_message = Unknown user

# added by Daniel
maildrop:
debug_print = "R: maildrop for $local_part@$domain"
driver = accept
domains = +local_domains
check_local_user
transport = maildrop_pipe
require_files = ${local_part}:${home}/.mailfilter:+/usr/bin/maildrop
no_verify
no_expn


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


# SpamAssassin
spamcheck:
     driver = pipe
     command = /usr/local/sbin/exim -oMr spam-scanned -bS
     use_bsmtp = true
     transport_filter = /usr/local/bin/spamc
     home_directory = "/tmp"
     current_directory = "/tmp"
     # must use a privileged user to set $received_protocol on the  
way back in!
     user = mailnull
     group = mail
     log_output = true
     return_fail_output = true
     return_path_add = false
     message_prefix =
     message_suffix =


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

remote_smtp:
driver = smtp


# This transport is used for local delivery to user mailboxes in
traditional
# BSD mailbox format. By default it will be run under the uid and gid
of the
# local user, and requires the sticky bit to be set on the /var/mail
directory.
# Some systems use the alternative approach of running mail
deliveries under a
# particular group instead of using the sticky bit. The commented
options below
# show how this can be done.

# maildir delivery
local_delivery:
driver = appendfile
user = $local_part
group = mail
mode = 0660
mode_fail_narrower = false
delivery_date_add
envelope_to_add = true
return_path_add = true
directory = /home/${local_part}/Maildir
maildir_format



#maildrop
#maildrop_pipe:
#driver = pipe
#delivery_date_add = true
#envelope_to_add = true
#return_path_add = true
#command = /usr/local/bin/maildrop -m
#user = ${local_part}
#group = mail

# added by Daniel
maildrop_pipe:
debug_print = "T: maildrop_pipe for $local_part@$domain"
driver = pipe
path = "/bin:/usr/bin:/usr/local/bin"
command = "/usr/local/bin/maildrop"
return_path_add
delivery_date_add
envelope_to_add


address_pipe:
driver = pipe
return_output


address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add



address_reply:
driver = autoreply



--
Regards
Michael