Last email sent to username ... subject ""

"Tyler J. Wagner" <[email protected]>
Newsgroups gmane.comp.sysutils.backup.backuppc.devel
Message-ID <1299752418.2760.12.camel@baal>
Attached is a patch for lib/BackupPC/CGI/HostInfo.pm which corrects a
minor bug in BackupPC 3.2.0. The "Last email sent" line is always
printed in the host information page, even if no email has ever been
sent. This results in output like so:

Last email sent to [email protected] was at 2011-03-10 10:18, subject "".

The date is always the current time.

This patch corrects that. If no email has ever been sent (last email subject is undefined),
it simply doesn't output the "Last email sent" line.

Apologies if this isn't the correct way to submit bug reports or
patches. I cannot find a bug tracker online, except via Debian
or Ubuntu.

Regards,
Tyler

-- 
"Never underestimate the bandwidth of a station wagon full of tapes
hurtling down the highway.
   -- Andrew S. Tanenbaum

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d

_______________________________________________
BackupPC-devel mailing list
[email protected]
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-devel
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
noemail_HostInfo.pm.patch (text/x-patch, 1 KB)
--- HostInfo.pm_orig	2010-10-07 15:37:37.000000000 +0000
+++ HostInfo.pm	2011-03-10 10:09:24.000000000 +0000
@@ -248,12 +248,12 @@
         if ( $user ne "" ) {
             $statusStr .= eval("qq{$Lang->{This_PC_is_used_by}$moreUserStr}");
         }
-        if ( defined($UserEmailInfo{$user}) && defined($UserEmailInfo{$user}{$host}) ) {
+        if ( defined($UserEmailInfo{$user}) && defined($UserEmailInfo{$user}{$host}) && defined($UserEmailInfo{$user}{$host}{lastSubj}) ) {
             my $mailTime = timeStamp2($UserEmailInfo{$user}{$host}{lastTime});
             my $subj     = $UserEmailInfo{$user}{$host}{lastSubj};
             $statusStr  .= eval("qq{$Lang->{Last_email_sent_to__was_at___subject}}");
         } elsif ( defined($UserEmailInfo{$user})
-                && $UserEmailInfo{$user}{lastHost} eq $host ) {
+                && $UserEmailInfo{$user}{lastHost} eq $host && defined($UserEmailInfo{$user}{lastSubj}) ) {
             #
             # Old format %UserEmailInfo - pre 3.2.0.
             #
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.