Project

General

Profile

Actions

Patch #19242

open

Patch to the Redmine Mail Handler for overriding the sender, and adding custom header/footers to imported e-mails

Added by Stephane Lapie over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Following #19182 and experimenting with the Redmine Mail Handler, for use within my company, we ended up with the following need :
  • In some cases, accept both known senders and unknown senders, but we did not want to allow AnonymousUser to be used, so we needed to override the sender with a specific user :
    --post-user SENDER
    
  • In some cases, override all senders (known and unknown) with a specific user as specified above :
    --override-sender YES/NO
    
  • Since we are overriding the sender, and we did not want to lose this information, we opted to allow the command-line rdm-mailhandler.rb script to take custom headers and footers for the imported mail body (to be added right after the cleanup process so as to minimize interference) :
    --email-header TEXT
    --email-footer TEXT
    
The patch included adds :
  • the above options to extra/mail_handler/rdm-mailhandler.rb
  • the code to process them within app/models/mail_handler.rb

Right now we are using these options in this fashion (this is used on top of the patch from #19182), in a script called as destination for e-mail coming from the outside :

/usr/local/share/redmine-2.5/extra/mail_handler/rdm-mailhandler.rb -v \
    --override-sender yes \
    --post-user yuubinkyoku@internal.domain.com \
    --email-header "Mail sent by : $SENDER" \
    --certificate-bundle /etc/ssl/certs/ca-certificates.crt \
    --url https://$URL/ \
    --key $API_KEY \
    --project $LOCAL

SENDER, LOCAL are variables set by Postfix upon calling the aforementioned script.
URL and API_KEY are derived from the DOMAIN variable and are not relevant to this example.


Files


Related issues

Related to Redmine - Feature #19182: Patch to the Redmine Mail Handler for specifying a custom CA bundleClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF