Vote #73155
未完了If ticket was created with priority High/Urgent, send smtp-email with priority Urgent
0%
説明
I am using Redmine 1.4 and I have a feature request (I did not found anything, regarding this):
- If a new ticket (created via web-UI) has the priority High/Urgent, also send the notification email with High priority via SMTP.
SMTP allows a priority-mark, so this would be a nice optional setting.
Exists some ideas about that?
Sincerely,
journals
This should be fairly simple aside from knowing which priority you should add the header for.
It might be a case of adding a custom priority field (SMTP Header) with a specific value (X-MSMail-Priority) but either way - adding the SMTP header is trivial
Just look in app/models/mailer.rb - the redmine_headers method already creates custom SMTP headers - you just need to add to headers[]
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Thanks for your hint.
The custom-header function is nice, but I dont want to make code changes. I thought, this request could be integrated as main-feature to Redmine as another setting.
Furthermore I have to make an if-case to check whether the ticket of the notification owns a high priority ot not (I dont have any ruby skills ;) ).
I thought this simply feature could be useful for all users.
--------------------------------------------------------------------------------
Well, I was intrigued by this and added a priority custom field called SMTP:X-MSMail-Priority and set it appropriately per priority.
I then added the following to mailer.rb (inside issue_add (line 478 to be precise) -
<pre>
# Add Custom SMTP headers per priority
IssuePriorityCustomField.all.each do |cf|
headers[cf.name[5..-1]] = issue.priority.custom_field_value(cf.id) if cf.name[0..4]=='SMTP:' && issue.priority.custom_field_value(cf.id)!=nil
end
</pre>
and I now see the following in my received email headers -
<pre>
Importance: high
X-Priority: 1
</pre>
Thunderbird nicely shows it in the Priority column too
--------------------------------------------------------------------------------
AFAIK, there's no standard header "priority"...
h2. Management summary
There's no standard email header for priority.
h2. Details
If you google you quickly get to "RFC 4021":http://tools.ietf.org/html/rfc4021#page-33, which has information about the priority header and says it originated in "RFC 2156":http://tools.ietf.org/html/rfc2156 (Mime Internet X.400 Enhanced Relay), which in turn says (on page 95):
> priority: Mapped to the extended RFC 822 field "Priority:".
In reality, RFC 2156 was just an updtae to "RFC 1327":http://tools.ietf.org/html/rfc1327, which states the same as cited above. OK, so let's look at "RFC 822":http://tools.ietf.org/html/rfc822... Interestingly, my browser can't find either the string 'prio' or the string 'extend'. OK, so there's no priority in 822...
Let's go on and check the RFCs that updated 822: "RFC 1123":http://tools.ietf.org/html/rfc1123... No 'priority' in there. "RFC 1138":http://tools.ietf.org/html/rfc1138... At last, page 38 has something:
> The following non-standard services (headers) may be present
> [...]
> Priority
... and on page 67 there's some more info:
> This section describes the MTS mappings [...] The following extensions to RFC 822 are defined to support this mapping:
> "Priority" ":" priority
> [...]
> priority = "normal" / "non-urgent" / "urgent"
So until now, no standard header priority is defined. Let's check the RFCs that obsoleted the good old 822, "RFC 2822":http://tools.ietf.org/html/rfc2822 - you're already expecting it: Neither 'priority' nor 'urgent' can be found in 2822.
But wasn't 2822 obsoleted by 5322? Yes, it was, but neither 'priority' nor 'urgent' in there, too.
Despite all this, there are some common headers that indicate some kind of 'priority':
* X-Priority
* X-MSMail-Priority
* Importance
--------------------------------------------------------------------------------
That's why I chose to test this on my system using configurable SMTP header additions - the issue priority custom field name determines the header added (it's strips the STMP: prefix)
I've gonna leave my change in at my site - it's doing no harm and some of my users might find it useful.
--------------------------------------------------------------------------------
Andrew Porter wrote:
> That's why I chose to test this on my system using configurable SMTP header additions - the issue priority custom field name determines the header added (it's strips the STMP: prefix)
I'm not a native English speaker but I have the gut feeling that I may have been harsh in my comment or that you might have taken it a bit insulting - sorry, if that's the case, that wasn't my intention.
Such a setting might be useful for users if the redmine admin knows which header to use for the company's email system.
> I've gonna leave my change in at my site - it's doing no harm and some of my users might find it useful.
I don't find it unuseful... If only the header was standardized and properly handled by all MTA / MUAs...
--------------------------------------------------------------------------------
Nah - no offence and I read your comment in the tone you intended - I agree with you about the lack of standardisation of it - but that's the nature of the RFC process and open protocols I guess. I was suprised it actually worked to be honest :)
--------------------------------------------------------------------------------
:-)
FTR: I checked our Lotus Notes (8.5.1, don't know about the Domino versions):
When marking an eMail as "High priority", it gets the header "Importance: 1".
--------------------------------------------------------------------------------
Jan Niggemann wrote:
> :-)
> FTR: I checked our Lotus Notes (8.5.1, don't know about the Domino versions):
> When marking an eMail as "High priority", it gets the header "Importance: 1".
RFC and Exchange (from test) use "low", "normal" and "high" literal values.
--------------------------------------------------------------------------------
Etienne Massip wrote:
> RFC and Exchange (from test) use "low", "normal" and "high" literal values.
RFC? Which one? Not that it matters much, I'm just interested...
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,New,2746,Send out issue priority in the email notification header