iftechfoundation / ifarchive-admintool

Admin script for IF Archive work
1 stars 1 forks source link

Users with "incoming" role should be emailed when a file is uploaded #20

Closed dfabulich closed 9 months ago

dfabulich commented 9 months ago

I have the "incoming" role, but I'm not receiving email notifications when files are getting uploaded.

dfabulich commented 9 months ago

https://if-foundation.slack.com/archives/C61AKJ7CY/p1701228486791659

@dougo: Yeah, I think you'd have to be added to the webuploader alias if you want to get notified of uploads

dfabulich commented 9 months ago

The emailing is all handled by upload.py. https://github.com/iftechfoundation/ifarchive-upload-py/blob/main/upload.py

It's configured to send mail via sendmail to the webuploader address. That mechanism doesn't know anything about admin roles. … but it could!

I can imagine fixing this in a few ways:

  1. Close/ignore this issue for now. Manually keep the webuploader recipients up to date.
  2. upload.py currently directly reads and accesses the admintool SQLite DB to INSERT INTO uploads. Instead of simply emailing webuploader, upload.py could access the SQLite DB directly, figure out who needs to receive email, and email them each directly via sendmail.
  3. Email responsibility could move to the admintool. Perhaps upload.py would POST something to /admintool, and that would figure out the list of recipients and email them.
erkyrath commented 9 months ago

Today's solution is (1).

(Note that upload.py sends mail to webuploader@ifarchive.org, which is a Fastmail alias. So updating the list of recipients involves logging into Fastmail.)

I would go with (2) over (3), but neither is very urgent. I don't expect the list of recipients to change often.

dfabulich commented 9 months ago

I noticed a reason today not to bother with this. When someone writes in to submit@ifarchive.org, the people who get emails about incoming uploads should also receive those emails. Therefore, people with the incoming role simply need to be a member of the webuploader mailing list. Thus, it seems like we've just got to keep those in sync manually.