Skip to Content.
Sympa Menu

en - Re: [sympa-users] _include_users_remote_file deprecated in 6.2.45.b2

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: "Stefan Hornburg (Racke)" <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-users] _include_users_remote_file deprecated in 6.2.45.b2
  • Date: Fri, 20 Sep 2019 11:04:37 +0200

On 9/20/19 10:47 AM, DSI Gestionnaire de Listes wrote:
> Hi Ikeda,
>
>  
>
> On SYMPA 6.2.22 we used to modify the function _include_users_remote_file
> in List.pm to force some DataSource to use a
> proxy, here is the code :
>
>  
>
> sub _include_users_remote_file {
>
>     my ($users, $param, $default_user_options, $tied) = @_;
>
>  
>
>     my $url = $param->{'url'};
>
>  
>
>     $log->syslog('debug', '(%s)', $url);
>
>  
>
>     my $total = 0;
>
>     my $id    = Sympa::Datasource::_get_datasource_id($param);
>
>  
>
>     my $fetch =
>
>         LWP::UserAgent->new(agent => 'Sympa/' . Sympa::Constants::VERSION);
>
>  
>
>     #if ($url =~ /sympa\.core-admins\.net/) {
>
>     #    $fetch->proxy('http', 'http://t3hpsquid.users.interne:3128');
>
>     #}
>
>     if ($url =~ /neuro-psi\.cnrs\.fr/) {
>
>          $fetch->proxy('http', 'http://t3hpsquid.users.interne:3128');
>
>     }
>
>     if ($url =~ /somlit-db\.epoc\.u-bordeaux1\.fr/) {
>
>          $fetch->proxy('http', 'http://t3hpsquid.users.interne:3128');
>
>     }
>
>     if ($url =~ /dev\.eai\.webcontrat\.cnrs\.fr/) {
>
>          $fetch->proxy('http', 'http://t3hpsquid.users.interne:3128');
>
>     }
>
>  
>
>     my $req = HTTP::Request->new(GET => $url);
>
>  
>
>     if (defined $param->{'user'} && defined $param->{'passwd'}) {
>
>         $req->authorization_basic($param->{'user'}, $param->{'passwd'});
>
>    }
>
>  
>
>     my $res = $fetch->request($req);
>
>  
>
>     # check the outcome
>
>     if ($res->is_success) {
>
>         my @remote_file  = split(/\n/, $res->content);
>
>         my $lines        = 0;
>
>         my $emails_found = 0;
>
>         my $email_regexp = Sympa::Regexps::email();
>
> …/…
>
>  
>
> This function is deprecated in 6.2.45.b2 and the synchronization does not
> work anymore since we cannot modify List.pm.
>
> How can we do to force the use of a proxy for http (and only http)
> Datasource in 6.2.45.b2 ?
>

Hello Jean,

you can try to set the corresponding environment variable:

https://metacpan.org/pod/LWP::UserAgent#env_proxy

Regards
Racke

>  
>
> Cordialement,
>
> Jean THOMAS
>
> Listmaster
>
> CNRS / DSI
>
> address@concealed
>
>  
>


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.19+.

Top of Page