Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Family list creation / missing listname parameter #815

Closed
BrunoMalaval opened this issue Nov 27, 2019 · 6 comments · Fixed by #816
Closed

Family list creation / missing listname parameter #815

BrunoMalaval opened this issue Nov 27, 2019 · 6 comments · Fixed by #816
Labels
bug ready A PR is waiting to be merged. Close to be solved
Milestone

Comments

@BrunoMalaval
Copy link

Version

6.2.49b.1

Installation method

Source Package

Expected behavior

Create list using family or default template

Actual behavior

I try to create list with sympa.pl script, instantiate it by family list or with default template
As a family list, my xml file look like this :
(private data are replace by XXX )

<?xml version="1.0" ?>
  <list>
    <listname>1liai1-1-s1-in-1</listname>
    <subject>FST Licence 1e annee Informatique-groupe 1</subject>
    <owner multiple="1">
      <email>admin.etulistes@uha.fr</email>
      <gecos>Administrateur listes etudiants</gecos>
    </owner>
    <ldap>
      <host>XXX</host>
      <user>XXX</user>
      <passwd>XXX</passwd>
      <use_ssl>yes</use_ssl>
      <ssl_version>sslv3</ssl_version>
      <suffix1>ou=groups,dc=uha,dc=fr</suffix1>
      <timeout1>30</timeout1>
      <attrs1>member</attrs1>
      <filter1>(uhaGroupeMail=1LIAI1-1-S1-IN-1@uha.fr)</filter1>
      <scope1>sub</scope1>
      <select1>all</select1>
      <suffix2>[attrs1]</suffix2>
      <timeout2>30</timeout2>
      <attrs2>mail</attrs2>
      <filter2>(mail=*)</filter2>
      <scope2>sub</scope2>
      <select2>first</select2>
    </ldap>
    <topics>fst/etulistes</topics>
  </list>

command line use

/usr/local/sympa/bin/sympa.pl --add_list etu_gr_collaboratif  --robot uha.fr --input_file /usr/local/sympa/etc/families/etu_gr_collaboratif/1liai1-1-s1-in-1.xml

1liai1-1-s1-in-1.xml is the xml file above

I get

Use of uninitialized value in lc at /usr/local/sympa/bin/Sympa/Request/Handler/create_automatic_list.pm line 75.
create_automatic_list [user] Vous devez fournir le nom de la liste
Impossible to add a list to the family etu_gr_collaboratif

In ../sympa/bin/Sympa/Request/Handler/create_automatic_list.pm
I've make a dump of $param just before line 75

75    my $listname = lc $param->{listname};

Result : no listname in $params

$VAR1 = {
          'editor' => [],
          'owner' => [
                     {
                       'gecos' => 'Administrateur listes etudiants',
                       'email' => 'admin.etulistes@uha.fr'
                     }
                   ],
          'topics' => 'fst/etulistes',
          'subject' => 'FST Licence 1e annee Informatique-groupe 1',
          'ldap' => {
                    'filter1' => '(uhaGroupeMail=1LIAI1-1-S1-IN-1@uha.fr)',
                    'host' => 'XXX',
                    'filter2' => '(mail=*)',
                    'attrs1' => 'member',
                    'suffix1' => 'ou=groups,dc=uha,dc=fr',
                    'select1' => 'all',
                    'passwd' => 'XXX',
                    'attrs2' => 'mail',
                    'timeout1' => '30',
                    'scope2' => 'sub',
                    'use_ssl' => 'yes',
                    'scope1' => 'sub',
                    'suffix2' => '[attrs1]',
                    'user' => 'XXX',
                    'ssl_version' => 'sslv3',
                    'select2' => 'first',
                    'timeout2' => '30'
                  }
        };

Additional information

If I try with a simple xml file and use a default list type

/usr/local/sympa/bin/sympa.pl --create_list --robot=uha.fr --input_file=/tmp/di-test-xml.xml

I get

create_list [user] XXX
Missing argument in printf at /usr/local/sympa/bin/sympa.pl line 731.
Could not create list

I think the listname should appear after Could not create list

xml file in this case look like this

<?xml version="1.0" ?>
  <list>
    <listname>di-test-xml</listname>
    <type>intranet_list</type>
    <subject>test-etc</subject>
    <owner multiple="1">
      <email>bruno.malaval@uha.fr</email>
    </owner>
  </list>

That's all for me today ..
Thanks a lot

@ikedas
Copy link
Member

ikedas commented Nov 28, 2019

Hi @BrunoMalaval,
Could you please apply this patch and check if the problem you repoted will be solved?

@ikedas ikedas added bug ready A PR is waiting to be merged. Close to be solved labels Nov 28, 2019
@ikedas ikedas added this to the 6.2.50 milestone Nov 28, 2019
@BrunoMalaval
Copy link
Author

HI @ikedas

  • It works fine for family list creation.

  • Error (missing parameter) if fixed for sympa.pl

But another error when I try to create list without family template (my second sample in first post)

root@lists-diff:/usr/local/sympa/etc# /usr/local/sympa/bin/sympa.pl --create_list  --robot=lists-diff.uha.fr --input_file=/tmp/di-test-xml.xml
create_list [user] template : paramètre manquant
Could not create list

In Sympa documentation, it indicates the tag <type> .. </type> is the name of the template
In my sample, I use the default template intranet_list which is in .../sympa/default/create_list_templates

But perhaps my method or xml file are not good, I don't often use it.
I'm gonna make more tests for this point

Thanks

@ikedas
Copy link
Member

ikedas commented Nov 28, 2019

@BrunoMalaval, could you please show the XML file ('/tmp/di-test-xml.xml') in this case?

@BrunoMalaval
Copy link
Author

It was in the first post
Here's the file

<?xml version="1.0" ?>
  <list>
    <listname>di-test-xml</listname>
    <type>intranet_list</type>
    <subject>test-etc</subject>
    <owner multiple="1">
      <email>bruno.malaval@uha.fr</email>
    </owner>
  </list>

@ikedas
Copy link
Member

ikedas commented Nov 28, 2019

@BrunoMalaval, thanks for information.
Could you please apply this additional patch and check if the problem will be solved?

@BrunoMalaval
Copy link
Author

BrunoMalaval commented Nov 28, 2019

It works.
Just need to add <topics> parameter in the xml file, it's mandatory.
And CLI creation works

Thanks a lot
Going to resume tests .....

ikedas added a commit that referenced this issue Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready A PR is waiting to be merged. Close to be solved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants