- Add MIME-Version header to email messages outgoing
- check for short code in globalsender before checking if local recipient
This commit is contained in:
parent
79b19bac64
commit
88de7ef670
|
@ -3165,16 +3165,16 @@ is discarded and the sender notified via delivery report.
|
||||||
<li> If the message is due for delivery attempt, the global sender
|
<li> If the message is due for delivery attempt, the global sender
|
||||||
determines, for each recipient, how to deliver the message:
|
determines, for each recipient, how to deliver the message:
|
||||||
<ol type="a">
|
<ol type="a">
|
||||||
<li> If the message is destined for a local MMS client, the message
|
|
||||||
is transferred to the mobile/local queue. A copy of the message is
|
|
||||||
sent (as MIME) to the MMBox host (if one is configured)
|
|
||||||
<li> If the message is destined for an email user, the message is
|
<li> If the message is destined for an email user, the message is
|
||||||
re-formatted as MIME, sender and recipient addresses normalised as RFC
|
re-formatted as MIME, sender and recipient addresses normalised as RFC
|
||||||
822 addresses, and the message passed to the mailer.
|
822 addresses, and the message passed to the mailer.
|
||||||
<li> If the message is destined for a foreign gateway, it is coded
|
|
||||||
as MIME and passed to the mailer for delivery via SMTP
|
|
||||||
<li>If the the message is destined for a VASP (identified by short
|
<li>If the the message is destined for a VASP (identified by short
|
||||||
code), then it is sent using MM7 protocols to the relevant VASP.
|
code), then it is sent using MM7 protocols to the relevant VASP.
|
||||||
|
<li> If the message is destined for a local MMS client, the message
|
||||||
|
is transferred to the mobile/local queue. A copy of the message is
|
||||||
|
sent (as MIME) to the MMBox host (if one is configured)
|
||||||
|
<li> If the message is destined for a foreign gateway, it is coded
|
||||||
|
as MIME and passed to the mailer for delivery via SMTP
|
||||||
<li> If the message cannot be delivered, the sender is notified.
|
<li> If the message cannot be delivered, the sender is notified.
|
||||||
</ol>
|
</ol>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
|
@ -645,6 +645,9 @@ int mms_sendtoemail(Octstr *from, Octstr *to,
|
||||||
http_header_add(newhdrs, "From", octstr_get_cstr(from));
|
http_header_add(newhdrs, "From", octstr_get_cstr(from));
|
||||||
http_header_add(newhdrs, "To", octstr_get_cstr(to));
|
http_header_add(newhdrs, "To", octstr_get_cstr(to));
|
||||||
http_header_add(newhdrs, "Message-ID", msgid ? octstr_get_cstr(msgid) : "");
|
http_header_add(newhdrs, "Message-ID", msgid ? octstr_get_cstr(msgid) : "");
|
||||||
|
|
||||||
|
http_header_add(newhdrs, "MIME-Version", "1.0");
|
||||||
|
|
||||||
http_header_combine(newhdrs, m->headers);
|
http_header_combine(newhdrs, m->headers);
|
||||||
http_destroy_headers(m->headers);
|
http_destroy_headers(m->headers);
|
||||||
m->headers = newhdrs;
|
m->headers = newhdrs;
|
||||||
|
|
|
@ -207,6 +207,18 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Search VASP list, see what you can find... */
|
||||||
|
for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
|
||||||
|
if ((vasp = list_get(settings->vasp_list, j)) != NULL &&
|
||||||
|
_x_octstr_int_compare(vasp->short_code, phonenum) == 0) {
|
||||||
|
res = mms_sendtovasp(vasp, e->from, to->rcpt,
|
||||||
|
e->msgId,
|
||||||
|
msg, &err);
|
||||||
|
sent = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sent != 1) { /* Not yet, sent, find the receiver MMSC. */
|
||||||
/* Normalise the number, then see if we can resolve home MMSC for this recipient. */
|
/* Normalise the number, then see if we can resolve home MMSC for this recipient. */
|
||||||
normalize_number(octstr_get_cstr(settings->unified_prefix), &phonenum);
|
normalize_number(octstr_get_cstr(settings->unified_prefix), &phonenum);
|
||||||
|
|
||||||
|
@ -252,17 +264,8 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
octstr_destroy(mmsc);
|
octstr_destroy(mmsc);
|
||||||
} else /* Search VASP list, see what you can find... */
|
|
||||||
for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
|
|
||||||
if ((vasp = list_get(settings->vasp_list, j)) != NULL &&
|
|
||||||
_x_octstr_int_compare(vasp->short_code, phonenum) == 0) {
|
|
||||||
res = mms_sendtovasp(vasp, e->from, to->rcpt,
|
|
||||||
e->msgId,
|
|
||||||
msg, &err);
|
|
||||||
sent = 1;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!sent) {
|
if (!sent) {
|
||||||
res = MMS_SEND_ERROR_FATAL;
|
res = MMS_SEND_ERROR_FATAL;
|
||||||
err = octstr_format("MMSC error: Don't know how to deliver to %S !", to->rcpt);
|
err = octstr_format("MMSC error: Don't know how to deliver to %S !", to->rcpt);
|
||||||
|
|
Loading…
Reference in New Issue