Hi,

Nils Breunese (Lemonbit) wrote on 2008-08-21 11:35:03 +0200 [Re: 
[BackupPC-users] Configuring user emails]:
> Alan McKay wrote:
> 
> >> Is it possible to set up arbitrary user email addresses for the emails?

actually, judging by the code rather than having tried it, it should be,
though it's a hack, not a feature ;-). In $Conf{EMailNoBackupRecentMesg} (and
$Conf{EMailNoBackupEverMesg} and $Conf{EmailOutlookBackupMesg} if applicable)
you can override the message you are sending - on a per PC basis. The message
includes the destination, by default interpolated as '$user$domain', but nobody
says you *have to* use an interpolated value. You can change the line to

        To: [EMAIL PROTECTED]

and neither the user nor the EMailUserDestDomain will have an influence on
where the mail is sent. Ugly, as you're hardcoding the address and the message
into each host's configuration (and the address multiple times for multiple
different messages). On the other hand, you can mix different language
messages if you feel like it, and you keep all the configuration limited to
the BackupPC host config file.

It appears you can use the following variables in your message:

        $user    - user (you could include this somewhere in the message text)
        $domain  - EMailUserDestDomain
        $host    - well, the host
        $headers - $Conf{EMailHeaders}, MIME headers
        $CgiURL  - should probably be the URL to the host's BackupPC page,
                   though it's undef by default and I didn't check if it's
                   computed somewhere
        $subj    - default message subject (also shown on the web page)


A different and possibly more clean approach would be to set the user name
part of the address you want the messages to go to as the primary user (even
though you don't set up HTTP authentication for that user name) and the
user(s) that has/have access to the host as moreUsers in the hosts file.
For the domain part, you have $Conf{EMailUserDestDomain}. That only works as
long as you have distinct user names and email addresses. Otherwise you may
be giving people access to hosts they shouldn't have access to ...

Or you can use e-mail aliases. You don't need existing system users for that,
you need access to your MTA configuration though (usually /etc/aliases for the
aliases). If you can't use (some of) the BackupPC user names because they
conflict with existing local user names, you could, again, use a dummy primary
user name in the hosts file and alias that to the real recipient.

You could even use EMailUserDestDomain to append something to the user name
(normally you'd have '@dest.domain.com', but if you change that to
'[EMAIL PROTECTED]', you'd get user names you probably
don't already have and can alias to real recipients again; that way you'd only
have to change EMailUserDestDomain globally and set up aliases in your MTA).


If you don't like any of these approaches, you can patch BackupPC to use
$Conf{EMailUserAddress} to override the primary user name for e-mail
messages ;-).

Regards,
Holger

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BackupPC-users mailing list
[email protected]
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to