Feature #60466

Enable possibility to add custom mail headers

Added by Dmitry Kislitsyn almost 3 years ago. Updated 8 months ago.

Status:NewStart date:06/01/2016
Priority:NormalDue date:
Assignee:ServerDevsGroup% Done:
0%
Category:-
Target version:-
Operation System:noarch package
Milestones:

Description

Hello,

To be able to provide possibility to integrate Scalix with 3rd-party Spam filters like MailScanner, SpamAssassin, especially RBL/DNSBL-based checks we need to have possibility to provide original source IP of the message to sendmail.

Current Scalix workflow:
1) Scalix SMTP Relay (omsmtpd) receive the mail and add the following header:

Received: from domain.com (domain.com [X.X.X.X])
    by scalix.madeit.com (Scalix SMTP Relay 12.6.0.14866)
    via ESMTP; Fri, 27 May 2016 11:21:42 -0400 (EDT)

2) omsmtpd forward mail to sendmail service using local subnet.
3) Sendmail adds received header like:
Received: from scalix.madeit.com (localhost [127.0.0.1])
    by scalix.madeit.com (8.14.4/8.14.4) with ESMTP id u4UGgXKB019250
    for <recipient@domain.com>; Mon, 30 May 2016 12:42:33 -0400

4) So, sendmail thought that message was received from 127.0.0.1 (localhost), so if we enable RBL/DNSBL checks it will not works since source IP is incorrect.

Thus we need to add original ip header by Scalix SMTP Relay. Something like:
X-SCALIX-ORIFINAL-IP: X.X.X.X

Please let me know if this is something you can quickly add in the code.

History

#1 Updated by Alexey Bobyr almost 3 years ago

I would prefer https://en.wikipedia.org/wiki/X-Originating-IP

The X-Originating-IP (not to be confused with X-Forwarded-For) email header field is a *de facto* standard for identifying the originating IP address

#3 Updated by Danny T about 1 year ago

  • Assignee changed from Danny T to ServerDevsGroup

#4 Updated by Alexey Bobyr 10 months ago

Return-Path: <abr@scalix.com>
Received: from demo.scalix.com (localhost [127.0.0.1])
    by demo.scalix.com (8.14.7/8.14.7) with ESMTP id w6U66Zd0113433
    for <abr@demo.scalix.com.br>; Mon, 30 Jul 2018 06:06:36 GMT
Received: from mail.scalix.com (mail.scalix.com [64.186.2.9])
    by demo.scalix.com (Scalix SMTP Relay 12.7.1.15022)
    via ESMTP; Mon, 30 Jul 2018 06:06:36 +0000 (UTC)
Received: from mail.scalix.com (localhost [127.0.0.1])
    by mail.scalix.com (8.14.4/8.14.4) with ESMTP id w6U66Zx5027511
    for <abr@demo.scalix.com.br>; Mon, 30 Jul 2018 02:06:36 -0400
Received: from [192.168.0.105] (mail.scalix.com [64.186.2.9])
    by mail.scalix.com (Scalix SMTP Relay 12.7.1.15022)
    via ESMTP; Mon, 30 Jul 2018 02:06:35 -0400 (EDT)
Date: Mon, 30 Jul 2018 09:06:28 +0300
From: abr <abr@scalix.com>
To: Alexey Bobyr <abr@demo.scalix.com.br>
Message-ID: <ac750ebe-f734-6e95-475b-417737ec8779@scalix.com>
Subject: demo SMTPFILTER=TRUE
x-scalix-Hops: 1
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.scalix.com w6U66Zx5027511
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scalix.com;
    s=default; t=1532930796;
    bh=ZS0w3ItF4QVULJMss4EhtdPJZtyUsGcikeSSZFQZulA=;
    h=Date:From:To:Subject:From;
    b=YAqO5M40jO100F0WlXKvniDKH2rd7JyXl67kk4VKtommOWS4OQxvriTPAW3oB75UC
     vjCwHHg+zfIq0WiOfqPKPALowTEoOp0g5vXoKyoP2UaCqUNnIhFlGn7frITpQfyrvC
     lz66GLo99ySdhK6o2uY6qt5sNTSYjOHlGmru8LAg=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.9.1
X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,
    DKIM_VALID_AU,TVD_SPACE_RATIO autolearn=ham autolearn_force=no version=3.4.0
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on demo.scalix.com
MIME-Version: 1.0
X-Scalix-DRef: 000108865294e67e
Content-Type: text/plain;
    charset="US-ASCII";
    format="flowed" 
Content-Language: en-US

Please use SMTPFILTER=TRUE in /var/opt/scalix/??/s/smtp.cfg

Please use SMTPFILTER=TRUE in /var/opt/scalix/??/s/smtp.cfg and everything should be fine.

#5 Updated by Alexey Bobyr 8 months ago

for history (brhc , postfix as front MTA)

Return-Path: <abr@scalix.com>
Received: from saopaulo.brhc.com.br (saopaulo.brhc.com.br [192.168.0.6])
    by riodejaneiro.brhc.com.br (Scalix SMTP Relay 12.7.1.15032)
    via ESMTP; Sat, 29 Sep 2018 04:32:24 -0300 (-03)
Received: from localhost (localhost [127.0.0.1])
    by saopaulo.brhc.com.br (Postfix) with ESMTP id 3A9DB64F16
    for <edgard.scalix@brhc.com.br>; Sat, 29 Sep 2018 04:32:24 -0300 (-03)
Received: from saopaulo.brhc.com.br ([127.0.0.1])
    by localhost (saopaulo.brhc.com.br [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id 2eD6Jo5FG-bw for <edgard.scalix@brhc.com.br>;
    Sat, 29 Sep 2018 04:32:22 -0300 (-03)
Received: from mail.scalix.com (mail.scalix.com [64.186.2.9])
    (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
    (No client certificate requested)
    by saopaulo.brhc.com.br (Postfix) with ESMTPS id 0489F64F13
    for <edgard.scalix@brhc.com.br>; Sat, 29 Sep 2018 04:32:21 -0300 (-03)
Received: from mail.scalix.com (localhost [127.0.0.1])
    by mail.scalix.com (8.14.4/8.14.4) with ESMTP id w8T7WJ4c011509
    for <edgard.scalix@brhc.com.br>; Sat, 29 Sep 2018 03:32:20 -0400
Received: from [192.168.0.102] (mail.scalix.com [64.186.2.9])
    by mail.scalix.com (Scalix SMTP Relay 12.7.1.15034)
    via ESMTP; Sat, 29 Sep 2018 03:32:19 -0400 (EDT)

Also available in: Atom PDF