linagora / tmail-backend

GNU Affero General Public License v3.0
30 stars 17 forks source link

Mailet to push data into OpenPaaS for tmail replies #1033

Closed chibenwa closed 1 month ago

chibenwa commented 1 month ago

This PR add a cheating mailet for push ical generated by tmail replies into OpenPaaS (<3)

            <!-- ICAL pipeline for EventCaleandar response -->
            <mailet match="SenderIsLocal" class="StripAttachment">
                <mimeType>text/calendar</mimeType>
                <attribute>rawIcalendar2</attribute>
                <onMailetException>ignore</onMailetException>
            </mailet>
            <mailet match="SenderIsLocal" class="MimeDecodingMailet">
                <attribute>rawIcalendar2</attribute>
                <onMailetException>ignore</onMailetException>
            </mailet>
            <mailet match="SenderIsLocal" class="ICalendarParser">
                <sourceAttribute>rawIcalendar2</sourceAttribute>
                <destinationAttribute>icalendar2</destinationAttribute>
                <onMailetException>ignore</onMailetException>
            </mailet>
            <mailet match="SenderIsLocal" class="com.linagora.tmail.mailet.SenderICALToJsonAttribute">
                <source>icalendar2</source>
                <destination>icalendarAsJson2</destination>
                <rawSource>rawIcalendar2</rawSource>
                <onMailetException>ignore</onMailetException>
            </mailet>
            <mailet match="SenderIsLocal" class="AmqpForwardAttribute">
                <uri>amqp://${env:OP_JAMES_AMQP_USERNAME}:${env:OP_JAMES_AMQP_PASSWORD}@${env:OP_JAMES_AMQP_HOST}:${env:OP_JAMES_AMQP_PORT}</uri>
                <exchange>james:events</exchange>
                <attribute>icalendarAsJson2</attribute>
                <onMailetException>ignore</onMailetException>
            </mailet>
            <!-- End of ICAL pipeline -->
chibenwa commented 1 month ago

https://github.com/linagora/tmail-backend/assets/6928740/57951c6f-3954-43a4-8991-96ef4ef76256

(prod run on a custom image to roll this change on top of 0.10.0)