[asterisk-commits] oej: branch oej/minivoicemail r58435 - /team/oej/minivoicemail/apps/app_minivm.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 8 10:59:01 MST 2007


Author: oej
Date: Thu Mar  8 11:59:01 2007
New Revision: 58435

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58435
Log:
use the proper email address too

Modified:
    team/oej/minivoicemail/apps/app_minivm.c

Modified: team/oej/minivoicemail/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/oej/minivoicemail/apps/app_minivm.c?view=diff&rev=58435&r1=58434&r2=58435
==============================================================================
--- team/oej/minivoicemail/apps/app_minivm.c (original)
+++ team/oej/minivoicemail/apps/app_minivm.c Thu Mar  8 11:59:01 2007
@@ -1029,9 +1029,13 @@
 	if (option_debug > 3)
 		ast_log(LOG_DEBUG, "-_-_- Fromstring now: %s\n", ast_strlen_zero(passdata) ? "-default-" : passdata);
 
+	fprintf(p, "Message-ID: <Asterisk-%d-%s-%d-%s>\n", (unsigned int)rand(), vmu->username, getpid(), who);
 	len_passdata = strlen(vmu->fullname) * 2 + 3;
 	passdata2 = alloca(len_passdata);
-	fprintf(p, "To: %s <%s>\n", mailheader_quote(vmu->fullname, passdata2, len_passdata), vmu->email);
+	if (!ast_strlen_zero(vmu->email))
+		fprintf(p, "To: %s <%s>\n", mailheader_quote(vmu->fullname, passdata2, len_passdata), vmu->email);
+	else
+		fprintf(p, "To: %s <%s@%s>\n", mailheader_quote(vmu->fullname, passdata2, len_passdata), vmu->username, vmu->domain);
 
 	if (!ast_strlen_zero(template->subject)) {
 		char *passdata;
@@ -1055,7 +1059,6 @@
 
 	if (option_debug > 2)
 		fprintf(p, "X-Asterisk-debug: template %s user account %s@%s\n", template->name, vmu->username, vmu->domain);
-	fprintf(p, "Message-ID: <Asterisk-%d-%s-%d-%s>\n", (unsigned int)rand(), vmu->username, getpid(), who);
 	fprintf(p, "MIME-Version: 1.0\n");
 
 	/* Something unique. */



More information about the asterisk-commits mailing list