mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 07:48:14 +00:00
Allow subject to be set
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -147,6 +147,7 @@ static int maxlogins;
|
|||||||
static char *emailbody = NULL;
|
static char *emailbody = NULL;
|
||||||
static int pbxskip = 0;
|
static int pbxskip = 0;
|
||||||
static char fromstring[15];
|
static char fromstring[15];
|
||||||
|
static char emailtitle[100];
|
||||||
|
|
||||||
STANDARD_LOCAL_USER;
|
STANDARD_LOCAL_USER;
|
||||||
|
|
||||||
@@ -596,6 +597,13 @@ static int sendmail(char *srcemail, char *email, char *name, int msgnum, char *m
|
|||||||
else
|
else
|
||||||
fprintf(p, "From: Asterisk PBX <%s>\n", who);
|
fprintf(p, "From: Asterisk PBX <%s>\n", who);
|
||||||
fprintf(p, "To: %s <%s>\n", name, email);
|
fprintf(p, "To: %s <%s>\n", name, email);
|
||||||
|
|
||||||
|
if( *emailtitle)
|
||||||
|
{
|
||||||
|
fprintf(p, emailtitle, msgnum, mailbox) ;
|
||||||
|
fprintf(p,"\n") ;
|
||||||
|
}
|
||||||
|
else
|
||||||
if (pbxskip)
|
if (pbxskip)
|
||||||
fprintf(p, "Subject: New message %d in mailbox %s\n", msgnum, mailbox);
|
fprintf(p, "Subject: New message %d in mailbox %s\n", msgnum, mailbox);
|
||||||
else
|
else
|
||||||
@@ -2575,6 +2583,7 @@ static int load_config(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
memset(fromstring,0,sizeof(fromstring));
|
memset(fromstring,0,sizeof(fromstring));
|
||||||
|
memset(emailtitle,0,sizeof(emailtitle));
|
||||||
if (emailbody) {
|
if (emailbody) {
|
||||||
free(emailbody);
|
free(emailbody);
|
||||||
emailbody = NULL;
|
emailbody = NULL;
|
||||||
@@ -2583,6 +2592,8 @@ static int load_config(void)
|
|||||||
pbxskip = ast_true(s);
|
pbxskip = ast_true(s);
|
||||||
if ((s=ast_variable_retrieve(cfg, "general", "fromstring")))
|
if ((s=ast_variable_retrieve(cfg, "general", "fromstring")))
|
||||||
strncpy(fromstring,s,sizeof(fromstring)-1);
|
strncpy(fromstring,s,sizeof(fromstring)-1);
|
||||||
|
if ((s=ast_variable_retrieve(cfg, "general", "emailtitle")))
|
||||||
|
strncpy(emailtitle,s,sizeof(emailtitle)-1);
|
||||||
if ((s=ast_variable_retrieve(cfg, "general", "emailbody"))) {
|
if ((s=ast_variable_retrieve(cfg, "general", "emailbody"))) {
|
||||||
char *tmpread, *tmpwrite;
|
char *tmpread, *tmpwrite;
|
||||||
emailbody = strdup(s);
|
emailbody = strdup(s);
|
||||||
|
|||||||
Reference in New Issue
Block a user