Hi
The logs show that Postfix does not pass the from key because the From header comes from the message body, and Postfix by default only supports sender information from the Envelope From (sender). Right?

I'm trying to write something "like DMARC" in Python to reject if the From and return-path for the selected domain are different
only that much and as much as that......
I cannot find other user-friendly solutions

In debug:
sender: r...@domaintest.ltd, from: None
.....
sender: r...@domaintest.ltd, from: None, inputs: {'request': 'smtpd_access_policy', 'protocol_state': 'RCPT', 'protocol_name': 'ESMTP', 'client_address': '94.xxx.xxx.xxx', 'client_name': 'mail134.xxx.xxx.pl', 'client_port': '42647', 'reverse_client_name': 'mail134.xxx.xxxx.pl', 'server_address': 'xxx.xxx.xxx.195', 'server_port': '25', 'helo_name': 'mail134.xxx.xxx.pl', 'sender': 'r...@domaintest.ltd', 'recipient': 'm...@otherdomain.ltd', 'recipient_count': '0', 'queue_id': '', 'instance': '177634.6749d771.94976.0', 'size': '1699', 'etrn_domain': '', 'stress': '', 'sasl_method': '', 'sasl_username': '', 'sasl_sender': '', 'ccert_subject': '', 'ccert_issuer': '', 'ccert_fingerprint': '', 'ccert_pubkey_fingerprint': '', 'encryption_protocol': 'TLSv1.3', 'encryption_cipher': 'AECDH-AES256-SHA', 'encryption_keysize': '256', 'policy_context': ''}

Is any idea ?

Hi
I have some problem with comunications postfix + python

in main.cf:
...
smtpd_restriction_classes=testowy
testowy=check_policy_service { unix:private/testowy, timeout=4s, default_action=DUNNO }

smtpd_recipient_restrictions =
        check_recipient_access inline:{{testdomain.ltd=testowy}},
#beacuse i i try run for only one domain "testdomain.ltd"

in master.cf:
testowy unix - n n - - spawn user=nobody argv=/usr/local/sbin/from_check.py

example script who doing nothing /usr/local/sbin/from_check.py:

#!/usr/bin/python3.9
import sys

def main():
    while True:
        input_line = sys.stdin.readline().strip()
        if not input_line:
            print()
            sys.stdout.flush()
            continue
        print("DUNNO")  # REJECT, PERMIT, DUNNO
        sys.stdout.flush()

if __name__ == "__main__":
    main()

in log I get:
Nov 28 13:54:15 mx postfix/smtpd[2953675]: warning: missing attribute action in input from private/testowy Nov 28 13:54:16 mx postfix/spawn[2953684]: warning: command /usr/local/sbin/from_check.py exit status 120 Nov 28 13:54:16 mx postfix/smtpd[2953675]: warning: missing attribute action in input from private/testowy Nov 28 13:54:16 mx postfix/smtpd[2953675]: warning: problem talking to server private/testowy: Success

I think the current script doesn't work because it doesn't read data from Postfix or respond in the expected format.
Does anyone have an example of what it should look like?

--

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

--

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

--

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to