Skip to content

Commit

Permalink
AlertCommand working for mail sending
Browse files Browse the repository at this point in the history
  • Loading branch information
destroyedlolo committed Feb 1, 2016
1 parent cefef9e commit 2a9fb92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Marcel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ SMSUrl=https://smsapi.free-mobile.fr/sendmsg?user=xxxxxxxx&pass=xxxxxxxxxxxxxx&m
# %s will be replaced by the message to send
# PLEASE SHARE IF YOU ADDAPT FOR OTHER ISP.

#send alert as mail
# %t% is replaced by the title
# The message body is put in stdin
AlertCommand=mail -s "%t%" mail@domain.com

# User functions definition
# used for DPD & Every
UserFuncScript=scripts/AllVerif.lua
Expand Down
9 changes: 8 additions & 1 deletion src/Alerting.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ static void AlertCmd( const char *id, const char *msg ){
}
*d = 0;

printf("res :<%s>\n", tcmd);

FILE *f = popen( tcmd, "w");
if(!f){
perror("popen()");
return;
}
fputs(msg, f);
fclose(f);
}

static struct alert *findalert(const char *id){
Expand Down

0 comments on commit 2a9fb92

Please sign in to comment.