horde/horde — pull request #91 by Bullja (2014-06-24 23:39:28+00:00)
Title: Failback using address from original headers

In case no default e-mail address was specified in Default Identity, addHeader replaces the original 'From' with an empty 'From' header which causes the mail not being sent and staying in the outbox of Outlook for example. Log would show sth like this:
INFO: [1362] Handling SENDMAIL command with Wbxml.
DEBUG: [1362] I
DEBUG: [1362] I
DEBUG: [1362] I {F024B516-1BC1-464E-A7F5-BD0C415C16D2}
DEBUG: [1362] I
DEBUG: [1362] I
DEBUG: [1362] I
DEBUG: [1362] I From: "foo bar" <-- This is the header provided by Outlook
To:
Subject: test
Date: Wed, 25 Jun 2014 01:21:55 +0200
[...]
DEBUG: [1362] I
ERR: No from address provided. <-- Somewhen between the above output and
ERR: No from address provided. these errors, the 'From' header was removed
DEBUG: [1362] O
[...]

This patch ensures an e-mail address is available in default identity. If an e-mail address in default identity is available, it is beeing used to replace the 'From' header. Otherwise the original 'From' header will be used.