1
0
Fork 0

set dlr from address to to address

This commit is contained in:
bagyenda 2007-06-12 11:43:30 +00:00
parent 81adc79a47
commit 26adfda0db
5 changed files with 16 additions and 12 deletions

View File

@ -1,3 +1,5 @@
2007-06-12 P. A. Bagyenda <bagyenda@dsmagic.com>
* Improved DLR reporting over MM4 interface - set receipient as from address
2007-05-08 P. A. Bagyenda <bagyenda@dsmagic.com>
* Improved MIME to MMS conversion conversion
2007-05-05 P. A. Bagyenda <bagyenda@dsmagic.com>

View File

@ -381,11 +381,12 @@ int main(int argc, char *argv[])
o_to = NULL;
qf = mms_getqf_fromtransid(transid);
if (qf) {
MmsEnvelope *e;
octstr_strip_blanks(qf);
strip_quotes(qf);
octstr_strip_blanks(o_to);
strip_quotes(o_to);
MmsEnvelope *e = mms_queue_readenvelope(octstr_get_cstr(qf),
e = mms_queue_readenvelope(octstr_get_cstr(qf),
octstr_get_cstr(settings->global_queuedir),
1);
if (!e)

View File

@ -294,6 +294,8 @@ static int sendMsg(MmsEnvelope *e)
if (e->dlr) {
Octstr *qfs;
char *mstatus;
MmsMsg *m;
List *l;
if (res == MMS_SEND_QUEUED)
mstatus = "Forwarded";
@ -301,9 +303,9 @@ static int sendMsg(MmsEnvelope *e)
mstatus = "Expired";
else
mstatus = "Rejected";
MmsMsg *m = mms_deliveryreport(e->msgId, to->rcpt, tnow, octstr_imm(mstatus));
m = mms_deliveryreport(e->msgId, to->rcpt, tnow, octstr_imm(mstatus));
List *l = gwlist_create();
l = gwlist_create();
gwlist_append(l, octstr_duplicate(e->from));

View File

@ -415,7 +415,7 @@ static int sendNotify(MmsEnvelope *e)
gwlist_append(l, from);
/* Add to queue, switch via proxy to be from proxy. */
res = mms_queue_add(settings->system_user, l, err,
res = mms_queue_add(to ? to : settings->system_user, l, err,
NULL, fromproxy,
tnow, tnow+settings->default_msgexpiry, m, NULL,
NULL, NULL,

View File

@ -830,13 +830,14 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
octstr_case_compare(allow_report, octstr_imm("Yes")) == 0) &&
(pdelivery_report && octstr_case_compare(pdelivery_report,
octstr_imm("Yes")))) {
MmsMsg *mrep = mms_deliveryreport(pmsgid, h->client_addr, time(NULL), octstr_imm("Forwarded"));
Octstr *from = h->client_addr ? h->client_addr : settings->system_user;
MmsMsg *mrep = mms_deliveryreport(pmsgid, h->client_addr, time(NULL),
octstr_imm("Forwarded"));
Octstr *x;
List *l = gwlist_create();
gwlist_append(l, pfrom);
x = mms_queue_add(settings->system_user, l, NULL, NULL, NULL, 0,
x = mms_queue_add(from, l, NULL, NULL, NULL, 0,
time(NULL) + settings->default_msgexpiry,
mrep, NULL,
NULL, NULL,
@ -958,12 +959,13 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
|| octstr_case_compare(allow_report, octstr_imm("Yes")) == 0) &&
e->dlr) {
Octstr *x;
Octstr *from = h->client_addr ? h->client_addr : settings->system_user;
List *l = gwlist_create();
mrpt = mms_deliveryreport(e->msgId, h->client_addr, time(NULL), status);
gwlist_append(l, octstr_duplicate(e->from));
x = mms_queue_add(settings->system_user, l, NULL, NULL, NULL, 0,
x = mms_queue_add(from, l, NULL, NULL, NULL, 0,
time(NULL) + settings->default_msgexpiry, mrpt, NULL,
NULL, NULL,
NULL, NULL,
@ -1007,7 +1009,7 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
case MMS_MSGTYPE_READ_REC_IND:
{
List *mh = mms_message_headers(m);
Octstr *from = h->client_addr ? octstr_duplicate(h->client_addr) : octstr_create("anon@anon");
Octstr *from = h->client_addr ? h->client_addr : octstr_create("anon@anon");
List *to = gwlist_create();
Octstr *x;
@ -1035,9 +1037,6 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
octstr_destroy(x);
mdone2:
if (from)
octstr_destroy(from);
if (mh)
http_destroy_headers(mh);