mirror of
https://github.com/chillout2k/ExOTA-Milter.git
synced 2025-12-14 02:30:17 +00:00
Compare commits
2 Commits
52b1e122bb
...
a587c066dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a587c066dc | ||
| b8d5626041 |
@ -123,7 +123,7 @@ class ExOTAMilter(Milter.Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Parse RFC-5322-From header
|
# Parse RFC-5322-From header
|
||||||
if(name == "From"):
|
if(name.lower() == "From".lower()):
|
||||||
hdr_5322_from = email.utils.parseaddr(hval)
|
hdr_5322_from = email.utils.parseaddr(hval)
|
||||||
self.hdr_from = hdr_5322_from[1].lower()
|
self.hdr_from = hdr_5322_from[1].lower()
|
||||||
m = re.match(g_re_domain, self.hdr_from)
|
m = re.match(g_re_domain, self.hdr_from)
|
||||||
@ -140,7 +140,7 @@ class ExOTAMilter(Milter.Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Parse non-standardized X-MS-Exchange-CrossTenant-Id header
|
# Parse non-standardized X-MS-Exchange-CrossTenant-Id header
|
||||||
elif(name == "X-MS-Exchange-CrossTenant-Id"):
|
elif(name.lower() == "X-MS-Exchange-CrossTenant-Id".lower()):
|
||||||
self.hdr_tenant_id_count += 1
|
self.hdr_tenant_id_count += 1
|
||||||
self.hdr_tenant_id = hval.lower()
|
self.hdr_tenant_id = hval.lower()
|
||||||
logging.debug(self.mconn_id + "/" + str(self.getsymval('i')) +
|
logging.debug(self.mconn_id + "/" + str(self.getsymval('i')) +
|
||||||
@ -148,7 +148,7 @@ class ExOTAMilter(Milter.Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Parse RFC-7601 Authentication-Results header
|
# Parse RFC-7601 Authentication-Results header
|
||||||
elif(name == "Authentication-Results"):
|
elif(name.lower() == "Authentication-Results".lower()):
|
||||||
if g_milter_dkim_enabled == True:
|
if g_milter_dkim_enabled == True:
|
||||||
ar = None
|
ar = None
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -27,10 +27,10 @@ if mt.getreply(conn) ~= SMFIR_CONTINUE then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- HEADER
|
-- HEADER
|
||||||
if mt.header(conn, "From", '"Blah Blubb" <O365ConnectorValidation@yad.onmicrosoft.com>') ~= nil then
|
if mt.header(conn, "fRoM", '"Blah Blubb" <O365ConnectorValidation@yad.onmicrosoft.com>') ~= nil then
|
||||||
error "mt.header(From) failed"
|
error "mt.header(From) failed"
|
||||||
end
|
end
|
||||||
if mt.header(conn, "X-MS-Exchange-CrossTenant-Id", "1234abcd-18c5-45e8-88de-123456789abc") ~= nil then
|
if mt.header(conn, "x-mS-EXCHANGE-crosstenant-id", "1234abcd-18c5-45e8-88de-123456789abc") ~= nil then
|
||||||
error "mt.header(Subject) failed"
|
error "mt.header(Subject) failed"
|
||||||
end
|
end
|
||||||
--if mt.header(conn, "X-MS-Exchange-CrossTenant-Id", "4321abcd-18c5-45e8-88de-blahblubb") ~= nil then
|
--if mt.header(conn, "X-MS-Exchange-CrossTenant-Id", "4321abcd-18c5-45e8-88de-blahblubb") ~= nil then
|
||||||
@ -45,7 +45,7 @@ end
|
|||||||
if mt.header(conn, "Authentication-Results", "my-auth-serv-id;\n exota=pass") ~= nil then
|
if mt.header(conn, "Authentication-Results", "my-auth-serv-id;\n exota=pass") ~= nil then
|
||||||
error "mt.header(Subject) failed"
|
error "mt.header(Subject) failed"
|
||||||
end
|
end
|
||||||
if mt.header(conn, "Authentication-Results", "my-auth-serv-id;\n dkim=pass header.d=yad.onmicrosoft.com header.s=selector1-yad-onmicrosoft-com header.b=mmmjFpv8") ~= nil then
|
if mt.header(conn, "Authentication-RESULTS", "my-auth-serv-id;\n dkim=pass header.d=yad.onmicrosoft.com header.s=selector1-yad-onmicrosoft-com header.b=mmmjFpv8") ~= nil then
|
||||||
error "mt.header(Subject) failed"
|
error "mt.header(Subject) failed"
|
||||||
end
|
end
|
||||||
if mt.header(conn, "Authentication-Results", "my-auth-serv-id;\n dkim=fail header.d=yad.onmicrosoft.com header.s=selector2-asdf header.b=mmmjFpv8") ~= nil then
|
if mt.header(conn, "Authentication-Results", "my-auth-serv-id;\n dkim=fail header.d=yad.onmicrosoft.com header.s=selector2-asdf header.b=mmmjFpv8") ~= nil then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user