X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fmail;h=158562202dbc092b5a19f5e90132640d61d47a1f;hb=1e0e4007e306ca111f0d538c073fd51380abcd99;hp=129bb3d1ffd8fa18c70cba5b6c9f7c848b224a12;hpb=6e4b0f410385bc5298762df2707e4d2f81e52eec;p=myplc.git diff --git a/plc.d/mail b/plc.d/mail index 129bb3d..1585622 100755 --- a/plc.d/mail +++ b/plc.d/mail @@ -1,17 +1,19 @@ #!/bin/bash # -# priority: 250 +# priority: 200 # # Start local mail server. # # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: httpd,v 1.1 2006/04/06 21:51:59 mlhuang Exp $ -# # Source function library and configuration . /etc/plc.d/functions +. /etc/planetlab/plc_config + +# Be verbose +set -x case "$1" in start) @@ -22,7 +24,14 @@ case "$1" in MESSAGE=$"Starting mail server" dialog "$MESSAGE" - service sendmail start + # Add apache to list of users that can send mail as others + # without a warning, so that the API can send out mail. + count=$(grep ^apache /etc/mail/trusted-users|wc -l) + if [ $count -eq 0 ] ; then + echo "apache" >>/etc/mail/trusted-users + fi + + (exec 3>&- 4>&- ; service sendmail start) check result "$MESSAGE"