@@ -622,105 +622,105 @@ sub send_reports {
622
622
623
623
# legu la respondojn el $mail_send
624
624
if (-e $mail_send ) {
625
-
626
- $/ = $separator ;
627
- unless (open SMAIL, $mail_send ) {
628
- warn " Ne povis malfermi $mail_send : $! \n " ;
629
- return ;
630
- }
625
+
626
+ $/ = $separator ;
627
+ unless (open SMAIL, $mail_send ) {
628
+ warn " Ne povis malfermi $mail_send : $! \n " ;
629
+ return ;
630
+ }
631
631
632
- while (<SMAIL>) {
633
- # elprenu la sendinton
634
- if (s / ^sendinto: *([^\n ]+)\n // ) {
635
- $mail_addr = $1 ;
636
- # chu dosierojn sendu?
637
- if (s / ^dosieroj: *([^\n\s ]+)\n // ) {
638
- $dos = $1 ;
639
- if ($_ =~ / artikolo: *([^\n ]+)\n /s ) { $art_id = $1 ; }
640
- # foje jam malaperis la aldonenda dosiero pro antaŭa eraro, kio kaŭzus
641
- # senfinan sendadon de ĉiam la sama eraro..., do aldonu nur se la dosiero ekzistas
642
- if (-e $dos ) {
643
- $dosieroj {$mail_addr } .= " $dos $art_id |" ;
632
+ while (<SMAIL>) {
633
+ # elprenu la sendinton
634
+ if (s / ^sendinto: *([^\n ]+)\n // ) {
635
+ $mail_addr = $1 ;
636
+ # chu dosierojn sendu?
637
+ if (s / ^dosieroj: *([^\n\s ]+)\n // ) {
638
+ $dos = $1 ;
639
+ if ($_ =~ / artikolo: *([^\n ]+)\n /s ) { $art_id = $1 ; }
640
+ # foje jam malaperis la aldonenda dosiero pro antaŭa eraro, kio kaŭzus
641
+ # senfinan sendadon de ĉiam la sama eraro..., do aldonu nur se la dosiero ekzistas
642
+ if (-e $dos ) {
643
+ $dosieroj {$mail_addr } .= " $dos $art_id |" ;
644
+ }
644
645
}
646
+ $reports {$mail_addr } .= $_ ;
647
+ } else {
648
+ warn " Ne povis elpreni sendinton el $_ \n " ;
649
+ next ;
645
650
}
646
- $reports {$mail_addr } .= $_ ;
647
- } else {
648
- warn " Ne povis elpreni sendinton el $_ \n " ;
649
- next ;
650
- }
651
- }
652
- close SMAIL;
653
- $/ = $newline ;
654
-
655
- # forsendu la raportojn
656
- while (($mail_addr ,$message ) = each %reports ) {
657
- $dos = $dosieroj {$mail_addr };
658
- $mail_addr =~ s / .*<([a-z0-9\.\_\- @]+)>.*/ $1 / ;
659
-
660
- # preparu mesaghon
661
- $message = " Saluton!\n "
662
- ." Jen raporto pri via(j) sendita(j) artikolo(j).\n\n "
663
- .$separator .$message ." \n " .$signature ;
664
-
665
- $mail_handle = build MIME::Entity(Type => " multipart/mixed" ,
666
- From => $revo_from ,
667
- To => " $mail_addr " ,
668
- Subject => " $revoservo - raporto" );
669
-
670
- print " AL: <$mail_addr >: [[[\n $message \n ]]]\n " if ($verbose );
671
-
672
- $mail_handle -> attach(Type => " text/plain" ,
673
- Encoding => " quoted-printable" ,
674
- Data => $message );
675
-
676
- # alpendigu dosierojn
677
- if ($dos ) {
678
- for $file (split (/ \| / ,$dos )) {
679
- if ($file =~ / ^\s *([^\s ]+)\s +(.+?)\s *$ / ) {
680
- $file = $1 ;
681
- $art_id = $2 ;
682
-
683
- if ($art_id =~ / ^\044 ([^\044 ]+)\044 $ / ) {
684
- $art_id = $1 ;
685
- $art_id =~ / ^Id: ([^ ,\. ]+\. xml),v/ ;
686
- $marko = $1 ;
687
- } else {
688
- $marko =$art_id ;
651
+ }
652
+ close SMAIL;
653
+ $/ = $newline ;
654
+
655
+ # forsendu la raportojn
656
+ while (($mail_addr ,$message ) = each %reports ) {
657
+ $dos = $dosieroj {$mail_addr };
658
+ $mail_addr =~ s / .*<([a-z0-9\.\_\- @]+)>.*/ $1 / ;
659
+
660
+ # preparu mesaghon
661
+ $message = " Saluton!\n "
662
+ ." Jen raporto pri via(j) sendita(j) artikolo(j).\n\n "
663
+ .$separator .$message ." \n " .$signature ;
664
+
665
+ $mail_handle = build MIME::Entity(Type => " multipart/mixed" ,
666
+ From => $revo_from ,
667
+ To => " $mail_addr " ,
668
+ Subject => " $revoservo - raporto" );
669
+
670
+ print " AL: <$mail_addr >: [[[\n $message \n ]]]\n " if ($verbose );
671
+
672
+ $mail_handle -> attach(Type => " text/plain" ,
673
+ Encoding => " quoted-printable" ,
674
+ Data => $message );
675
+
676
+ # alpendigu dosierojn
677
+ if ($dos ) {
678
+ for $file (split (/ \| / ,$dos )) {
679
+ if ($file =~ / ^\s *([^\s ]+)\s +(.+?)\s *$ / ) {
680
+ $file = $1 ;
681
+ $art_id = $2 ;
682
+
683
+ if ($art_id =~ / ^\044 ([^\044 ]+)\044 $ / ) {
684
+ $art_id = $1 ;
685
+ $art_id =~ / ^Id: ([^ ,\. ]+\. xml),v/ ;
686
+ $marko = $1 ;
687
+ } else {
688
+ $marko =$art_id ;
689
+ }
690
+ } else { $art_id = $file ; $marko =$file ; }
691
+
692
+ print " attach: $file \n " if ($debug );
693
+ if (-e $file ) {
694
+ $mail_handle -> attach(Path => $file ,
695
+ Type => ' text/plain' ,
696
+ Encoding => ' quoted-printable' ,
697
+ Disposition => ' attachment' ,
698
+ Filename => $marko ,
699
+ Description => $art_id );
689
700
}
690
- } else { $art_id = $file ; $marko =$file ; }
691
-
692
- print " attach: $file \n " if ($debug );
693
- if (-e $file ) {
694
- $mail_handle -> attach(Path => $file ,
695
- Type => ' text/plain' ,
696
- Encoding => ' quoted-printable' ,
697
- Disposition => ' attachment' ,
698
- Filename => $marko ,
699
- Description => $art_id );
700
701
}
701
702
}
702
- }
703
-
704
- # forsendu
705
- print " sendi nun...\n " if ($verbose );
706
- # # unless (open SENDMAIL, "| $sendmail '$mail_addr'") {
707
- # # warn "Ne povas dukti al $sendmail: $!\n";
708
- # # next;
709
- # # }
710
- # # $mail_handle->print(\*SENDMAIL);
711
- # # close SENDMAIL;
712
-
713
- # forsendu
714
- unless (mailsender::smtp_send($mailer ,$revo_from ,$mail_addr ,$mail_handle )) {
715
- $log -> warn (" Ne povas forsendi retpoŝtan raporton!\n " );
716
- next ;
717
- }
703
+
704
+ # forsendu
705
+ print " sendi nun...\n " if ($verbose );
706
+ # # unless (open SENDMAIL, "| $sendmail '$mail_addr'") {
707
+ # # warn "Ne povas dukti al $sendmail: $!\n";
708
+ # # next;
709
+ # # }
710
+ # # $mail_handle->print(\*SENDMAIL);
711
+ # # close SENDMAIL;
712
+
713
+ # forsendu
714
+ unless (mailsender::smtp_send($mailer ,$revo_from ,$mail_addr ,$mail_handle )) {
715
+ $log -> warn (" Ne povas forsendi retpoŝtan raporton!\n " );
716
+ next ;
717
+ }
718
718
719
- }
719
+ } # while
720
720
721
721
# forigu $mail_send
722
722
# unlink($mail_send);
723
- }
723
+ } # if
724
724
}
725
725
726
726
0 commit comments