zulip/zerver
Alex Vandiver 608c787c52 email_mirror: Create attachments as the message sender.
When the email mirror gateway is sending messages "as" a user (as
triggered by having access to the missed-message email address),
attachments were still created as the Email Gateway bot.  Since the
sender (the end-user) was not the owner of those attachments (the
gateway bot), nor were they referenced yet anywhere, this resulted in
the attachments being "orphaned" and not allowed to be accessed by
anyone -- despite the attachment links being embedded in the message.
This was accompanied by the error:

```
WARN [] User 12345 tried to share upload 123/3LkSA4OcoG6OpAknS2I0SFAQ/example.jpf in message 123456, but lacks permission
INFO [zerver.lib.email_mirror] Successfully processed email from user 12345 to example-stream
```

We solve this by creating attachment objects as the users the message
will be sent from.
2023-01-18 15:42:40 -08:00
..
actions message send: Ignore alert words for presence idle users. 2023-01-06 17:08:20 -08:00
data_import python: Clean up janky URL matching code with urlsplit. 2023-01-18 17:25:46 -05:00
integration_fixtures/nagios
lib email_mirror: Create attachments as the message sender. 2023-01-18 15:42:40 -08:00
management ruff: Fix ISC001 Implicitly concatenated string literals on one line. 2023-01-04 16:25:07 -08:00
migrations migrations: Fix ‘continue’ logic error in 0037. 2023-01-18 13:34:52 -08:00
openapi api-tests: Reduce error output for `/register` openapi validation. 2023-01-17 14:50:42 -08:00
tests email_mirror: Create attachments as the message sender. 2023-01-18 15:42:40 -08:00
tornado tornado: Move internal tornado redirect to under /internal/. 2023-01-09 18:23:58 -05:00
views api-docs: Clarify only API doc paths check for endpoint info. 2023-01-10 15:32:47 -08:00
webhooks intercom: Return success on HEAD requests. 2023-01-06 13:32:47 -08:00
worker ruff: Fix PIE790 Unnecessary `pass` statement. 2023-01-04 16:25:07 -08:00
__init__.py
apps.py sentry: Initialize sentry in AppConfig ready hook. 2022-09-26 12:42:36 -07:00
context_processors.py apps: Fix redirect from /apps -> https://zulip.com/apps/. 2022-12-30 17:47:16 -08:00
decorator.py decorator: Do not send HEAD response with non-empty body. 2023-01-06 13:32:47 -08:00
filters.py
forms.py ruff: Fix ISC003 Explicitly concatenated string. 2023-01-04 16:25:07 -08:00
logging_handlers.py python: Use Python 3.8 typing.{Protocol,TypedDict}. 2022-04-27 12:57:49 -07:00
middleware.py Upgrade Python requirements. 2023-01-04 11:08:56 -08:00
models.py settings: Rename helper function to check who can edit topics. 2022-12-13 23:11:50 -08:00
signals.py requirements: Upgrade to Django 4.0. 2022-07-13 16:07:17 -07:00