Codebase list metche / be4aa75
VServers: send report messages to root@`vserver VSNAME exec hostname -f` instead of EMAIL_ADDRESS. intrigeri 17 years ago
3 changed file(s) with 25 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
100100 relatively to your VServer's root directory;
101101 - the "system state" backups will be saved in sub-directory in BACKUP_DIR's,
102102 called the same as the VServer;
103 - EMAIL_ADDRESS is not used for the VServers: the report messages will be
104 sent to the your VServer's root e-mail address; if you're using
105 ENCRYPT_EMAIL to encrypt the report messages, make sure their public key is
106 in the host system root's keyring, trusted enough to be used blindly by
107 metche;
103108 - all other configuration variables are used as it.
104109
105110 Most of metche commands (namely: list, report and stabilize) support a
7373 }
7474
7575 email() {
76 debug "* email $@"
76 debug "* email $@ to $EMAIL_ADDRESS"
7777 local subject="`current_system` - $_MAIL_SUBJECT : $1"
7878 if [ $ENCRYPT_EMAIL = "yes" ]; then
7979 LC_ALL="$LOCALE" gpg --batch --armor --encrypt \
187187 _CHANGELOG_DIR="$CHANGELOG_DIR"
188188 _CHANGELOG_FILE="$CHANGELOG_FILE"
189189 _DO_PACKAGES="$DO_PACKAGES"
190 _EMAIL_ADDRESS="$EMAIL_ADDRESS"
190191
191192 if [ -n "$VSNAMES" ]; then
192193 # check VSERVERINFO and VSERVER availability
217218 if [ "$ENCRYPT_EMAIL" = "yes" ]; then
218219 which gpg > /dev/null ||
219220 executable_not_found "gpg" "GnuPG" "ENCRYPT_EMAIL"
220 gpg --batch --list-public-keys $EMAIL_ADDRESS >/dev/null 2>&1 ||
221 fatal "GnuPG public key for $EMAIL_ADDRESS not found."
222221 fi
223222
224223 DATE=`date "+%Y%m%d%H%M"`
260259 # - 2 if $1 is not an existing VServer
261260 # - 3 if $1 is not a VServer listed in VSNAMES
262261 # - 4 if $1 is not a running VServer
262 # Anyway, return with exit-code:
263 # - 5 if the GnuPG public key can not be found
263264 context_config() {
264265 local vsname="$1"
266 local res
265267 debug "-------- Operating on" \
266268 "`if [ -z $vsname ]; then echo 'the host system'; else echo VServer $vsname; fi`"
267269 debug "* context_config"
274276 WATCHED_DIR="$_WATCHED_DIR"
275277 BACKUP_DIR="$_BACKUP_DIR"
276278 VSERVER_EXEC_PREFIX=""
279 EMAIL_ADDRESS="$_EMAIL_ADDRESS"
277280 else
278281 WATCHED_DIR="$VROOTDIR/$vsname/$_WATCHED_DIR"
279282 BACKUP_DIR="$_BACKUP_DIR/$vsname"
280283 VSERVER_EXEC_PREFIX="$VSERVER $vsname exec"
284 EMAIL_ADDRESS="root@`current_system`"
281285 # does the current VServer exist ?
282286 if [ ! -d "$VROOTDIR/$vsname" ]; then
283287 warning " VServer $vsname does not exist (error 2)."
301305 if [ "$res" = failed ]; then
302306 warning " VServer $vsname is not running (error 4)."
303307 return 4
308 fi
309 fi
310
311 # E-mail encryption
312 if [ $ENCRYPT_EMAIL = "yes" ]; then
313 gpg --batch --list-public-keys $EMAIL_ADDRESS >/dev/null 2>&1
314 res=$?
315 if [ $res -ne 0 ]; then
316 warning " GnuPG public key for $EMAIL_ADDRESS not found."
317 return 5
304318 fi
305319 fi
306320
166166 <envar>EXCLUDES</envar> configuration variable prevents it to send sensitive
167167 information, or triple check that secure connections will be used end-to-end
168168 on the email path. If unsure, set <envar>EMAIL_ADDRESS</envar> configuration
169 variable to a local mailbox.</Para>
169 variable to a local mailbox. Please note that <envar>EMAIL_ADDRESS</envar>
170 is not used for VServers: a VServer's report messages are sent to its root
171 email address.</Para>
170172
171173 <Para>metche stores, in <envar>BACKUP_DIR</envar> (default :
172174 <filename>/var/lib/metche</filename>), various backups of