#30613 Can't Send E-mail (Additional fixes for upgrade)
authorJonathan Prykop <jonathan@freeside.biz>
Sat, 31 Jan 2015 06:27:01 +0000 (00:27 -0600)
committerJonathan Prykop <jonathan@freeside.biz>
Mon, 2 Feb 2015 21:09:17 +0000 (15:09 -0600)
FS/FS/Upgrade.pm

index 9187cab..3146222 100644 (file)
@@ -70,7 +70,7 @@ sub upgrade_config {
 
   upgrade_invoice_from($conf);
   foreach my $agent (@agents) {
-    upgrade_invoice_from($conf,$agent->agentnum);
+    upgrade_invoice_from($conf,$agent->agentnum,1);
   }
 
   my $DIST_CONF = '/usr/local/etc/freeside/default_conf/';#DIST_CONF in Makefile
@@ -167,10 +167,10 @@ sub upgrade_overlimit_groups {
 }
 
 sub upgrade_invoice_from {
-  my ($conf, $agentnum) = @_;
+  my ($conf, $agentnum, $agentonly) = @_;
   if (
-      (!$conf->config('invoice_from_name',$agentnum)) && 
-      ($conf->config('invoice_from',$agentnum) =~ /\<(.*)\>/)
+      (!$conf->exists('invoice_from_name',$agentnum,$agentonly)) && 
+      ($conf->config('invoice_from',$agentnum,$agentonly) =~ /\<(.*)\>/)
   ) {
     my $realemail = $1;
     $realemail =~ s/^\s*//; # remove leading spaces