sebbASF commented on code in PR #608:
URL: 
https://github.com/apache/tooling-trusted-releases/pull/608#discussion_r2738493869


##########
atr/mail.py:
##########
@@ -47,63 +49,12 @@ class Message:
     in_reply_to: str | None = None
 
 
-async def send(message: Message) -> tuple[str, list[str]]:
-    """Send an email notification about an artifact or a vote."""
-    log.info(f"Sending email for event: {message}")
-    from_addr = message.email_sender
-    if not from_addr.endswith(f"@{global_domain}"):
-        raise ValueError(f"from_addr must end with @{global_domain}, got 
{from_addr}")
-    to_addr = message.email_recipient
-    _validate_recipient(to_addr)
-
-    # UUID4 is entirely random, with no timestamp nor namespace
-    # It does have 6 version and variant bits, so only 122 bits are random
-    mid = f"{uuid.uuid4()}@{global_domain}"
-    headers = [
-        f"From: {from_addr}",
-        f"To: {to_addr}",
-        f"Subject: {message.subject}",
-        f"Date: {utils.formatdate(localtime=True)}",
-        f"Message-ID: <{mid}>",
-    ]
-    if message.in_reply_to is not None:
-        headers.append(f"In-Reply-To: <{message.in_reply_to}>")
-        # TODO: Add message.references if necessary
-        headers.append(f"References: <{message.in_reply_to}>")
-
-    # Normalise the body padding and ensure that line endings are CRLF
-    body = message.body.strip()
-    body = body.replace("\r\n", "\n")
-    body = body.replace("\n", "\r\n")
-    body = body + "\r\n"
-
-    # Construct the message
-    msg_text = "\r\n".join(headers) + "\r\n\r\n" + body
-
-    start = time.perf_counter()
-    log.info(f"sending message: {msg_text}")
-
-    errors = await _send_many(from_addr, [to_addr], msg_text)
-
-    if not errors:
-        log.info(f"Sent to {to_addr} successfully")
-    else:
-        log.warning(f"Errors sending to {to_addr}: {errors}")
-
-    elapsed = time.perf_counter() - start
-    log.info(f"Time taken to _send_many: {elapsed:.3f}s")
-
-    return mid, errors
-
-
-async def _send_many(from_addr: str, to_addrs: list[str], msg_text: str) -> 
list[str]:
+async def _send_many(from_addr: str, to_addrs: list[str], msg_bytes: bytes) -> 
list[str]:

Review Comment:
   Please don't change the order of the methods.
   It makes it really hard to see that actual changes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to