This is a snapshot of Indico's old Trac site. Any information contained herein is most probably outdated. Access our new GitHub site here.

Opened 3 years ago

Closed 21 months ago

#1090 closed enhancement (fixed)

Use the python email module to assemble mails

Reported by: pedersen Owned by:
Priority: low Milestone: v1.2
Component: General Version:
Keywords: Cc:

Description

Currently the mail messages are assembled by "hand". To allow for MIME-encoded attachements or HTML-Mails, use the email module (especially the email.MIMExxx submodules) to generate the mails.

This should be possible to introduce in a backwards-comaptible way.
I will try and generate a patch during the next time.

Attachments (1)

0001-FEATURE-Use-the-python-email-module.patch (7.9 KB) - added by pedersen 2 years ago.
based on current master

Download all attachments as: .zip

Change History (12)

comment:1 Changed 3 years ago by pedersen

Question: Is the content type in the GeneralNotification? used anywhere? Currently it seems to always be 'text/plain'.

Background: I think it should be possible to leave this decision to the GenericMail? class as it depends on the presence of a) HTML content b) attachements.

comment:2 Changed 3 years ago by pedersen

Added a new patch that fixes a few problems if Notifications that are not derived from GenericNotification?
are used.

comment:3 Changed 3 years ago by jbenito

  • Milestone set to v1.1
  • Status changed from new to awaiting_merge

Changed 2 years ago by pedersen

based on current master

comment:4 Changed 2 years ago by pedersen

Added a new version of the patch.

A use of this is in the new patches in #1078

comment:5 Changed 2 years ago by jbenito

  • Milestone changed from v1.1 to v1.2

comment:6 Changed 2 years ago by jmonnich

After flask is in master having a look at http://pythonhosted.org/flask-mail/ might be a good idea. It's pretty nice especially when needing to attach files.

comment:7 Changed 23 months ago by jbenito

  • Milestone changed from v1.2 to v1.3
  • Priority changed from normal to low
  • Status changed from awaiting_merge to assigned

comment:8 Changed 23 months ago by jbenito

  • Milestone changed from v1.3 to v1.2
  • Status changed from assigned to awaiting_merge

comment:9 Changed 23 months ago by jbenito

Currently in master we already allow attachments and HTML:

https://github.com/indico/indico/blob/master/indico/MaKaC/common/mail.py#L80

I guess this is completing this ticket as well? do you miss something there?

Thanks.

comment:10 Changed 21 months ago by jmonnich

  • Status changed from awaiting_merge to assigned

Thanks for the contribution, but it became obsolete due to the changes done by bkolobara

comment:11 Changed 21 months ago by jmonnich

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.