A quick update. I've been troubleshooting this problem quite a bit and I've been in the roundcube irc channel bouncing ideas off those guys.
I realized roundcube is resetting the php error log to it's own based on the config so I have an error now:
[21-Sep-2006 14:19:32 -0500] SMTP Error: SMTP error: No From address has been provided
in /var/www/round/trunk/roundcubemail/program/steps/mail/sendmail.inc on line 323
On line 316 of sendmail.inc
$sent = smtp_mail($from, $a_recipients, $header_str, $msg_body);
I confirmed that $from was empty and if I manually hardcoded an email address I could successfully send email.
I'm using SVN revision 348.
Now that I've regained some sanity I'm trying to figure out why $from isn't being set properly.
I believe my problem is in this block of code:
$identity_arr = rcmail_get_identity(get_input_value('_from', RCUBE_INPUT_POST));
$from = $identity_arr['mailto'];
$first_to = is_array($to_address_arr[0]) ? $to_address_arr[0]['mailto'] : $mailto;
if (empty($identity_arr['string']))
$identity_arr['string'] = $from;
// compose headers array
$headers = array('Date' => date('D, j M Y G:i:s O'),
'From' => $identity_arr['string'],
'To' => rcube_charset_convert($mailto, $input_charset, $message_cha$
Most likely something to do with the rcmail_get_identity function not setting mailto properly.
function rcmail_get_identity($id)
{
global $DB, $CHARSET, $OUTPUT;
// get identity record
$sql_result = $DB->query("SELECT *, email AS mailto
FROM ".get_table_name('identities')."
WHERE identity_id=?
AND user_id=?
AND del<>1",
$id,$_SESSION['user_id']);
if ($DB->num_rows($sql_result))
{
$sql_arr = $DB->fetch_assoc($sql_result);
$out = $sql_arr;
$name = strpos($sql_arr['name'], ",") ? '"'.$sql_arr['name'].'"' : $sql_arr['name'$
$out['string'] = sprintf('%s <%s>',
rcube_charset_convert($name, $CHARSET, $OUTPUT->get_chars$
$sql_arr['mailto']);
return $out;
}
return FALSE;
}
($DB->num_rows($sql_result)) is equaling 0
In this query:
// get identity record
$sql_result = $DB->query("SELECT *, email AS mailto
FROM ".get_table_name('identities')."
WHERE identity_id=?
AND user_id=?
AND del<>1",
$id,$_SESSION['user_id']);
get_table_name('identities') is identities which is valid
$id is empty
$_SESSION['user_id'] is 7 which is valid
If I go back to the compose screen and enter my email address in the Sender field, $id is set to that email address.
ha! here's the kicker, if I go back to the compose screen and enter '7' as my Sender the mail is sent!
So from what I can tell that SQL needs to be rewritten to look at the identities.email instead of indentities.identity_id.
How am I the only one with this problem?