[pfx] Re: header_checks not work with regexp

2023-04-17 Thread Matus UHLAR - fantomas via Postfix-users
On 17.04.23 08:54, SysAdmin EM via Postfix-users wrote: Hello everyone the problem persists. Maybe I’m doing something wrong. Step 1, I add the rule in the /etc/postfix/header_checks file /^Subject:.*You may need to add/ DISCARD TMP_BLOCK Step 2, postmap /etc/postfix/header_checks and postfix

[pfx] Re: header_checks not work with regexp

2023-04-17 Thread SysAdmin EM via Postfix-users
Hello everyone the problem persists. Maybe I’m doing something wrong. Step 1, I add the rule in the /etc/postfix/header_checks file /^Subject:.*You may need to add/ DISCARD TMP_BLOCK Step 2, postmap /etc/postfix/header_checks and postfix surcharge. Are these steps correct? Could the problem oc

[pfx] Re: header_checks not work with regexp

2023-04-15 Thread Matus UHLAR - fantomas via Postfix-users
On Fri, Apr 14, 2023 at 05:51:21PM -0300, SysAdmin EM via Postfix-users wrote: postmap -q "Subject: [KIS] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '10.54.130.188:8020'. You may need to add u'10.54.130.188' to ALLOWED_HOSTS." regexp:/etc/postfix/header_checks On 14.04.23 18:15, Viktor Du

[pfx] Re: header_checks not work with regexp

2023-04-14 Thread Viktor Dukhovni via Postfix-users
On Fri, Apr 14, 2023 at 05:51:21PM -0300, SysAdmin EM via Postfix-users wrote: > postmap -q "Subject: [KIS] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: > '10.54.130.188:8020'. You may need to add u'10.54.130.188' to ALLOWED_HOSTS." > regexp:/etc/postfix/header_checks Works here (bash syntax)

[pfx] Re: header_checks not work with regexp

2023-04-14 Thread SysAdmin EM via Postfix-users
The rule not work postmap -q "Subject: [KIS] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: ' 10.54.130.188:8020'. You may need to add u'10.54.130.188' to ALLOWED_HOSTS." regexp:/etc/postfix/header_checks WARN /^Subject:.*You may need to add.*/ DISCARD BLOCK_TEMPORAL any ideas?? On Fri, Apr 14

[pfx] Re: header_checks not work with regexp

2023-04-14 Thread Viktor Dukhovni via Postfix-users
On Fri, Apr 14, 2023 at 03:31:17PM -0300, SysAdmin EM via Postfix-users wrote: > Sorry for such a basic question but I couldn’t find a solution on my > part. I’m trying to block a Subject using header_checks but it’s not > working. > > This is my rule: > > /^Subject:.*Invalid HTTP_HOST header.*

Re: header_checks and regexes

2022-05-01 Thread Viktor Dukhovni
On Sun, May 01, 2022 at 03:54:16PM -0400, Alex wrote: > > Conditional header checks require a milter or content filter that > > can make such fine distinctions. Postfix built-in header checks > > are global. > > I need to find a way to have different policies for different domains > on the same

Re: header_checks and regexes

2022-05-01 Thread Alex
Hi, On Thu, Mar 10, 2022 at 5:23 PM Viktor Dukhovni wrote: > > > On 10 Mar 2022, at 3:48 pm, Alex wrote: > > > > Can I use sender_checks to bypass a host like mail.coupahost.com? The > > client IP will constantly change, but I can rely on the sending domain > > to remain the same. > > Conditiona

Re: header_checks and regexes

2022-03-10 Thread Viktor Dukhovni
> On 10 Mar 2022, at 3:48 pm, Alex wrote: > > Can I use sender_checks to bypass a host like mail.coupahost.com? The > client IP will constantly change, but I can rely on the sending domain > to remain the same. Conditional header checks require a milter or content filter that can make such fine

Re: header_checks and regexes

2022-03-10 Thread Alex
Hi, I now have these mime_header_checks working properly, but it turns out there are companies sending legitimate invoices as HTML attachments, ugh. Mar 8 07:49:05 xavier postfix-118/cleanup[2084042]: C01C310024593: reject: header Content-Disposition: attachment;? filename=purchase_order.html fr

Re: header_checks and regexes

2022-03-04 Thread Alex
Hi, > > I believe there's a dot missing in the first one, as in '.(386' but > > it's more than that, because I experimented with that too. > > No, it would have to be: \.(386|...) > otherwise '.' just matches any character. Your RE pattern is sloppy > in places, ... correct REs take some care.

Re: header_checks and regexes

2022-03-03 Thread Viktor Dukhovni
> On 3 Mar 2022, at 10:06 pm, Alex wrote: > > I believe there's a dot missing in the first one, as in '.(386' but > it's more than that, because I experimented with that too. No, it would have to be: \.(386|...) otherwise '.' just matches any character. Your RE pattern is sloppy in places,

Re: header_checks and regexes

2022-03-03 Thread Alex
Hi, > > It's still not working, and I suspect the reason is that I somehow > > screwed up when I pasted it. Can I ask you to take a look at the > > attached? > > I don't see any rules below that would do that. There's a rule > for "mhtml" files, and a rule for ".pdf.html" files, but I fail > to s

Re: header_checks and regexes

2022-03-03 Thread Viktor Dukhovni
On Thu, Mar 03, 2022 at 06:04:43PM -0500, Alex wrote: > > > Content-Type: text/html; charset="US-ASCII"; name="download.html" > > > Content-Disposition: attachment; filename="download.html" It seems you're trying to block "mumble.html" attachments. > It's still not working, and I suspect the rea

Re: header_checks and regexes

2022-03-03 Thread Alex
Hi Viktor, > > Content-Type: text/html; charset="US-ASCII"; name="download.html" > > Content-Disposition: attachment; filename="download.html" > > > > And this is the regex I currently have. Hopefully it wraps properly. > > > /^Content-(Disposition|Type):\s+.+?(?:file)?name="?.+?\(386|exe|ad[ept]|

Re: header_checks and regexes

2022-03-02 Thread Viktor Dukhovni
On Wed, Mar 02, 2022 at 08:57:51PM -0500, Alex wrote: > Content-Type: text/html; charset="US-ASCII"; name="download.html" > Content-Disposition: attachment; filename="download.html" > > And this is the regex I currently have. Hopefully it wraps properly. > /^Content-(Disposition|Type):\s+.+?(?:f

Re: Header_checks inconsistent with postmap query

2022-02-10 Thread Viktor Dukhovni
On Thu, Feb 10, 2022 at 10:27:32PM +, Eric Wilkison wrote: > header_checks: > /^X-Forefront-Antispam-Report:.*SFV:(SPM|SKS|SKB).*to=<.*@ms2019.mobility-lab.com>/ > WARN  It's working You're expecting recipient information to be present in the header text. > Feb 10 15:48:21 relay1 postfix/cl

Re: header_checks - transport problem

2021-11-16 Thread postfix-users
Yes, smtp-sec and smtp-safe is the same (copy paste mistake...) Thanks for the explanation. postfix-us...@mattern.org: and a test header check: /^Subject: test1test/?? FILTER smtp-sec: ... Nov 16 13:38:19 mailtest1 postfix/cleanup[1147934]: 5C0D85B05: filter: header Subject: test1test fro

Re: header_checks - transport problem

2021-11-16 Thread Wietse Venema
postfix-us...@mattern.org: > and a test header check: > /^Subject: test1test/?? FILTER smtp-sec: ... > Nov 16 13:38:19 mailtest1 postfix/cleanup[1147934]: 5C0D85B05: > filter: header Subject: test1test from unknown[192.0.2.1]; > from= to= proto=ESMTP > helo=: smtp-safe: If smtp-sec (smtp-safe

Re: header_checks redirect multiple users

2021-05-10 Thread Wietse Venema
Matteo Cazzador: > Hi i'm using header_checks redirect to filter incoming mail sender and > REDIRECT. > > Is ti possible to redirect to multiple mail address? REDIRECT user@domain Write a message redirection request to the queue file, and inspect the next

Re: header_checks: specific rule per-recipient

2021-01-21 Thread Phil Stracchino
On 1/21/21 10:39 PM, Fourhundred Thecat wrote: > Hello, > > I am using regex header_checks for smtpd. This rule works fine: > > /^Subject: Your parcel .*/ DISCARD > > But when I try to do a recipient-specific rule > > if /^To: / > /^Subject: Your parcel .*/ DISCARD > endif > > it does not work

Re: header_checks question

2020-04-27 Thread Wietse Venema
Juan Manuel P: > Hello Witse do you mean to use HOLD action on header_checks ? > > like this ? > > /^Subject:.*hacked*/ HOLD By the way that "*" at the end is useless. > And that whats suppose to do ? > > It is holded the email on the queue ? and I can check with mailq command ? > and later d

Re: header_checks question

2020-04-27 Thread Matus UHLAR - fantomas
On 27.04.20 13:27, Juan Manuel P wrote: Hello Witse do you mean to use HOLD action on header_checks ? like this ? /^Subject:.*hacked*/ HOLD And that whats suppose to do ? if Wietse's message wasn't enough for you, I recommend looking at http://www.postfix.org/header_checks.5.html It is hol

Re: header_checks question

2020-04-27 Thread Juan Manuel P
Hello Witse do you mean to use HOLD action on header_checks ? like this ? /^Subject:.*hacked*/ HOLD And that whats suppose to do ? It is holded the email on the queue ? and I can check with mailq command ? and later detele from queue and email me a alert Sorry for ask and not try, because we

Re: header_checks question

2020-04-27 Thread Wietse Venema
jmpatagonia: > Hello I need help to using header_checks, I create a rule > > /^Subject:.*hacked*/ DISCARD An alternative is to use HOLD action, assuming you aren't using software that hijacks the HOLD feature for other purposes, such as mailscanner. Then you can review the email with "postcat -q

Re: header_checks apply to headers of attached messages?

2019-05-22 Thread Wietse Venema
Viktor Dukhovni: > > On May 22, 2019, at 1:50 PM, MRob wrote: > > > > Thank you for pointing it out. Why is default for the setting same as > > header_checks? I don't understand the common need for smtp server to run > > the same header checks on attachment headers, can someone explain? > > Th

Re: header_checks apply to headers of attached messages?

2019-05-22 Thread Viktor Dukhovni
> On May 22, 2019, at 1:50 PM, MRob wrote: > > Thank you for pointing it out. Why is default for the setting same as > header_checks? I don't understand the common need for smtp server to run the > same header checks on attachment headers, can someone explain? This is backwards-compatibility.

Re: header_checks apply to headers of attached messages?

2019-05-22 Thread MRob
On 2019-05-22 08:35, Dominic Raferd wrote: On Wed, 22 May 2019 at 09:11, MRob wrote: If I send a message as attachment, header_checks are applied to the headers of the attachment also. Why does it happen? Can I turn it off? Try: nested_header_checks = Thank you for pointing it out. Why is

Re: header_checks apply to headers of attached messages?

2019-05-22 Thread Dominic Raferd
On Wed, 22 May 2019 at 09:11, MRob wrote: > If I send a message as attachment, header_checks are applied to the > headers of the attachment also. Why does it happen? Can I turn it off? > Try: nested_header_checks =

Re: header_checks: From header not being changed in mail between local users

2019-05-12 Thread Wietse Venema
Joaquin F: > This is more a curiosity than a real need, but I was wondering why I can't > modify the "From" header when sending mails between local users. man 5 header_checks Many people overlook the main limitations of header and body_checks rules. ... Message headers added by

Re: header_checks help, please

2018-10-07 Thread Janos Dohanics
On Sun, 7 Oct 2018 16:19:32 -0500 Noel Jones wrote: > On 10/7/2018 3:57 PM, Dominic Raferd wrote: > > On Sun, 7 Oct 2018 at 21:37, Janos Dohanics > > wrote: > > > > I have been trying to edit the Subject: line using > > header_checks, without success: > > > >

Re: header_checks help, please

2018-10-07 Thread Noel Jones
On 10/7/2018 3:57 PM, Dominic Raferd wrote: > On Sun, 7 Oct 2018 at 21:37, Janos Dohanics > wrote: > > I have been trying to edit the Subject: line using header_checks, > without success: > > header_checks.pcre: > > if /^From: (.*)<(.+)mydomain\.com\>

Re: header_checks help, please

2018-10-07 Thread Dominic Raferd
On Sun, 7 Oct 2018 at 21:37, Janos Dohanics wrote: > I have been trying to edit the Subject: line using header_checks, > without success: > > header_checks.pcre: > > if /^From: (.*)<(.+)mydomain\.com\>$/i > /^Subject: (.*)$/i > REPLACE Subject: some_string $1 > endif > > main.cf: > > header_c

Re: header_checks UTF8 discard

2018-03-23 Thread Viktor Dukhovni
> On Mar 23, 2018, at 12:12 PM, Emanuel wrote: > El 23/03/18 a las 11:24, Viktor Dukhovni escribió: >>> On Mar 23, 2018, at 8:29 AM, Emanuel >>> wrote: >>> >>> Hello, >>> >>> i create this rule to block phishing intent >>> >>> /^Subject: =?UTF-8?B?U3UgY3VlbnRhIHNlIGVuY3VlbnRyYSBlbiByZXZpc2n

Re: header_checks UTF8 discard

2018-03-23 Thread Emanuel
with quotes? i change the rule with \ and [] but not work. El 23/03/18 a las 11:24, Viktor Dukhovni escribió: On Mar 23, 2018, at 8:29 AM, Emanuel wrote: Hello, i create this rule to block phishing intent /^Subject: =?UTF-8?B?U3UgY3VlbnRhIHNlIGVuY3VlbnRyYSBlbiByZXZpc2nDs24u?=/

Re: header_checks UTF8 discard

2018-03-23 Thread Viktor Dukhovni
> On Mar 23, 2018, at 8:29 AM, Emanuel wrote: > > Hello, > > i create this rule to block phishing intent > > /^Subject: =?UTF-8?B?U3UgY3VlbnRhIHNlIGVuY3VlbnRyYSBlbiByZXZpc2nDs24u?=/ > DISCARD > > but not work > > any ideas? The "?" character is a meta-character in regular e

Re: header_checks for IP & email destination?

2017-12-22 Thread Markus Clardy
If it is supposed to be Source IP and destination address, do you really need to do anything with the headers? What I mean is, if you know the IP, make a restriction that if a mail is being received from a specific IP, then push it onto another restriction class, which then checks the recipient, a

Re: header_checks for IP & email destination?

2017-12-21 Thread Viktor Dukhovni
> On Dec 21, 2017, at 7:54 PM, li...@mypenguin.net.au wrote: > > I've a very unique need to configure Postfix to deliver email based on > source IP and destination email address. > > Example: > --- > If: >Received: by mx0.example2.com AND Delivered-To: > li.

Re: header_checks, filtering and loops

2017-10-16 Thread Mickael DEQUIDT
Le 16/10/2017 à 19:07, Noel Jones a écrit : To use as an advanced content filter, your prog must be able to talk SMTP. A simple way to do this might be to use a command line SMTP agent such as "mini_sendmail" rather than the sendmail command. Other - and more robust - solutions would to use a

Re: header_checks, filtering and loops

2017-10-16 Thread Noel Jones
On 10/16/2017 10:15 AM, Mickael DEQUIDT wrote: > Hi everyone, > > in trying to tinker a little with my postfix, I stumbled on an issue > regarding filtering with header_checks. > > I am trying to filter a few emails according to their From: header > (and not their  envelope-from). So, basically,

Re: Header_Checks non-exsiting field check

2017-09-15 Thread Wietse Venema
Robby Van Mieghem: > Can there be more lines after the if .. endif Yes. Please RTFM: http://www.postfix.org/header_checks.5.html Wietse > meaning I have 3 other checks to do ( not conditional ) , just a check if a > field contains spec word 1, word2 or 3, depending on that FILTER smtp : > >

Re: Header_Checks non-exsiting field check

2017-09-14 Thread Robby Van Mieghem
Can there be more lines after the if .. endif meaning I have 3 other checks to do ( not conditional ) , just a check if a field contains spec word 1, word2 or 3, depending on that FILTER smtp : so if /^X-MS-Exchange-CrossTenant-id:/ !/^X-MS-Exchange-CrossTenant-id: / REJECT TenantID-InCorrec

Re: Header_Checks non-exsiting field check

2017-09-14 Thread Noel Jones
On 9/14/2017 7:18 AM, Robby Van Mieghem wrote: > OK tx > > Small other questions. Seems not to works also : assuming tenantid = > > > I have one line in header checks > > !/^X-MS-Exchange-CrossTenant-id: / REJECT Tenant-ID In-Correct > > So I want a reject whenever the X--Cross

Re: Header_Checks non-exsiting field check

2017-09-14 Thread Robby Van Mieghem
OK tx Small other questions. Seems not to works also : assuming tenantid = I have one line in header checks !/^X-MS-Exchange-CrossTenant-id: / REJECT Tenant-ID In-Correct So I want a reject whenever the X--CrossTenantID is not ... He seems to ignire th '!' How can I say c

Re: Header_Checks non-exsiting field check

2017-09-13 Thread Noel Jones
On 9/13/2017 9:02 AM, Robby Van Mieghem wrote: > Hi > > is there a way with header_checks to check if a field does not exist ? > > We want to reject mails that do not include the field > X-MS-Exchange-CrossTenant-id No, header_checks cannot check for a missing header. It examines each header in

Re: header_checks and custom header fails to trigger

2017-06-06 Thread Bill Cole
On 6 Jun 2017, at 3:20, rolelael wrote: I understand , but .. /^route_gcgw: BE/ WARN Test is triggered now. And is there any way with header_checks I can accomplish my if .. end if somehow . No. The utility of the 'if...endif' construct in header_checks is that it lets you optimize

Re: header_checks and custom header fails to trigger

2017-06-06 Thread Phil Stracchino
On 06/06/17 03:20, rolelael wrote: > I understand , but .. > > /^route_gcgw: BE/ WARN Test > > is triggered now. Because that's a single-line test. Your other test is failing because if the /route_gcgw/ condition is triggered, you try to compare *the line that triggered it* against a con

Re: header_checks and custom header fails to trigger

2017-06-06 Thread rolelael
I understand , but .. /^route_gcgw: BE/ WARN Test is triggered now. And is there any way with header_checks I can accomplish my if .. end if somehow . Or is it really limited and not suitable for what I'm looking to do ? -- View this message in context: http://postfix.1071664.n5.nab

Re: header_checks and custom header fails to trigger

2017-06-06 Thread Dominic Raferd
On 6 June 2017 at 07:49, rolelael wrote: > Hello > > It's me again and the header_checks is driving me crazy > > Mail comming from other mail system comes into postfix were header_checks > is > enabled > > The mail system adds a header : > > route_gcgw: BE > > This header is visible when the mail

Re: Header_Checks & empty Return-Path expression

2017-05-31 Thread Viktor Dukhovni
> On May 31, 2017, at 3:46 AM, rolelael wrote: > > This one not , but the 'string' is in the header From.. > > Example of Header From : > > header From: ROBBY VAN MIEGHEM The above is the complete actual header content. > from mail-amsdgsdgshdghsdghsd.outbound.protection.outlook.com[x.x.x

Re: Header_Checks & empty Return-Path expression

2017-05-31 Thread rolelael
OK but I was playing around now with the regexpr. and still an issue /^From:.*robby.vanmieg...@domain.be.*/ WARN TESTJE This one works /^From:.*from=<>*/ WARN from empty header This one not , but the 'string' is in the header From.. Example of Header From : header From: ROBBY VAN MIEGHEM fr

Re: Header_Checks & empty Return-Path expression

2017-05-30 Thread Larry Kuenning
On 5/30/2017 9:29 AM, Viktor Dukhovni wrote: On May 30, 2017, at 9:23 AM, Peter West wrote: If the return-path is <> ( empty ) then do the following ; if domain is robbya.be or robbyb.be route via mailrobby.test.com ; if domain is robbyc.be then route via mailrobby2.test.com if /^Return-Pat

Re: Header_Checks & empty Return-Path expression

2017-05-30 Thread rolelael
Victor ; what should I accomplish with check_sender_access ? Seems this one is used to block senders ? We do not want to block emails, but reroute all the mails on postfix towards relayhosts ( specified by the sending domain ). In this case thinking in terms of out of office mails comming from O365

Re: Header_Checks & empty Return-Path expression

2017-05-30 Thread Viktor Dukhovni
> On May 30, 2017, at 9:23 AM, Peter West wrote: > >> If the return-path is <> ( empty ) then do the following ; >> >> if domain is robbya.be or robbyb.be route via mailrobby.test.com ; if domain >> is robbyc.be then route via mailrobby2.test.com >> >> if /^Return-Path... This is misconceived

Re: Header_Checks & empty Return-Path expression

2017-05-30 Thread rolelael
Yes I tested that. The problems seems to lie in the header Return-Path not being found in the headers of the mail. I tried with the header From: and look for the string from=<> but I cannot accomplish this. Really stuck -- View this message in context: http://postfix.1071664.n5.nabble.com/

Re: Header_Checks & empty Return-Path expression

2017-05-30 Thread Peter West
> On 30 May 2017, at 3:47 pm, rolelael wrote: > > Hello > > I'm trying to accomplish the following : > > If the return-path is <> ( empty ) then do the following ; > > if domain is robbya.be or robbyb.be route via mailrobby.test.com ; if domain > is robbyc.be then route via mailrobby2.test.co

Re: header_checks: WARN and INFO

2017-03-24 Thread Leonardo Rodrigues
Em 23/03/17 18:03, Noel Jones escreveu: Yes, they are identical other than the obvious "warning" or "info" label in the logs. Some log analyzers were confused by the "warning:" label on non-errors, so the INFO action was invented. H ... the 'warning' causing troubles makes a LOT of se

Re: header_checks: WARN and INFO

2017-03-23 Thread Noel Jones
On 3/23/2017 3:42 PM, Leonardo Rodrigues wrote: > > Hi, > > Watching for the header_checks documentation > (http://www.postfix.org/header_checks.5.html), it seems to me the > WARN and INFO descriptions and usage are completly the same. I > always used WARN, but some documentations i was r

Re: header_checks bypassing discard rules

2016-06-29 Thread Zalezny Niezalezny
Hi, @Wietse, than You for Your feedback. Now its working with transport map. domain.com relay:[smtp1.domain.local] domain.com relay:[smtp.domain.local] * error: Only one is allowed With "error:" parameter Postfix filtering is working like a charm. :)

Re: header_checks bypassing discard rules

2016-06-29 Thread Wietse Venema
Zalezny Niezalezny: > Hi Noel, > > I just tested Your solution, but its not working with multiple RCPT TO: > > When I`m sending an E-mail using telnet command, an email with single RCPT > TO: zalezny.niezale...@gmail.com is working fine. its blocked. > But when I will put second RCPT TO: u...@dom

Re: header_checks bypassing discard rules

2016-06-29 Thread Benny Pedersen
On 2016-06-29 10:59, Zalezny Niezalezny wrote: But when I will put second RCPT TO: u...@domain.com, then both E-mails are send, even that restricted by transport table. header_checks is not pr recipient so it does not work if you like to make pr recipient use check_policy_service but check_p

Re: header_checks bypassing discard rules

2016-06-29 Thread Zalezny Niezalezny
Hi Noel, I just tested Your solution, but its not working with multiple RCPT TO: When I`m sending an E-mail using telnet command, an email with single RCPT TO: zalezny.niezale...@gmail.com is working fine. its blocked. But when I will put second RCPT TO: u...@domain.com, then both E-mails are se

Re: header_checks bypassing discard rules

2016-06-27 Thread Zalezny
Wow, thanks for that perfect tip. On June 27, 2016 5:15:52 PM GMT+02:00, Noel Jones wrote: >On 6/27/2016 3:39 AM, Zalezny Niezalezny wrote: >> Hi, >> >> using header_checks configuration we are dropping all outgoing >> E-mails except some of them. >> >> >> # discard all mails not going to

Re: header_checks bypassing discard rules

2016-06-27 Thread Noel Jones
On 6/27/2016 3:39 AM, Zalezny Niezalezny wrote: > Hi, > > using header_checks configuration we are dropping all outgoing > E-mails except some of them. > > > # discard all mails not going to cortalconsors.(de|fr) > if /^to:/ > !/^to:?$/ DISCARD discarded > endif > > Following rules dropping

Re: header_checks with other table types

2015-11-08 Thread Peter
On 11/08/2015 07:18 PM, Viktor Dukhovni wrote: > No need, just use "postmap -q". Good idea, I didn't think of that. > You can also ask postmap to > read multi-line message headers from a message file. > > See the postmap(1) manpage for details of the "-h", "-m" (and "-b") > options. Thanks, I d

Re: header_checks with other table types

2015-11-07 Thread Viktor Dukhovni
On Sun, Nov 08, 2015 at 07:07:25PM +1300, Peter wrote: > On 11/08/2015 06:20 PM, Viktor Dukhovni wrote: > > Just be aware that headers potentially contain embedded new-lines, > > and can be up to 100k bytes (header_size_limit) long. Test your > > SQL engine to make sure it supports queries with s

Re: header_checks with other table types

2015-11-07 Thread Peter
On 11/08/2015 06:20 PM, Viktor Dukhovni wrote: > Just be aware that headers potentially contain embedded new-lines, > and can be up to 100k bytes (header_size_limit) long. Test your > SQL engine to make sure it supports queries with string literals > that long. Thanks for the heads up, the mysql

Re: header_checks with other table types

2015-11-07 Thread Viktor Dukhovni
On Sun, Nov 08, 2015 at 02:56:16PM +1300, Peter wrote: > According to header_checks(5), header_checks is assumed to be used with > pcre or regexp table types, but I'd like to know if it would work with > other tables types. My use case is an SQL table that does substring > matching based on the t

Re: header_checks

2015-10-29 Thread Marco
Il 29. 10. 15 18:09, Wietse Venema ha scritto: > Wietse: >> smtp_header_checks has a replace option. > Marco: >> The issue I have is that smtp_header_checks is unable to distinguish >> between mail sent to intranet destinations (the VMsrunning the services) >> and the Internet. > Yes, it can: > >

Re: header_checks

2015-10-29 Thread Wietse Venema
Wietse: > smtp_header_checks has a replace option. Marco: > The issue I have is that smtp_header_checks is unable to distinguish > between mail sent to intranet destinations (the VMsrunning the services) > and the Internet. Yes, it can: /etc/postfix/transport: example.com intranet: .examp

Re: header_checks

2015-10-29 Thread Marco
Il 29. 10. 15 17:33, Wietse Venema ha scritto: > Marco: >> A Milter could be also an option in the future, with the target of >> "sanitizing" the mails by replacing the original header with a new one, >> ensuring no internal information leakage (i.e. including the >> bi-directional mapping of the

Re: header_checks

2015-10-29 Thread Wietse Venema
Marco: > A Milter could be also an option in the future, with the target of > "sanitizing" the mails by replacing the original header with a new one, > ensuring no internal information leakage (i.e. including the > bi-directional mapping of the internal message ID created by the smtp_header_checks

Re: header_checks

2015-10-29 Thread Marco
Il 29. 10. 15 14:38, Wietse Venema ha scritto: > Marco: >> Hello all. >> >> I'm using postfix since at least 20 years and I could always find a >> satisfactory solution to my problems. >> >> However I have an now an issue with the filtering of the mail headers, >> as I want to use the headers_chec

Re: header_checks

2015-10-29 Thread Noel Jones
On 10/29/2015 7:44 AM, Marco wrote: > Hello all. > > I'm using postfix since at least 20 years and I could always find a > satisfactory solution to my problems. > > However I have an now an issue with the filtering of the mail headers, > as I want to use the headers_check functionality only for e

Re: header_checks

2015-10-29 Thread Wietse Venema
Marco: > Hello all. > > I'm using postfix since at least 20 years and I could always find a > satisfactory solution to my problems. > > However I have an now an issue with the filtering of the mail headers, > as I want to use the headers_check functionality only for e-mails sent > to external/Int

Re: header_checks not working

2015-03-12 Thread Noel Jones
On 3/12/2015 7:31 AM, Krinninger, Reinhold wrote: > Hello, > > > > i'm trying to stop some spammails with a header_check. The > header_check looks for the hostname of our smtp-server in the > "From:"-Line in the headers of incoming mail. I want to reject all > Mails with this or similar "From:"

Re: header_checks not working

2015-03-12 Thread nicolas
El 2015-03-12 12:31, Krinninger, Reinhold escribió: Hello, i use this header_check: I assume that you're actually using header_checks (ended in **s**) and that your table type is regex: in order this to work. /etc/postfix/header_checks: /^From: (?!.*\/ REJECT seems to be spam, isn't i

Re: header_checks BCC multiple rules hit

2015-02-17 Thread li...@rhsoft.net
Am 17.02.2015 um 19:29 schrieb Viktor Dukhovni: On Tue, Feb 17, 2015 at 07:14:51PM +0100, li...@rhsoft.net wrote: Am 17.02.2015 um 19:05 schrieb Viktor Dukhovni: On Tue, Feb 17, 2015 at 07:02:27PM +0100, li...@rhsoft.net wrote: (*) The exceptions are REJECT and DISCARD which terminate furthe

Re: header_checks BCC multiple rules hit

2015-02-17 Thread Viktor Dukhovni
On Tue, Feb 17, 2015 at 07:14:51PM +0100, li...@rhsoft.net wrote: > Am 17.02.2015 um 19:05 schrieb Viktor Dukhovni: > >On Tue, Feb 17, 2015 at 07:02:27PM +0100, li...@rhsoft.net wrote: > > > >>>(*) The exceptions are REJECT and DISCARD which terminate further > >>>table lookups because the decisio

Re: header_checks BCC multiple rules hit

2015-02-17 Thread li...@rhsoft.net
Am 17.02.2015 um 19:14 schrieb Wietse Venema: li...@rhsoft.net: Am 17.02.2015 um 18:46 schrieb Wietse Venema: li...@rhsoft.net: is it intentional that if a message hits more than one Regex that it creates also more than once BCC like below? it's little bit surprising Of course. If more tha

Re: header_checks BCC multiple rules hit

2015-02-17 Thread li...@rhsoft.net
Am 17.02.2015 um 19:05 schrieb Viktor Dukhovni: On Tue, Feb 17, 2015 at 07:02:27PM +0100, li...@rhsoft.net wrote: (*) The exceptions are REJECT and DISCARD which terminate further table lookups because the decision is obviously final. and DUNNO NO! That's not a final decision, processing

Re: header_checks BCC multiple rules hit

2015-02-17 Thread Wietse Venema
li...@rhsoft.net: > Am 17.02.2015 um 18:46 schrieb Wietse Venema: > > li...@rhsoft.net: > >> is it intentional that if a message hits more than one Regex that it > >> creates also more than once BCC like below? it's little bit surprising > > > > Of course. If more than one header line matches the t

Re: header_checks BCC multiple rules hit

2015-02-17 Thread Viktor Dukhovni
On Tue, Feb 17, 2015 at 07:02:27PM +0100, li...@rhsoft.net wrote: > >(*) The exceptions are REJECT and DISCARD which terminate further > >table lookups because the decision is obviously final. > > and DUNNO NO! That's not a final decision, processing of more headers continues. > >That is absol

Re: header_checks BCC multiple rules hit

2015-02-17 Thread Viktor Dukhovni
On Tue, Feb 17, 2015 at 06:52:59PM +0100, li...@rhsoft.net wrote: > >>Is it intentional that if a message hits more than one Regex that it creates > >>also more than once BCC like below? it's little bit surprising because in > >>all known cases the first rule hit's and the evaluation of the file i

Re: header_checks BCC multiple rules hit

2015-02-17 Thread li...@rhsoft.net
Am 17.02.2015 um 18:46 schrieb Wietse Venema: li...@rhsoft.net: is it intentional that if a message hits more than one Regex that it creates also more than once BCC like below? it's little bit surprising Of course. If more than one header line matches the table, then more than one action wil

Re: header_checks BCC multiple rules hit

2015-02-17 Thread li...@rhsoft.net
Am 17.02.2015 um 17:55 schrieb Viktor Dukhovni: On Tue, Feb 17, 2015 at 05:51:07PM +0100, li...@rhsoft.net wrote: Is it intentional that if a message hits more than one Regex that it creates also more than once BCC like below? it's little bit surprising because in all known cases the first rule

Re: header_checks BCC multiple rules hit

2015-02-17 Thread Wietse Venema
li...@rhsoft.net: > is it intentional that if a message hits more than one Regex that it > creates also more than once BCC like below? it's little bit surprising Of course. If more than one header line matches the table, then more than one action will execute(*). Why is that surprising? (*) Th

Re: header_checks BCC multiple rules hit

2015-02-17 Thread Viktor Dukhovni
On Tue, Feb 17, 2015 at 05:51:07PM +0100, li...@rhsoft.net wrote: > Is it intentional that if a message hits more than one Regex that it creates > also more than once BCC like below? it's little bit surprising because in > all known cases the first rule hit's and the evaluation of the file is > st

Re: header_checks: own prepend headers also removed

2015-01-01 Thread Wietse Venema
li...@rhsoft.net: > http://permalink.gmane.org/gmane.mail.postfix.user/193458 > > is it intentional that "header_checks" intended to remove pre-existing > X-Envelope-From and X-Envelope-To also removes the own by access maps > prepended (looks also to be the case for policyd-headers like Receive

Re: header_checks from a script

2014-12-15 Thread li...@rhsoft.net
Am 16.12.2014 um 01:09 schrieb Viktor Dukhovni: On Tue, Dec 16, 2014 at 01:04:29AM +0100, li...@rhsoft.net wrote: The "-h" option is I think what you're looking for sounds promising - thank you for the hint! You'll need to modify the code to process the "IGNORE" action, rather than print it

Re: header_checks from a script

2014-12-15 Thread Viktor Dukhovni
On Tue, Dec 16, 2014 at 01:04:29AM +0100, li...@rhsoft.net wrote: > >>>The "-h" option is I think what you're looking for > >> > >>sounds promising - thank you for the hint! > > > >You'll need to modify the code to process the "IGNORE" action, > >rather than print it, and to print unmatched header

Re: header_checks from a script

2014-12-15 Thread li...@rhsoft.net
Am 16.12.2014 um 00:34 schrieb Viktor Dukhovni: On Tue, Dec 16, 2014 at 12:28:26AM +0100, li...@rhsoft.net wrote: Am 15.12.2014 um 22:59 schrieb Viktor Dukhovni: On Mon, Dec 15, 2014 at 12:39:56PM +0100, li...@rhsoft.net wrote: is there some way to invoke regexp:/etc/postfix/header_checks_

Re: header_checks from a script

2014-12-15 Thread Viktor Dukhovni
On Tue, Dec 16, 2014 at 12:28:26AM +0100, li...@rhsoft.net wrote: > > Am 15.12.2014 um 22:59 schrieb Viktor Dukhovni: > >On Mon, Dec 15, 2014 at 12:39:56PM +0100, li...@rhsoft.net wrote: > > > >>is there some way to invoke regexp:/etc/postfix/header_checks_smtpd.cf to > >>local stored messages for

Re: header_checks from a script

2014-12-15 Thread li...@rhsoft.net
Am 15.12.2014 um 22:59 schrieb Viktor Dukhovni: On Mon, Dec 15, 2014 at 12:39:56PM +0100, li...@rhsoft.net wrote: is there some way to invoke regexp:/etc/postfix/header_checks_smtpd.cf to local stored messages for strip out unwanted headers? Have you considered postmap(1) http://www

Re: header_checks from a script

2014-12-15 Thread Viktor Dukhovni
On Mon, Dec 15, 2014 at 12:39:56PM +0100, li...@rhsoft.net wrote: > is there some way to invoke regexp:/etc/postfix/header_checks_smtpd.cf to > local stored messages for strip out unwanted headers? Have you considered postmap(1) http://www.postfix.org/postmap.1.html The "-h" option is I

Re: header_checks is checked before sender_access

2014-10-02 Thread Wietse Venema
Alberto Lepe: > There is a customer that is sending mails from excel using a banned client > in the server "header_checks" restrictions (client can not be changed due > to technical restrictions). > I allowed the customer in sender_access, however postfix is still blocking > it. > How can I set "se

Re: header_checks is checked before sender_access

2014-10-02 Thread li...@rhsoft.net
Am 02.10.2014 um 13:16 schrieb Charles Marcus: > On 10/2/2014 4:37 AM, Alberto Lepe wrote: >> On Thu, Oct 2, 2014 at 5:27 PM, Alberto Lepe > > wrote: >> >> There is a customer that is sending mails from excel using a banned >> client in the server "header_checks" >>

Re: header_checks is checked before sender_access

2014-10-02 Thread Charles Marcus
On 10/2/2014 4:37 AM, Alberto Lepe wrote: > On Thu, Oct 2, 2014 at 5:27 PM, Alberto Lepe > wrote: > > There is a customer that is sending mails from excel using a > banned client in the server "header_checks" restrictions (client > can not be changed due to tech

Re: header_checks is checked before sender_access

2014-10-02 Thread Alberto Lepe
On Thu, Oct 2, 2014 at 5:27 PM, Alberto Lepe wrote: > There is a customer that is sending mails from excel using a banned client > in the server "header_checks" restrictions (client can not be changed due > to technical restrictions). > I allowed the customer in sender_access, however postfix is

Re: header_checks and REPLACE

2014-08-11 Thread li...@rhsoft.net
Am 11.08.2014 um 14:12 schrieb Tom Hendrikx: > You're too experienced (and large-mouthed :>) to not know that security > cannot be obtained through obscurity. Header munging is almost always > the wrong solution that don't change the fact that security auditors are happy if you don't leak inter

  1   2   3   >