Changeset 1994

Show
Ignore:
Timestamp:
12/08/07 14:25:33
Author:
tokuhirom
Message:

Plugin::Publish::Gmail: support higher version of MIME::Lite. thanks poppen++
http://www.karashi.org/~poppen/d/20070921.html

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Publish/Gmail.pm

    r1904 r1994  
    212212*MIME::Lite::send_by_smtp_tls = sub { 
    213213    my($self, @args) = @_; 
     214    my $extract_addrs_ref = 
     215        defined &MIME::Lite::extract_addrs 
     216        ? \&MIME::Lite::extract_addrs 
     217        : \&MIME::Lite::extract_full_addrs; 
    214218 
    215219    ### We need the "From:" and "To:" headers to pass to the SMTP mailer: 
    216220    my $hdr   = $self->fields(); 
    217     my($from) = MIME::Lite::extract_addrs( $self->get('From') ); 
     221    my($from) = $extract_addrs_ref->( $self->get('From') ); 
    218222    my $to    = $self->get('To'); 
    219223 
     
    222226 
    223227    ### Get the destinations as a simple array of addresses: 
    224     my @to_all = MIME::Lite::extract_addrs($to); 
     228    my @to_all = $extract_addrs_ref->($to); 
    225229    if ($MIME::Lite::AUTO_CC) { 
    226230        foreach my $field (qw(Cc Bcc)) { 
    227231            my $value = $self->get($field); 
    228             push @to_all, MIME::Lite::extract_addrs($value) if defined($value); 
     232            push @to_all, $extract_addrs_ref->($value) if defined($value); 
    229233        } 
    230234    }