Duplicate inline.sig on Incoming mail.

Report bugs and workarounds
Post Reply
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Duplicate inline.sig on Incoming mail.

Post by henk »

MailScanner v1.2.3-dev running on EFA-3.0.2.3

I wanted to remove the Message Header, inserted by fetchmail, from the EFA box itself, since it always localhost.

To clear things a bit, I must explain we use a 2 stage method to process mail.
The efa box is using fetchmail to fetch all inbound -external-mail from different sources and maps it to the proper user on the EFA box.
For the mailserver, to be able to get mail from the EFA server, I use dovecot on the EFA box.
The Mailserver is also using fetchmail to get mail from the EFA box.

Of course I can change the Sign Clean Messages to No, but I like the signature ;)
It's no big issue, but I'd like to know what's the problem. I think it has to do with the localhost, but I miss the braincells to figure it out :oops:

Not sure if I should use Postfix to Ignore the Header in /etc/postfix/header_checks

Code: Select all

/^Received: from 127.0.0.1/	IGNORE
/^Received:/ HOLD
Somehow this didn't work, ( I did reload postfix)

Decided to take a different approach:

So I needed to change 2 things.

1. Run fetchmail with the --invisible option --the Received header is suppressed and fetchmail tries to spoof the MTA it forwards to into thinking it came directly from the mailserver host.
Crontab entry
# Name: fetchmail

Code: Select all

*/5 * * * * fetchmail --nokeep --invisible -v -a >> /var/log/fetchmail/fetchmail.log 2>&1
2. We need to define witch header to use in /etc/MailScanner/MailScanner.conf

Code: Select all

Spam Actions    store custom(spam)
High Scoring Spam Actions    store
Non Spam Actions    store deliver header "X-Spam-Status:No" custom(nonspam)
SpamAssassin Rule Actions   
Sign Clean Messages = Yes
And set the correct Header

Code: Select all

Read IP Address From Received Header = 2
Depending on language (in my case en) I expect the message below
cat /etc/MailScanner/reports/en/inline.sig.in.txt"

Code: Select all

--
This message has been scanned for viruses and dangerous content by
E.F.A. Project, and is believed to be clean.

Click here to report this message as spam.
http://$hostname/cgi-bin/learn-msg.cgi?id=$id&token=$token
The result is what I call 'unexpected' : The signature is added 2 times and the second part of the inline.sig.in.txt is missing.

Code: Select all

-- 
This message has been scanned for viruses and dangerous content by
E.F.A. Project, and is believed to be clean.
-- 
This message has been scanned for viruses and dangerous content by
E.F.A. Project, and is believed to be clean.

The messagedetails are correct with: Read IP Address From Received Header = 2
Received on:
26/07/17 16:10:23
Received by: efa-server
Received from:
123.108.200.26 [Add to Whitelist | Add to Blacklist]
Received Via:
IP Address Hostname Country RBL Spam Virus All
127.0.0.1 (Localhost) (Localhost) [ ] [ ] [ ] [ ]
123.108.200.26 vol-edge-rtrb.volbroadband.com India [ ] [ ] [ ] [ ]
ID: 1476E120216.AA540
Message Headers: Received: from mail.mydomain.nl (localhost.localdomain [127.0.0.1])
by efa-server (Postfix) with ESMTP id 1476E120216
for <demo1@localhost>; Wed, 26 Jul 2017 16:10:02 +0200 (CEST)
DomainKey-Status: good
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
plesk.xxxxxx.biz
X-Spam-Level: ****
X-Spam-Status: No, score=4.6 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,DOS_OE_TO_MX,HTML_MESSAGE,MIMEOLE_DIRECT_TO_MX,RDNS_NONE
autolearn=no autolearn_force=no version=3.4.0
X-Original-To: demo1@mydomain.nl
Delivered-To: demo1@mydomain.nl
Received: from vol-edge-rtrb.volbroadband.com (unknown [123.108.200.26])
by plesk.xxxxxx.biz (Postfix) with ESMTP id 85D2A1740A2E
for <demo1@mydomain.nl>; Wed, 26 Jul 2017 16:06:03 +0200 (CEST)

When Read IP Address From Received Header = 1 there is no duplicate signature but the Received from is wrong??
Received on:
27/07/17 20:20:16
Received by: efa-server
Received from:
127.0.0.1 [Add to Whitelist | Add to Blacklist]
Received Via:
IP Address Hostname Country RBL Spam Virus All
127.0.0.1 (Localhost) (Localhost) [ ] [ ] [ ] [ ]
209.85.216.176 mail-qt0-f176.google.com United States [ ] [ ] [ ] [ ]
ID: 7B0991202CB.A03C6
Message Headers: Received: from mail.mydomain.nl (localhost.localdomain [127.0.0.1])
by efa-server (Postfix) with ESMTP id 7B0991202CB
for <demo1@localhost>; Thu, 27 Jul 2017 20:20:03 +0200 (CEST)
DomainKey-Status: no signature
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
plesk.xxxx.biz
X-Spam-Level:
X-Spam-Status: No, score=-0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,
DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE autolearn=ham autolearn_force=no
version=3.4.0
X-Original-To: demo1@mydomain.nl
Delivered-To: demo1@mydomain.nl
Received: from mail-qt0-f176.google.com (mail-qt0-f176.google.com [209.85.216.176])
by plesk.xxxx.biz (Postfix) with ESMTPS id 208F117403D1
for <demo1@mydomain.nl>; Thu, 27 Jul 2017 20:17:59 +0200 (CEST)
Received-SPF: pass (plesk.xxxx.biz: domain of gmail.com designates 209.85.216.176 as permitted sender) client-ip=209.85.216.176; envelope-from=test@gmail.com; helo=mail-qt0-f176.google.com;
Received: by mail-qt0-f176.google.com with SMTP id p3so65515390qtg.2
for <demo1@mydomain.nl>; Thu, 27 Jul 2017 11:17:59 -0700 (PDT)
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: Duplicate inline.sig on Incoming mail.

Post by henk »

Solved the issue, by reading the comments # EFA Note: CustomAction.pm will Sign Clean Messages instead using the custom(nonspam) action. in MailScanner.conf :oops:

Code: Select all

Sign Clean Messages = No
did the trick.

Code: Select all

Read IP Address From Received Header = 2 
ensures I have the correct IP in Received from Header: :dance:
Everything back to normal now :whistle:
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
Post Reply