Re: [Mimedefang] Help with header checking

2020-12-01 Thread Dianne Skoll via MIMEDefang
On Tue, 1 Dec 2020 13:10:43 -0500 Joseph Brennan wrote: > We used this to create an array of header information: > if (open(IN, '<', './HEADERS')) { > while() { > chomp; > if (/^(\S+):\s*(.*)/) { > my $label = $1; > my $data = $2;

Re: [Mimedefang] Help with header checking

2020-12-01 Thread Joseph Brennan
We used this to create an array of header information: if (open(IN, '<', './HEADERS')) { while() { chomp; if (/^(\S+):\s*(.*)/) { my $label = $1; my $data = $2; $label = lc($label); $Header{$label} =

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Dianne Skoll via MIMEDefang
On Thu, 26 Nov 2020 12:47:56 -0500 "Bill Cole" wrote: [snip] > That Received header is added by Sendmail *AFTER* all milters have > done their end-of-data work. It is not present when MD sees the > message. So as per Bill Cole's analysis, it seems there were indeed no Received: headers on the

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Andrea Venturoli
On 11/26/20 6:47 PM, Bill Cole wrote: That Received header is added by Cyrus during delivery, so obviously it's not present when MD sees the message. Of course... That Received header is added by Sendmail *AFTER* all milters have done their end-of-data work. It is not present when MD

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Bill Cole
On 26 Nov 2020, at 11:55, Andrea Venturoli wrote: [...] Anyway... you need to capture the message (or at least the headers) so we can analyze what's going on. Here's a sample: Return-Path: Received: from soth.netfence.it ([unix socket]) by mailserver.netfence.it (Cyrus 3.0.14) with

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Giovanni Bechis
On 11/25/20 11:45 AM, Andrea Venturoli wrote: [...] > Are Mail::Header and Mail::Field still current? Or are they obsolete? If so, > what should be used as a replacement? > > For these messages, I see in the logs: >> mimedefang.pl[23042]: 0AP2jef2000844: head = %Mail::Header=HASH(0x1fe80ae0) >>

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Andrea Venturoli
On 11/26/20 3:47 PM, Dianne Skoll via MIMEDefang wrote: You shouldn't really print "head = %$head" because you don't know the implementation details of Mail::Header. Treat it as an opaque object. So how do I know why/how it failed? I suggest calling action_quarantine_entire_message() if

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Giovanni Bechis
On 11/26/20 11:10 AM, Andrea Venturoli wrote: > On 11/26/20 8:46 AM, Giovanni Bechis wrote: >> both Mail::Headers and Mail::Field are still current, are you able to provide >> a sample "./HEADERS" file ? >> Just add this snippet after the open(2) call: >> open(LOGH, '>', "/tmp/headers.log") or die

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Dianne Skoll via MIMEDefang
On Wed, 25 Nov 2020 11:45:11 +0100 Andrea Venturoli wrote: > > if (open(HF, "<./HEADERS")) { > > my $head = Mail::Header->new([]); > > close HF; > > md_syslog('warning',"head = %$head"); You shouldn't really print "head = %$head" because you don't

Re: [Mimedefang] Help with header checking

2020-11-26 Thread Andrea Venturoli
On 11/26/20 8:46 AM, Giovanni Bechis wrote: both Mail::Headers and Mail::Field are still current, are you able to provide a sample "./HEADERS" file ? Just add this snippet after the open(2) call: open(LOGH, '>', "/tmp/headers.log") or die $!; print LOGH ; close LOGH; Wouldn't this overwrite

Re: [Mimedefang] Help with header checking

2020-11-25 Thread Giovanni Bechis
On Wed, Nov 25, 2020 at 11:45:11AM +0100, Andrea Venturoli wrote: > Hello. > > I'm a long time MIMEDefang user, but my PERL knowledge is about zero. > > A long time ago I found some sample code (from a site which does not > even exist anymore) and managed to adapt it to my situation. > > Here

[Mimedefang] Help with header checking

2020-11-25 Thread Andrea Venturoli
Hello. I'm a long time MIMEDefang user, but my PERL knowledge is about zero. A long time ago I found some sample code (from a site which does not even exist anymore) and managed to adapt it to my situation. Here it is: if (open(HF, "<./HEADERS")) { my $head =