WSGetmail / rt-mailgate throwing "uninitialized value" error

Setting up a new RT5 instance, first time using it. Been going OK so far but run into an issue with email queues. Well less an issue and more a quirk I want to follow up with in case it becomes an issue.

I’m using WSGetmail to pick tickets out of an O365 mailbox, running the version from github

Works fine, here’s my config:

{

    "client_id": "{{ ms_client_id }}",

    "tenant_id": "{{ ms_tenant_id }}",

    "secret": "{{ ms_secret }}",

    "global_access": 1,

    "username": "{{ ms_mailbox }}",

    "folder": "{{ ms_folder }}",

    "command": "/opt/rt5/bin/rt-mailgate",

    "command_args": "--url=https://{{ server_url }} --queue=Support --action=correspond",

    "action_on_fetched": "{{ ms_action }}"

}

And the job actually kicking the mail collection off runs the following:

/usr/local/bin/wsgetmail --config=/opt/rt5/etc/wsgetmail.json

However I’ve noticed during testing (i.e. when running from the command line) I get the following notice with every single mail.

Use of uninitialized value in addition (+) at /usr/local/share/perl/5.32.1/App/wsgetmail/MDA.pm line 188.

Things go through OK, but I’m trying to figure out what value requires initialisation that I’ve missed. Verbose output doesn’t provide any other information about it and checking out MDA.pm hasn’t helped, though here it is for reference:

my $ok = run ([ $self->command, _split_command_args($self->command_args, 1)], $fh, \$output, \$error, timeout( $self->command_timeout + 5 ) );

I’ve tried adjusting things so that every possible value for rt-mailgate is passed through. Still works, but the error remains.

Any ideas?

I don’t use this tool, so this is shooting in the dark a bit, but could you add a line to your config for command_timeout? Even if you just set it to 0.

1 Like

Hah, well done! I was about to say no I already tried that, as rt-mailgate has a timeout option and I made sure to pass it though and see if that resolved it. Then I realised you meant the wsconfig file and that did the trick. Working file for anyone else who makes their way here:

{
    "client_id": "{{ ms_client_id }}",
    "tenant_id": "{{ ms_tenant_id }}",
    "secret": "{{ ms_secret }}",
    "global_access": 1,
    "username": "{{ ms_mailbox }}",
    "folder": "{{ ms_folder }}",
    "command": "/opt/rt5/bin/rt-mailgate",
    "command_args": "--url=https://{{ server_url }} --queue=Support --action=correspond",
    "command_timeout": 0,
    "action_on_fetched": "{{ ms_action }}"
}

Never thought to try that as command_timeout isn’t documented anywhere in the wsconfig, I assume you made the guess based off the reference in the line of code on line 188 of MDA.pm?

Yep - educated guesstimate! :slight_smile:

Glad that work for you though. :+1:

1 Like

Well very much appreciated guessing!

I emailed the modules team and linked them to this post so they can fix the bug/document the option. Thanks again!

1 Like

Hi all. We’ve released a new version, 0.06, to fix this issue.

1 Like