[exim] Condition on router to check if the destination of a …

Top Page
Delete this message
Reply to this message
Author: Vaggelis Koutroumpas
Date:  
To: exim-users
Subject: [exim] Condition on router to check if the destination of a message is to the same server (is in local_domains)
Hello,

I've created two routers with exim filters to log all incoming and outgoing sizes of emails so with a php parser I parse the log and create stats per user and per domain for the traffic they do.

I want to set up a condition on the routers so that they will ignore any email if it originates and is destined to the same server.


How can I check that? I suppose I have to create a condition that checks the $domain or $sender_address_domain respectively if it is in local_domains, right?


Any ideas how to proceed?


These are the routers I've setup for the traffic logging.

trafficlog_in:
  user = mail
  driver = redirect
  domains = +local_domains
  data = "# Exim filter\n\
    logfile \"/var/log/exim/traffic.log\"\n\
    logwrite \"\\$tod_log INCOMING ID=\\$message_id D=\\$domain U=\\$local_part F=\\$sender_address S=\\$message_size\"
  no_verify
  allow_filter
  allow_freeze


trafficlog_out:
  user = mail
  driver = redirect
  domains = ! +local_domains
  data = "# Exim filter\n\
    logfile \"/var/log/exim/traffic.log\"\n\
    logwrite \"\\$tod_log OUTGOING ID=\\$message_id D=\\$sender_address_domain U=\\$sender_address_local_part T=\\$local_part@\\$domain S=\\$message_size\"
  no_verify
  allow_filter
  allow_freeze



Thank you in advance for your help!

--------------------------------------
Regards,
Evans Koutroumpas
Systems Administrator
--------------------------------------
DataHost
Internet Services - Web development

THESSALIAS 6 STR. ALIMOS, ΑTHENS
17456 GREECE

Τel: +30.210-9922402
Fax: +30.210-9951108 From hoki.au@??? Wed Sep 08 10:36:18 2010
Envelope-to: exim-users@???
Received: from mail-qy0-f170.google.com ([209.85.216.170]:59724)
    by tahini.csx.cam.ac.uk with esmtp (Exim 4.72)
    (envelope-from <hoki.au@???>) id 1OtH4g-0007L8-9K
    for exim-users@???; Wed, 08 Sep 2010 10:36:18 +0100
Received: by qyk35 with SMTP id 35so4738877qyk.8
    for <exim-users@???>; Wed, 08 Sep 2010 02:36:13 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.224.88.81 with SMTP id z17mr721339qal.109.1283938573220; Wed,
    08 Sep 2010 02:36:13 -0700 (PDT)
Received: by 10.224.19.193 with HTTP; Wed, 8 Sep 2010 02:36:13 -0700 (PDT)
Date: Wed, 8 Sep 2010 17:36:13 +0800
Message-ID: <AANLkTi?RSbKt6NRCnxaBF3xXKS-DKZ0k08n_J4YS41@???>
From: Ho-Ki Au <hoki.au@???>
To: exim-users@???
X-Spam-Score: 0.2 (/)
X-Spam-Status: No, score.2 required~0 testsΊYES_00Ρ.5,
    DNS_FROM_RFC_POST>708, EXIM_ACLΡ.2, HTML_30_40.374,
    HTML_MESSAGE.6,
    NORMAL_HTTP_TO_IP.175 autolearnO version^1.8
X-Mailman-Approved-At: Thu, 09 Sep 2010 08:09:18 +0100
Content-Type: text/plain; charset€F-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.9
Subject: [exim] sender verify fail
X-BeenThere: exim-users@???
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: A user list for the exim MTA <exim-users.exim.org>
List-Unsubscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subjectΎsubscribe>
List-Archive: <http://lists.exim.org/lurker/list/exim-users.html>
List-Post: <mailto:exim-users@exim.org>
List-Help: <mailto:exim-users-request@exim.org?subjectŽlp>
List-Subscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject₯bscribe>
X-List-Received-Date: Wed, 08 Sep 2010 09:36:19 -0000


I'm trying to set up exim whose hostname is managed by a local dns server.
Let's say our domain is abc.com and the exim server is running on
mail.abc.com. When I tried to send mail using alpine on another host in the
same domain, e.g. client.abc.com and specifying a sender address to be
hau@???, exim refused to send the mail and log file showed:

2010-09-08 16:46:31 HΫ192.168.1.60]) [192.168.1.60] F(au@???>
rejected RCPT <hoki.au@???>: Sender verify failed
2010-09-08 16:47:01 HΫ192.168.1.60]) [192.168.1.60] sender verify fail for
<hau@???>: Unknown user

However, if I changed the sender address to my company email address, e.g.
hau@???, that exim successfully verified the sender.
If I dig -t mx abc.com, it returned me the correct (internal) ip address in
the 192.168.1.0/24 subnet. Could someone tell me what exim was doing when
it verified the sender address? And how can I get it to send mail from
hau@???? I do not want to disable require verify sender

Thanks.

--
-hoki