$now_date = date('D, j M Y H:i:s ', $now) . $this->timezone();
// TODO: Do we really want to preserve possibly old date? Date header should always have "now"... but here is not where this decision should be made -- the caller really should blank out $rfc822_header->date even for drafts being re-edited or sent
if (!empty($rfc822_header->date) && $rfc822_header->date != -1)
$message_date = date('D, j M Y H:i:s ', $rfc822_header->date) . $this->timezone();
else {
$message_date = $now_date;
$rfc822_header->date = $now;
}
/* Create a message-id */
$message_id = 'MESSAGE ID GENERATION ERROR! PLEASE CONTACT SQUIRRELMAIL DEVELOPERS';
// FIXME: The following headers may generate slightly differently between the message sent to the destination and that stored in the Sent folder because this code will be called before both actions. This is not necessarily a big problem, but other headers such as Message-ID and Date are preserved between both actions