??? ??? ???? ??? ? ?? ? ?? ? ??? ???? ?? ??? ?? ?? ???? ????? ???? ????.
Apache SpamAssassin? ???? ???? ???? ?? ?? ??? ????? ? ??? ??? ??? ?? ???? ?????. ? ?????? SpamAssassin? ???? ???? ???? ????? ??? ???? ???? ??? ???? ??? ???????.
??? API? ????? ????? ????? ????? ??? ? ????.
? Apache SpamAssassin???
Apache SpamAssassin? Apache Software Foundation?? ???? ?? ?? ?? ?? ??????. ??? ??, ???? ??? ? ???? ???? ???? ?? ???? ?? "??"? ?????. ????? 5? ??? ???? ???? ??? ??? ????.
SpamAssassin? ??? ???? ? ????? ???? ?? ???? ???? ?? ??? ?? ?? ??? ????? ??? ???? ???? ???? ?? ????.
SpamAssassin ????
SpamAssassin? Linux ????? ????? ???????. ???? ????? Linux OS? ????? Docker VM? ???? ???.
Debian ?? Ubuntu ?????? ??? ???? SpamAssassin? ?????.
apt-get update && apt-get install -y spamassassin sa-update
sa-update ??? SpamAssassin? ??? ?? ???? ?????.
???? ?? ??? ???? SpamAssassin? ??? ??? ??? ? ????. ???? ?? ??? ??? ??? ?? ??? ??? ???? ?? ??? ????? ?????.
???? ???? ??? ????.
spamassassin -t < input_email.txt > results.txt
results.txt?? SpamAssassin? ?? ? ??? ?? ??? ???? ?????.
FastAPI? ???? SpamAssassin? API? ??
???? ??? html_body?? ? ?? ??? ??? ???? ??? API? ??? ?????. ??? SpamAssassin? ???? ?? ??? ?????.
FastAPI ?? ?
from fastapi import FastAPI from datetime import datetime, timezone from email.utils import format_datetime from pydantic import BaseModel import subprocess import re def extract_analysis_details(text): rules_section = re.search(r"Content analysis details:.*?(pts rule name.*?description.*?)\n\n", text, re.DOTALL) if not rules_section: return [] rules_text = rules_section.group(1) pattern = r"^\s*([-\d.]+)\s+(\S+)\s+(.+)$" rules = [] for line in rules_text.splitlines()[1:]: match = re.match(pattern, line) if match: score, rule, description = match.groups() rules.append({ "rule": rule, "score": float(score), "description": description.strip() }) return rules app = FastAPI() class Email(BaseModel): subject: str html_body: str @app.post("/spam_check") def spam_check(email: Email): # assemble the full email message = f"""From: example@example.com To: recipient@example.com Subject: {email.subject} Date: {format_datetime(datetime.now(timezone.utc))} Content-Type: text/html; charset="UTF-8" {email.html_body}""" # Run SpamAssassin and capture the output directly output = subprocess.run(["spamassassin", "-t"], input=message.encode('utf-8'), capture_output=True) output_str = output.stdout.decode('utf-8', errors='replace') details = extract_analysis_details(output_str) return {"result": details}
???? SpamAssassin ??? ?? ?? ????? ?????.
?? ??? ?? ???????.
subject: Test Email html_body: <html> <body> <p>This is an <b>HTML</b> test email.</p> </body> </html>
??? ??? ????.
[ { "rule": "MISSING_MID", "score": 0.1, "description": "Missing Message-Id: header" }, { "rule": "NO_RECEIVED", "score": -0.0, "description": "Informational: message has no Received headers" }, { "rule": "NO_RELAYS", "score": -0.0, "description": "Informational: message was not relayed via SMTP" }, { "rule": "HTML_MESSAGE", "score": 0.0, "description": "BODY: HTML included in message" }, { "rule": "MIME_HTML_ONLY", "score": 0.1, "description": "BODY: Message only has text/html MIME parts" }, { "rule": "MIME_HEADER_CTYPE_ONLY", "score": 0.1, "description": "'Content-Type' found without required MIME headers" } ]
API ??? ??
SpamAssassin? ????? ?????? ??? Linux ??? ?????. ????? ????? EC2 ????? DigitalOcean ???? ??? ? ???, ?? ?? ???? ?? ?? ??? ?? ?? ??? ? ????.
???? ???? ?? SpamAssassin? ?? ??? ???? ???? ??? ??? ???? ?? ??? ????.
?? Leapcell? ???? SpamAssassin? ?? ??? ???? ???? ??? ???? ????? ??? ? ????. ????? ? ??? ??? ???? ??? ???? ???.
Leapcell? API? ???? ?? ?? ????. Linux ??? ???? ???? Dockerfile? ???? ??? ?? ??? ??? ????. ??? Python ???? ???? "?? ??" ??? ???? ???? ???.
???? ???? ???? ??? ? ?? ?????? ?????. API? ??? ??? SpamAssassin? ???? ???? ??? ?? ? ??? ?????.
? ??? ??? ???? ?????? ???? API ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

???? Python ?? ?? ?????? ?? ????, "??? ?????, ?? ??"? ???? ??? ??? ??? ?? ??? ?????. 1. ???? ?? ? ??? ?? ?????. ?? ???? ?? ??? ???? ??? ? ? ????. ?? ??, Spoke () ?? ???? ??? ??? ?? ??? ?? ????? ?? ??? ??? ????. 2. ???? ?? ???? ??? ??? ?????? Draw () ???? ???? ????? ?? ???? ?? ??? ???? ??? ???? ?? ?? ?? ??? ????? ?? ?? ????? ?? ?????. 3. Python ?? ???? ???????. ?? ???? ??? ???? ?? ???? ??? ????? ??? ?? ???? ??? ???? ????. ??? ??? ??? ???? ? ??? "?? ??"??????. 4. ???? ? ???? ?? ??? ?????

???? __iter __ () ? __next __ () ???? ???? ?????. ???? ??? ? ??? ????, ?? ???? ?? ??? ??? ???? ?????. 1. ???? ?? () ?? ? ??? ??? ???? ? ?? ??? ?? ? ?? ???? ??? ????. 2. ???? ?? ??? ???? ??? ???? ???? ???? ???? ?? ???? ?????. 3. ???? ???? ?? ??? ?? ? ? ? ??? ?? ? ???????? ? ? ??? ?? ??? ??? ???? ?? ? ? ???? ??????. ?? : ??? ?? ???? ??? ???? ????. ???? ?? ?? ? ??? ?????? ???? ? ?? ?? ? ? ????.

API ??? ??? ??? ?? ??? ???? ???? ???? ????. 1. Apikey? ?? ??? ?? ????, ????? ?? ?? ?? URL ?? ??? ?????. 2. Basicauth? ?? ???? ??? Base64 ??? ??? ??? ??? ????? ?????. 3. OAUTH2? ?? Client_ID ? Client_Secret? ?? ??? ?? ?? ?? ??? BearEtroken? ???????. 4. ?? ??? ???? ?? ?? ?? ???? ????? ???? ?? ?? ? ????. ???, ??? ?? ??? ??? ???? ?? ??? ???? ???? ?? ?????.

????? ??? ? ??? ??? ?? ??? ???? ??? zip () ??? ???? ????.? ??? ?? ??? ???? ?? ??? ?? ????. ?? ??? ???? ?? ?? itertools.zip_longest ()? ???? ?? ?? ? ??? ?? ? ????. enumerate ()? ???? ??? ???? ?? ? ????. 1.zip ()? ???? ????? ?? ??? ??? ??? ?????. 2.zip_longest ()? ???? ?? ??? ?? ? ? ???? ?? ? ????. 3. Enumental (Zip ())? ??? ??? ????? ??? ???? ???? ?? ???? ?? ? ????.

typehintsinpythonsolvetheproblemombiguityandpotentialbugsindynamicallytypedcodebyallowingdevelopscifyexpectiontypes. theyenhancereadability, enablearylybugdetection ? improvetoomingsupport.typehintsareaddedusingaColon (:) forvariblesAndAramete

inpython, iteratorsareobjectsthatlowloppingthroughcollections __ () ? __next __ ()

Assert? ????? ???? ???? ?? ? ???? ??? ???? ??? ?? ?? ????. ??? ??? ??? ?? ??? ?????, ?? ?? ?? ??, ?? ?? ?? ?? ?? ?? ??? ????? ?? ?? ??? ?? ???? ??? ? ??? ??? ??? ??? ?? ???????. ?? ??? ???? ?? ?? ???? ?? ????? ??? ? ????.

Python? ???? ????? ???? API? ???? Fastapi? ?????. ?? ??? ?? ????? ?????? ??? ??? ??? ???? ?? ? ? ????. Fastapi ? Asgi Server Uvicorn? ?? ? ? ????? ??? ??? ? ????. ??? ??, ?? ?? ?? ? ???? ?????? API? ???? ?? ? ? ????. Fastapi? ??? HTTP ??? ???? ?? ?? ? Swaggerui ? Redoc Documentation Systems? ?????. ?? ??? ?? URL ?? ??? ?? ? ??? ??, ?? ?? ??? ???? ???? ?? ?? ??? ??? ? ????. Pydantic ??? ???? ??? ?? ???? ???? ????? ? ??? ? ? ????.
