Skip to content

Conversation

milescalabresi
Copy link
Contributor

@milescalabresi milescalabresi commented Apr 23, 2025

replace sha with hashlib for python3 to fix issue with emailing class list aliases

@milescalabresi milescalabresi requested a review from kkbrum April 23, 2025 01:19
@milescalabresi milescalabresi self-assigned this Apr 23, 2025
@willgearty
Copy link
Member

willgearty commented Apr 23, 2025

Some additional ideas based on discussion:

  1. We should verify sender email addresses in mailgate.py before sending along emails:
  1. We should reject any emails from
  • a sender email address that isn't associated with an account on [subdomain].learningu.org or learningu.org

@milescalabresi milescalabresi changed the title replace sha with hashlib for python3 fix and improve emailing class list aliases May 2, 2025
@milescalabresi
Copy link
Contributor Author

We discussed a better way to do it.

  1. Catch sender's message and grab the data fields (To, From, Subject, Body, etc.)
  2. If the sender's email is not associated with an account on the site:
    a. Do not forward the email
    b. Send the user a bounce message (rate-limit once per day/week/something using something similar to dbmail.MessageRequests to track)
  3. If the sender's email is associated with an account on the site:
    a. If there is more than one such account, do some logic to identify the "right" account (options include: prefer admin > teacher > volunteer > student; choose earliest account created; send a bounce and instruct them to merge accounts), say [email protected]
    b. Use SendGrid to send an email to each recipient of the original message (To, Cc, Bcc) individually from [email protected]. We should be able to import and use the send_mail function

@willgearty
Copy link
Member

With those changes, this should also fix #3760.

@hwatheod
Copy link
Contributor

hwatheod commented Jul 4, 2025

Is the purpose of these changes to address the spam abuse reports? Will all emails be sent through SendGrid now?

@milescalabresi
Copy link
Contributor Author

milescalabresi commented Jul 4, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants