Changeset 477 for devel/pb/bin/pb


Ignore:
Timestamp:
Jun 5, 2008, 1:03:08 AM (12 years ago)
Author:
Bruno Cornec
Message:

use Mail::Sendmail instead of mutt to deliver mail (From: header issue)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r473 r477  
    2929use ProjectBuilder::Changelog;
    3030
     31# For announce only
    3132use DBI;
     33use Mail::Sendmail;
    3234
    3335# Global variables
     
    17161718
    17171719    # Get all required parameters
    1718     my ($pbpackager,$pbrepo,$pbml) = pb_conf_get("pbpackager","pbrepo","pbml");
     1720    my ($pbpackager,$pbrepo,$pbml,$pbsmtp) = pb_conf_get("pbpackager","pbrepo","pbml","pbsmtp");
    17191721    my ($pkgv, $pkgt, $testver) = pb_conf_get_if("pkgver","pkgtag","testver");
    17201722    my $pkg = pb_cms_get_pkg($defpkgdir,$extpkgdir);
     
    18791881    close(ML);
    18801882
    1881     pb_system("export EMAIL=\'$pbpackager->{$ENV{'PBPROJ'}}\' ; mutt -s \"ANNOUNCE: Project $ENV{'PBPROJ'} version $ENV{'PBPROJVER'} is now available\" $pbml->{$ENV{'PBPROJ'}} < $ENV{'PBTMP'}/announce.txt","Mailing announce to $pbml->{$ENV{'PBPROJ'}}");
     1883    # To read whole file
     1884    local $/;
     1885    open(ANN,"$ENV{'PBTMP'}/announce.txt") || die "Unable to read $ENV{'PBTMP'}/announce.txt: $!";
     1886    my $msg = <ANN>;
     1887    close(ANN);
     1888   
     1889    # Preparation of headers
     1890
     1891    my %mail = (   
     1892            To          =>  $pbml->{$ENV{'PBPROJ'}},
     1893            From        =>  $pbpackager->{$ENV{'PBPROJ'}},
     1894            Smtp        =>  $pbsmtp->{$ENV{'PBPROJ'}},
     1895            Body        =>  $msg,
     1896            Subject     =>  "ANNOUNCE: Project $ENV{'PBPROJ'} version $ENV{'PBPROJVER'} is now available",
     1897        );
     1898           
     1899    # Send mail
     1900    sendmail(%mail) or die "Unable to send mail ($Mail::Sendmail::error): $Mail::Sendmail::log";
    18821901}
    18831902
Note: See TracChangeset for help on using the changeset viewer.