/mail doesn't send "You've got mail!" message.

Issue #372 resolved
Anna Bakker created an issue

When receiving a /mail while ingame it should say "You've got mail!" but instead just puts a blank line into the player's chat.

Comments (9)

  1. Anna Bakker reporter

    Probably related, a message from a different pearl script: Can't locate execconfig.pm in @INC (you may need to install the execconfig module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./exec_speakas.pl line 12. BEGIN failed--compilation aborted at ./exec_speakas.pl line 12.

    Seems a file called execconfig.pm is missing somewhere

  2. Evan Markowitz

    It isn't related to the execconfig.pm file, rather, it appears that it is a line wrapping problem. The message is being sent in two lines:

    [REMOTE] [localhost:39645] Data: sendmsgtoplayer techkid6
     You've got mail! Use /mail to read it.
    [SERVER] 2017-04-26 01:12:17 [INFO] [exec] Message to player techkid6 succesfully sent.
    [SERVER] 2017-04-26 01:12:17 [INFO] Unknown command. Try /help for a list of commands
    
  3. Riot

    The relevant code is

    my $execreturn = `/home/minecraft/remoteclient01a.py "sendmsgtoplayer $recipient You've got mail! Use /mail to read it."`;
    

    in exec_privatemail.pl.

    The problem appears to be that $recipient is given a newline at the end.

    Looking at more of the code, the sanitizeandfindrecipient function that generates that value looks in firstjoin files to try to match a player and everything, it's a bit of a mess and not very futureproof with uuids coming in, etc. Whole thing needs to be rewritten really.

  4. Anna Bakker reporter

    Looking at the sanitizeandfindrecipient function...

    #We let the shell solve this puzzle. And as soon as riot sees
    #this line he will have at least 10 ideas in how to solve this faster ;)
    
  5. Riot

    you could, but it might help to have a clue in using perl to modify this without introducing potential code execution vulnerabilities from player messages... which I personally lack, so cannot advise on

  6. Alexandra Stehr

    $recipientname is already sanitized in line 1068, only letters and numbers come trough that regex. If get_correctname.sh returns a correct name on a single output line then simply delete 1080 and change 1084 to

    my $recipient = `/home/minecraft/get_correctname.sh "$recipientname"`;
    

    and call it a day.

    That whole script would need a rewrite anyway, the parcel thing isn't supporting NBT items for one thing. And i still dislike the idea of using the filesystem as a database. :)

  7. Log in to comment