1
0
Fork 0

minor fix to mms2email: fix for from address

This commit is contained in:
bagyenda 2007-09-16 07:20:15 +00:00
parent 30ed2d83f6
commit 195b7888b9
1 changed files with 12 additions and 3 deletions

View File

@ -151,11 +151,20 @@ static int sendMsg(MmsEnvelope *e)
*/
if (octstr_search_char(to->rcpt, '@', 0) > 0) {
int j = octstr_case_search(e->from, octstr_imm("/TYPE=PLMN"), 0);
int k = octstr_case_search(e->from, octstr_imm("/TYPE=IPv"), 0);
int len = octstr_len(e->from);
Octstr *pfrom;
if (j > 0 && j - 1 + sizeof "/TYPE=PLMN" == len)
pfrom = octstr_copy(e->from, 0, j);
else if (k > 0 && k + sizeof "/TYPE=IPv" == len)
pfrom = octstr_copy(e->from, 0, k);
else
pfrom = octstr_duplicate(e->from);
if (octstr_search_char(e->from, '@', 0) < 0)
pfrom = octstr_format("%S@%S", e->from, settings->hostname);
else
pfrom = e->from;
octstr_format_append(pfrom,"@%S", settings->hostname);
if (settings->mms2email)
res = mms_sendtovasp(settings->mms2email,