X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plc.d%2Fmail;h=2adfc973dc27c5edbd025473b04c5ff8fd417037;hb=732a0fd6d8d7f94ee2ed99ddd3b5b9a41d8ea0e3;hp=6698a680711faa4ed893453b110c760052db2251;hpb=309572ab8b4843bb6507b0b3f6dc5e5240af257b;p=myplc.git diff --git a/plc.d/mail b/plc.d/mail index 6698a68..2adfc97 100755 --- a/plc.d/mail +++ b/plc.d/mail @@ -1,19 +1,22 @@ #!/bin/bash +# $Id$ +# $URL$ # -# priority: 250 +# priority: 200 # # Start local mail server. # # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: mail,v 1.1 2006/04/24 15:49:32 mlhuang Exp $ -# # Source function library and configuration . /etc/plc.d/functions . /etc/planetlab/plc_config +# Be verbose +set -x + case "$1" in start) if [ "$PLC_MAIL_ENABLED" != "1" ] ; then @@ -23,7 +26,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"