pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
701 stars 163 forks source link

Do not add a Date header if it is already present #1435

Closed pacien closed 4 years ago

pacien commented 5 years ago

Describe the bug

A Date: header is systematically added after exiting the text editor when composing a message, even if one has already been defined manually by the user. This is particularly annoying when alot is used with git format-patch for example.

This results in multiple date headers being present in outgoing messages.

I think that this header should automatically be added only if it's not already present.

Software Versions

To Reproduce Steps to reproduce the behaviour:

  1. compose a new message
  2. add Date: Mon, 07 May 2012 12:09:16 -0700 in the headers in the text editor
  3. exit the text editor, send the message
  4. open the sent message and look at its source: it contains two Date: headers, one with the previously defined value, and another with the current date.

Error Log N.A.

pacien commented 5 years ago

Same problem for other headers such as Content-Type: https://github.com/pazz/alot/issues/897

pazz commented 5 years ago

Agreed. This line should be moved into alot.db.envelope.constuct_mail and conditional under that header being unset. I am not sure about content-type and other headers, because that should be dependent on there beint attachments etc..