Opened 19 years ago
Closed 8 years ago
#3054 closed enhancement (wontfix)
Include attached files with added attachment e-mail notifications for tickets.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | notification | Version: | 0.9.5 |
Severity: | normal | Keywords: | attachments notification email |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When adding an attachment to a ticket, the notification e-mail sent should include it as an attachment.
An option could be added to limit this feature to files of up to a certain size.
Attachments (0)
Change History (11)
comment:1 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 19 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Any reason why we should not send notification e-mails when attachments are added?
A link to the attachment is probably better than attaching it to the notification e-mail, this way we avoid having to add another "maximum file size" option.
comment:3 by , 19 years ago
This could be a potential security issue, as an attached file might contain a malware.
I think a URL to the actual file would be a better solution.
comment:5 by , 18 years ago
Component: | ticket system → notification |
---|---|
Milestone: | → 0.12 |
comment:7 by , 14 years ago
Milestone: | next-major-0.1X → unscheduled |
---|
comment:8 by , 9 years ago
Owner: | removed |
---|---|
Status: | reopened → new |
comment:9 by , 8 years ago
Could maybe be implemented as a plugin? Untested:
from email.mime.application import MIMEApplication from trac.core import Component, implements from trac.notification.api import IEmailDecorator class AttachmentEmailDecorator(Component): implements(IEmailDecorator) # IEmailDecorator methods def decorate_message(self, event, message, charset): if event.category == 'attachment added': attachment = event.attachment filename = attachment.filename with attachment.open() as fd: part = MIMEApplication(fd.read(), Name=filename) part['Content-Disposition'] = 'attachment; filename="%s"' % filename message.attach(part)
comment:10 by , 8 years ago
See also th:#11642.
The plugin works well. It would probably be useful to have a debug level log message to indicate that the IEmailDecorator
is called.
I favor putting it in the CookBook and closing this ticket. If we get enough requests for the feature we could reconsider adding it to tracopt
.
comment:11 by , 8 years ago
Milestone: | unscheduled |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Yes, that sounds good to me. I created wiki:CookBook/Notification/Email.
Adding attachments to a ticket does not produce a notification.