Giter Club home page Giter Club logo

mail's Introduction

Mail mod for Minetest (ingame mod)

ContentDB

This is a fork of @cheapie's mail mod.

It adds a mail-system that allows players to send each other messages in-game and via webmail (optional).

Screenshot

Installation

In-game mail mod

Install it like any other mod: copy the directory mail_mod to your "worldmods" folder or use the ContentDB

Webmail

To provide a web-based interface to receive/send mails you can use the mtui project.

Commands/Howto

To access your mail type /mail command or click on the mail button in your inventory (unified_inventory).

Mails can be deleted, marked as read or unread, replied to and forwarded to another player. You can also manage your contacts and your mailing lists.

Features

  • Inbox page
  • Outbox page
  • Saved drafts
  • Read/unread marks
  • To/Cc/Bcc system
  • Intuitive UI
  • Contacts book
  • Mailing lists
  • Sorters/filters (new in 1.1.0)
  • Multiple selection (new in 1.1.0)
  • Settings
  • Chat, on join, HUD and sound notifications
  • Translated in : English, French, German, Chinese (both traditional and simplified), Spanish, Brazilian Portuguese.

Compatibility / Migration

Overview:

  • v1 all the data is in the <worldfolder>/mails.db file
  • v2 every player has its own (in-) mailbox in the <worldfolder>/mails/<playername>.json file
  • v3 every player has an entry in the <playername> mod_storage/ (inbox, outbox, drafts, contacts, mailing lists, settings)

Dependencies

  • None

License

See the "LICENSE" file

Textures

Contributors / Credits

  • Cheapie (Initial idea/project)
  • Rubenwardy (Lua/UI improvements)
  • BuckarooBanzay (Clean-ups, Refactoring)
  • Athozus (Outbox, Maillists, UI, Drafts, Trash, Settings)
  • SX (Various fixes, UI)
  • fluxionary (Minor fixups)
  • Toby1710 (UX fixes)
  • Peter Nerlich (CC, BCC)
  • Emojigit (Traditional Chinese translation)
  • Niklp09 (German translation)
  • Dennis Jenkins (UX fixes)
  • Thomas Rudin (Maintenance)
  • imre84 (UI fixes)
  • Chache (Spanish translation)
  • APercy (Brazilian Portuguese translation)
  • Nuno Filipe Povoa (mail_notif.ogg - https://invent.kde.org/plasma/oxygen-sounds/-/blob/master/sounds/Oxygen-Im-Nudge.ogg)
  • TheTrueBeginner (Simplified Chinese translation)
  • nyomi (Hungarian translation)
  • whosit (UI fixes)
  • Wuzzy (German translation)
  • Muhammad Rifqi Priyo Susanto (Indonesian translation)

Contribute

You can contribute by :

  • Reporting an issue : Go to the Issues tab, click on the button New issue and type a short title then give many informations (Minetest version, tab where the bug occured, steps to reproduce the crash, etc.)
  • Give a review on ContentDB : Just write ;)
  • Requesting new features : Open an issue and indicate what you need more in details.
  • Adding those new features : Open a pull request, and if issue(s) are linked, ping them (#number).
  • Fixing an issue : Same as before, open a pull request.
  • Translate into a new language : copy locale/template.txt into locale/mail.<codelang>.tr, and add translated strings (syntax : not translated=translated). Then, open a pull request. We're also working on opening a Weblate (free web interface) to translate strings easier.
  • Add documentation : adds .md (markdown) or .txt files and open a pull request.
  • ...

You're encouraged to create a fork of this repo, then make your changes and create a pull request when it's done. If you do so, please also check "Git branches" section. (obsolete). Request for merging into master, if needed we will push into another branch.

If you don't have a GitHub account, you can also contact maintainers to add manually your contributions.

Git branches

Caution : might be obsolete

  • master : main branch, where are pushed releases and tags
  • dev : for new release works, A.B.C release to A.B+1.0
  • A.B.X : for fix releases (no new features), A.B.C release to A.B.C+1

For a new fix release (A.B.C) : merge A.B.X branch to master For a new release (A.B+1.0) : merge dev to master, with previous A.B.C merges (include fixes in master, prioritize dev branch in case of conflicts)

Old/Historic stuff

mail's People

Contributors

athozus avatar brownhedgehog78 avatar buckaroobanzay avatar dennisjenkins75 avatar emojigit avatar fluxionary avatar imre84 avatar naturefreshmilk avatar niklp09 avatar nonfreegithub avatar ogelgames avatar panquesito7 avatar peternerlich avatar s-s-x avatar savilli avatar singularis-mzf avatar srifqi avatar wuzzy2 avatar y5nw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mail's Issues

Acknowledges

Should be good to get a check mark or something like that to be sure that your receivers has received and read the mail.

Public mailing lists

Add the ability to create public mailing lists where the players themself register to it, eg. most of irl mailing lists.

more crashes

supposedly the two following are when clicking "reply" and "reply all" with no message selected, but i can't replicate the issue:

2023-04-25 21:22:02: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: attempt to index local 'message' (a nil value)
2023-04-25 21:22:02: ERROR[Main]: stack traceback:
2023-04-25 21:22:02: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: in function 'replyall'
2023-04-25 21:22:02: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:207: in function 'func'
2023-04-25 21:22:02: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-25 21:22:02: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>
2023-04-25 21:45:06: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: attempt to index local 'message' (a nil value)
2023-04-25 21:45:06: ERROR[Main]: stack traceback:
2023-04-25 21:45:06: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: in function 'reply'
2023-04-25 21:45:06: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:198: in function 'func'
2023-04-25 21:45:06: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-25 21:45:06: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

the following happens when clicking "read" with no message selected:

...t/bin/../worlds/basic_test/worldmods/mail/ui/message.lua:30: attempt to index local 'message' (a nil value)
stack traceback:
	...t/bin/../worlds/basic_test/worldmods/mail/ui/message.lua:30: in function 'show_message'
	...st/bin/../worlds/basic_test/worldmods/mail/ui/events.lua:169: in function 'func'
	/opt/minetest/bin/../builtin/profiler/instrumentation.lua:108: in function </opt/minetest/bin/../builtin/profiler/instrumentation.lua:101>
	/opt/minetest/bin/../builtin/game/register.lua:448: in function </opt/minetest/bin/../builtin/game/register.lua:434>

crash Forward without mail selected

Sorry if we throw you dead with issues right now, but testing is our way to appreciate the effort you put into it ;)

Repro:

  1. Write yourself a mail or have one in the inbox
  2. delete it
  3. push the forward button

Attempt1:

2023-05-01 19:43:20: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"delete":"L\u00f6schen","filter":"","sortdirection":"1","sortfield":"2"}
2023-05-01 19:43:20: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"delete":"L\u00f6schen","filter":"","sortdirection":"1","sortfield":"2"}
2023-05-01 19:43:20: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"delete":"L\u00f6schen","filter":"","sortdirection":"1","sortfield":"2"}
2023-05-01 19:43:21: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"filter":"","forward":"Weiter","sortdirection":"1","sortfield":"2"}
2023-05-01 19:43:21: ACTION[Main]: Server: Shutting down
2023-05-01 19:43:23: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:83: attempt to index local 'message' (a nil value)
2023-05-01 19:43:23: ERROR[Main]: stack traceback:
2023-05-01 19:43:23: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:83: in function 'forward'
2023-05-01 19:43:23: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:220: in function 'func'
2023-05-01 19:43:23: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-05-01 19:43:23: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

Attempt2:

2023-05-01 19:47:43: ACTION[Server]: [yl_commons] formspec "mail:compose": Boris submitted {"bcc":"","body":"asdasd","cc":"","send":"Senden","subject":"asdasd","to":"Boris"}
2023-05-01 19:47:43: ACTION[Server]: [mail] "Boris" send mail to "Boris" (CC:  - BCC: ) with subject "asdasd" and body "asdasd"
2023-05-01 19:47:46: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"filter":"","forward":"Weiter","sortdirection":"1","sortfield":"1"}
2023-05-01 19:47:47: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"filter":"","inbox":"CHG:2:3","sortdirection":"1","sortfield":"1"}
2023-05-01 19:47:49: ACTION[Server]: [yl_commons] lua is using 342.5 MB
2023-05-01 19:47:49: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"delete":"L\u00f6schen","filter":"","sortdirection":"1","sortfield":"1"}
2023-05-01 19:47:52: ACTION[Server]: [yl_commons] formspec "mail:inbox": Boris submitted {"filter":"","forward":"Weiter","sortdirection":"1","sortfield":"1"}
2023-05-01 19:47:52: ACTION[Main]: Server: Shutting down
2023-05-01 19:47:53: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:83: attempt to index local 'message' (a nil value)
2023-05-01 19:47:53: ERROR[Main]: stack traceback:
2023-05-01 19:47:53: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:83: in function 'forward'
2023-05-01 19:47:53: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:220: in function 'func'
2023-05-01 19:47:53: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-05-01 19:47:53: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

For my reference: 4376

Message filters/sorters

Add the ability to :

  1. Sort inbox messages by author
  2. Sort inbox/outbox messages by subject name (A->Z or Z->A)
  3. Sort inbox/outbox messages by sending date (most recent <-> oldest)
  4. Filter messages by author/receiver/subject name(s)
  5. Filter messages by date gap (from dd mm YYYY to dd' mm' YYYY')

Update issue

To be moved at each new version in the milestone to update list of contributors, version and screenshot in Readme/about page.

Message selecting crash

i'm not sure what triggered this.

running 02853fc, though it doesn't look like the commits since would affect this.

2023-05-28 21:04:03: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...t/5.6.1/Minetest_live/bin/../mods/mail_mod/ui/events.lua:85: attempt to index a nil value
2023-05-28 21:04:03: ERROR[Main]: stack traceback:
2023-05-28 21:04:03: ERROR[Main]: 	...t/5.6.1/Minetest_live/bin/../mods/mail_mod/ui/events.lua:85: in function 'func'
2023-05-28 21:04:03: ERROR[Main]: 	...inetest_live/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2023-05-28 21:04:03: ERROR[Main]: 	.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_live/bin/../builtin/game/register.lua:417>

Reply to message pulls a different message than the one selected

Hitting reply includes the subject and message text of a different message than the one you're actually replying to... it appears to be related to how many messages are in the list, could be 8 or 10, 11, 12 messages down from the one selected. It also appears to do the same thing if you delete a message while you're reading it, it deletes a different message. Deleting a message from a message list window works properly (I think).

Also, the Close button doesn't work, I have to hit Esc to exit the mail system.

Thanks!

Issues with new message notifications and deleting messages

Hi,

Great mod, love the changes! But one of the recent commits (I think it was the big one - commit b3e0c15 but I'm not completely certain), appears to have broken email notifications. If I get a new message while I am online, I see the notification in the chat (but no yellow envelope in the center of the screen as before). But there is no notification of new messages if a new message is received while I am offline - when I re-join, I have to open my mail to see if any new messages were received.

Also, I sent myself a test message to verify this behavior and discovered that I couldn't delete it, it remains in my inbox.

Sever is 5.6.1 - if there is any additional information that I can provide to help in troubleshooting, please let me know. I see no error messages related to any of this activity in the standard server log.

Many thanks for all of your hard work on this mod.

- Phil

mail_mod/ui/events.lua:71: attempt to index a nil value

When a user clicks any of the column headers, the server crashes.

2023-04-14 21:54:06: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:71: attempt to index a nil value
2023-04-14 21:54:06: ERROR[Main]: stack traceback:
2023-04-14 21:54:06: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:71: in function 'func'
2023-04-14 21:54:06: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-14 21:54:06: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>
2023-04-14 23:20:19: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:71: attempt to index a nil value
2023-04-14 23:20:19: ERROR[Main]: stack traceback:
2023-04-14 23:20:19: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:71: in function 'func'
2023-04-14 23:20:19: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-14 23:20:19: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

image

For my reference 4198

Optimize with OOP

Rewrite the whole code using OOP, to optimize performances (reduce lags, etc).

message.lua:48: attempt to index local 'message' (a nil value)

This happened with current master (a863225), however it happened by accident and I cannot reproduce it from user perspective. Maybe you have better insight in what I did.

2023-05-02 22:20:51: ACTION[Server]: [yl_commons] formspec "mail:inbox": AliasAlreadyTaken submitted {"filter":"","inbox":"CHG:2:0","sortdirection":"1","sortfield":"3"}
2023-05-02 22:20:51: ACTION[Server]: [yl_commons] formspec "mail:inbox": AliasAlreadyTaken submitted {"filter":"","inbox":"DCL:2:0","sortdirection":"1","sortfield":"3"}
2023-05-02 22:20:52: ACTION[Server]: [yl_commons] formspec "mail:message": AliasAlreadyTaken submitted {"reply":"Antworten"}
2023-05-02 22:20:52: ACTION[Main]: Server: Shutting down
2023-05-02 22:20:54: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: attempt to index local 'message' (a nil value)
2023-05-02 22:20:54: ERROR[Main]: stack traceback:
2023-05-02 22:20:54: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: in function 'reply'
2023-05-02 22:20:54: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:105: in function 'func'
2023-05-02 22:20:54: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-05-02 22:20:54: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

For my reference 4383

Feature request "View sent mails"

Could there be a 'Sent' list to view your sent messages?

Current workaround is to always CC yourself, which is inconvenient and people keep forgetting

For my reference #392

Fix blank messages

Check if :

  • There are receivers
  • Mailing lists are existing
  • Mailing lists contain something
  • There is a subject
  • There is a body

screenshot_20230402_174410

The Forward button doesn't forward the text, when pressed in the single mail formspec.

Repro:

  1. Receive a mail
  2. Open it by clicking Read

You see the header, the mail and below some buttons: reply, reply all, forward and delete

  1. Click forward

Only "Type your message here and --Original message follows-- remains as text in the formspec, but not the original message

Additional:

The forward button when pressed from the list formspec works as expected

Add settings

  • Receive notifications
  • Show unread messages in different color
  • Show cc/bcc messages in different color
  • S-S-X Suggestions
  • Message deletion behavior #38
  • Fields shown in message lists
  • Default sorting field and default sort direction
  • Sounds / other notifications?
  • New settings proposals
  • Enable HUD

[bug] mail_mod can be used to create mailboxes for invalid player names

The mail_mod does not appear to properly sanitize the "CC" or "BCC" (or possible even the "TO" fields. It will happily attempt to create a json file with the contents of the "CC" field (tokenized on the comma).

Ex: Send an email to another player, but set the "CC" field to "foo, ^^", and the mail dir on the server will now contain a file called ^^.json.

Thankfully, attempts to escape the mails directory via using "../test" did not work; the test.json file stayed in the mails directory.

IMHO, mail delivery to non-existent player names should fail, and not create garbage files.

Suggestion: Mails to multiple players (to/cc/bcc), add contacts book, named mailing lists

I have not yet tried the mod, but read a big part of its source code. I am just running my thoughts here, maybe this is not needed at all - in which case you should probably wait until I loose interest or do a pull request myself

As I currently understand it, each player can specify the recipient via just a plain text field. I think it would be nice to be able to choose players (and not just one) from a list, especially if the name is complicated and you often write back and forth without continuing old threads. This could be implemented by splitting the form input by every occourence of , (comma), and removing leftover spaces and then sending the mail to all of the mentioned. The next step could be adding CC and BCC fields (everyone in all fields gets send the mail, but only TO and CC fields get sent with the mail).
Then, it would make sense to add a contacts book that automatically adds players you write to and maybe has a "frequent contacts" section for convenience.
Here mailing lists would be nice. I am not sure what the official meaning of that is, I have seen two types: merely names, shorthands, for a collection of contacts and a mechanism on the server that people can subscribe to, to get every mail sent to the lists address. I speak of the former, but I want to have the latter, too - as a separate mod using the api. How to distinguish lists from player names? By prepending @, but I would like to distinguish between lists a player made in his contacts and playerless lists (registered by mods etc.) and am unsure how to best do this.

Anyway, summary of thoughts:

  • composition: multiple players in TO
  • composition: add CC and BCC fields
  • contacts: add/remove players
  • contacts: compose message to selected player(s)
  • composition: select players from contacts
  • contacts: "frequent contacts" (BONUS SUGGESTION)
  • mailing lists: storage+api for playerless mailing lists (alias for collection of players)
  • composition: accept mailing lists
  • contacts: create/edit/delete personal mailing lists
  • contacts: setting for mailing list to be publicly accessible or private (list can be written to by other players/"There is no publicly accessible mailing list with that name" error)
  • (mailing list mod: subscribe/unsubscribe from list, forward messages to all members after moderation etc.)

body of a received message should not be editable

Opening this on behalf of another person.

The contents of a mail that you are reading, should not be in an editable textarea, this can lead to someone typing a reply in the message they are reading, and not being able to send it.

I think this can be fixed by changing this line to

			textarea[0.25,1.8;8,7.8;;;%s]

Receivers lines too long (formspec issue)

There is a formspec issue when there are too much receivers : all receivers are displayed, then more info is hidden due to the size of the formspec.

  • In sent view, it is easy, we just have to limit to 30 chars, like the subject column (with ...)
  • In message view, it is more complicated, because it is presumed to show all the available info. Is there a way to do like an horizontal scrollbar, to allow long receiver list ?

nil value in on_playerReceiveFields line 599

Not sure what the user did. He said he clicked on [Contacts] or [About], but I cannot reproduce.

2020-10-22 23:44:52: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): /home/mtlive1/.minetest/mods/mail_mod/gui.lua:599: attempt to index a nil value
2020-10-22 23:44:52: ERROR[Main]: stack traceback:
2020-10-22 23:44:52: ERROR[Main]: 	/home/mtlive1/.minetest/mods/mail_mod/gui.lua:599: in function 'func'
2020-10-22 23:44:52: ERROR[Main]: 	...inetest_live/bin/../builtin/profiler/instrumentation.lua:106: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2020-10-22 23:44:52: ERROR[Main]: 	...ve1/5.3.0/Minetest_live/bin/../builtin/game/register.lua:429: in function <...ve1/5.3.0/Minetest_live/bin/../builtin/game/register.lua:413>

Mailing lists issues

Hi, I noticed some issues :

  • Could not delete mailing list
  • When changing the name of a mailing list, it duplicates it
  • Could not make sub-mailing lists (ex : @container = @one_contained, @another_contained)

Should those fixed for upcoming release.

deleting multiple mails is bugged

if you "select all" and click "delete", only half of the messages are deleted.

if you select a number of messages manually and click "delete", messages that were not selected may be deleted.

Security: Prevent players from sharing a mailbox

If my assumption is correct that I can log in with any account and then log in with an account with the same name but containing a slash (/) or a dot (.) and minetest treats it as two different players, then we have a gaping security hole, because this mod loads the same JSON file for all of them (storage.lua:5).

To avoid problems with file systems and directories, dots and slashes are stripped from the player name before taking it as the file name to load or create for mail storage. Uncountably infinite accounts can be created by appending any of the stripped symbols anywhere in the name any number of times to get a different player that still has access to the same mail data.

PROPOSITION: Adjust logic in getMailFile() such that all possible player names are in a one-to-one relation with their assigned saneplayername by

  • just using a hash function like SHA1 or
  • escaping all special symbols or
  • escaping just the offending special symbols.

nil value inmail_mod/util/normalize.lua:23

User said he clicked "reply all", but rest of the circumstances is unknown

2020-12-01 15:39:03: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): /home/mtlive1/.minetest/mods/mail_mod/util/normalize.lua:23: attempt to index local 'field' (a nil value)
2020-12-01 15:39:03: ERROR[Main]: stack traceback:
2020-12-01 15:39:03: ERROR[Main]: 	/home/mtlive1/.minetest/mods/mail_mod/util/normalize.lua:23: in function 'parse_player_list'
2020-12-01 15:39:03: ERROR[Main]: 	/home/mtlive1/.minetest/mods/mail_mod/gui.lua:339: in function 'replyall'
2020-12-01 15:39:03: ERROR[Main]: 	/home/mtlive1/.minetest/mods/mail_mod/gui.lua:396: in function 'func'
2020-12-01 15:39:03: ERROR[Main]: 	...inetest_live/bin/../builtin/profiler/instrumentation.lua:106: in function <...inetest_live/bin/../builtin/profiler/instrumentation.lua:100>
2020-12-01 15:39:03: ERROR[Main]: 	...ve1/5.3.0/Minetest_live/bin/../builtin/game/register.lua:429: in function <...ve1/5.3.0/Minetest_live/bin/../builtin/game/register.lua:413>

forward mail crash

2020-10-08 17:52:59: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): /data/world//worldmods/mail_mod/gui.lua:352: attempt to concatenate field 'body' (a nil value)
2020-10-08 17:52:59: ERROR[Main]: stack traceback:
2020-10-08 17:52:59: ERROR[Main]: 	/data/world//worldmods/mail_mod/gui.lua:352: in function 'forward'
2020-10-08 17:52:59: ERROR[Main]: 	/data/world//worldmods/mail_mod/gui.lua:452: in function 'func'
2020-10-08 17:52:59: ERROR[Main]: 	...ocal/share/minetest/builtin/profiler/instrumentation.lua:106: in function <...ocal/share/minetest/builtin/profiler/instrumentation.lua:100>
2020-10-08 17:52:59: ERROR[Main]: 	/usr/local/share/minetest/builtin/game/register.lua:429: in function </usr/local/share/minetest/builtin/game/register.lua:413>

Outbox reading crash

AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...t/bin/../worlds/basic_test/worldmods/mail/ui/message.lua:30: attempt to index local 'message' (a nil value)
stack traceback:
	...t/bin/../worlds/basic_test/worldmods/mail/ui/message.lua:30: in function 'show_message'
	...st/bin/../worlds/basic_test/worldmods/mail/ui/events.lua:169: in function 'func'
	/opt/minetest/bin/../builtin/profiler/instrumentation.lua:108: in function </opt/minetest/bin/../builtin/profiler/instrumentation.lua:101>
	/opt/minetest/bin/../builtin/game/register.lua:448: in function </opt/minetest/bin/../builtin/game/register.lua:434>

i sent two pieces of mail. i then went into the sent box. i deleted the second, then tried to read the first.

reply or reply all witout selected message crashes

When a user does NOT select a message, but clicks the [reply] Button or the [reply all] button, the server crashes. Most likely more buttons that require a message selected.

Commit 1a84c66

2023-04-25 21:21:58: ACTION[Server]: [yl_commons] formspec "yl_joinmessage:player": rewired_X submitted {"quit":"true"}
2023-04-25 21:22:01: ACTION[Server]: [yl_commons] formspec "mail:inbox": rewired_X submitted {"filter":"","replyall":"Reply all","sortdirection":"1","sortfield":"3"}
2023-04-25 21:22:01: ACTION[Main]: Server: Shutting down
2023-04-25 21:22:02: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: attempt to index local 'message' (a nil value)
2023-04-25 21:22:02: ERROR[Main]: stack traceback:
2023-04-25 21:22:02: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: in function 'replyall'
2023-04-25 21:22:02: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:207: in function 'func'
2023-04-25 21:22:02: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-25 21:22:02: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>
2023-04-25 21:44:51: ACTION[Server]: [yl_commons] formspec "": AliasAlreadyTaken submitted {"mail":"","searchbox":""}
2023-04-25 21:44:59: ACTION[Server]: [yl_commons] lua is using 203.8 MB
2023-04-25 21:45:05: ACTION[Server]: [yl_commons] formspec "mail:inbox": AliasAlreadyTaken submitted {"filter":"","reply":"Antworten","sortdirection":"1","sortfield":"3"}
2023-04-25 21:45:05: ACTION[Main]: Server: Shutting down
2023-04-25 21:45:06: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: attempt to index local 'message' (a nil value)
2023-04-25 21:45:06: ERROR[Main]: stack traceback:
2023-04-25 21:45:06: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:48: in function 'reply'
2023-04-25 21:45:06: ERROR[Main]: 	...t/5.6.1/Minetest_test/bin/../mods/mail_mod/ui/events.lua:198: in function 'func'
2023-04-25 21:45:06: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-04-25 21:45:06: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

For my reference 4279

ui/message.lua:53: attempt to index local 'message' (a nil value)

Looks suspiciously similar to #84

This is the commit we're on: 8dcfc7d

That's how it happened:

2023-05-09 13:47:18: ACTION[Server]: [yl_commons] formspec "mail:compose": whosit submitted {"bcc":"","body":"","cc":"","send":"Send","subject":"VERY LONG TEXT","to":"whosit"}
2023-05-09 13:47:22: ACTION[Server]: [yl_commons] lua is using 176.3 MB
2023-05-09 13:47:23: ACTION[Server]: [yl_commons] formspec "mail:inbox": whosit submitted {"quit":"true"}
2023-05-09 13:47:32: ACTION[Server]: [yl_commons] lua is using 222.4 MB
2023-05-09 13:47:36: ACTION[Server]: [yl_commons] formspec "mail:inbox": whosit submitted {"filter":"","inbox":"CHG:1:0","sortdirection":"1","sortfield":"1"}
2023-05-09 13:47:36: ACTION[Server]: [yl_commons] formspec "mail:inbox": whosit submitted {"filter":"","inbox":"CHG:2:0","sortdirection":"1","sortfield":"1"}
2023-05-09 13:47:40: ACTION[Server]: [yl_commons] formspec "mail:inbox": whosit submitted {"filter":"","inbox":"DCL:2:0","sortdirection":"1","sortfield":"1"}
2023-05-09 13:47:42: ACTION[Server]: [yl_commons] lua is using 250.9 MB
2023-05-09 13:47:47: ACTION[Server]: [yl_commons] formspec "mail:message": whosit submitted {"replyall":"Reply all"}
2023-05-09 13:47:47: ACTION[Main]: Server: Shutting down

I tried to reproduce with the steps above, but couldn't get it to crash again in the same way. Since a "new mail" is involved, it can't be a migration issue as suspected in #84

Stacktrace:

2023-05-09 13:47:49: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): .../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: attempt to index local 'message' (a nil value)
2023-05-09 13:47:49: ERROR[Main]: stack traceback:
2023-05-09 13:47:49: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:53: in function 'replyall'
2023-05-09 13:47:49: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/mail_mod/ui/message.lua:114: in function 'func'
2023-05-09 13:47:49: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-05-09 13:47:49: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:432: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:418>

For my reference 4447

add a drafts folder

sometimes, players will be in the middle of writing a long email, when something requires they pay attention to other things in-game (e.g. getting attacked by a mob). the player currently has 2 choices: press "escape" and lose the email, or send it unfinished.

Error with messages.

2023-05-14 01:34:24: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): ...e/minetest/games/Smalltech_Game/mods/mail/ui/message.lua:30: attempt to index local 'message' (a nil value)
2023-05-14 01:34:24: ERROR[Main]: stack traceback:
2023-05-14 01:34:24: ERROR[Main]: 	...e/minetest/games/Smalltech_Game/mods/mail/ui/message.lua:30: in function 'show_message'
2023-05-14 01:34:24: ERROR[Main]: 	...re/minetest/games/Smalltech_Game/mods/mail/ui/events.lua:167: in function 'func'
2023-05-14 01:34:24: ERROR[Main]: 	/usr/share/minetest/builtin/profiler/instrumentation.lua:108: in function </usr/share/minetest/builtin/profiler/instrumentation.lua:101>
2023-05-14 01:34:24: ERROR[Main]: 	/usr/share/minetest/builtin/game/register.lua:446: in function </usr/share/minetest/builtin/game/register.lua:432>

From my Server.

Trash directory

Add a trash directory then :

  1. From Inbox/Outbox -> Click on delete
  2. Message goes to Trash
  3. Trash -> Click on delete
  4. Message permanently deleted

Adding drafts does not always work

What I did:

  • Create a draft
  • Create a second draft with different title
  • Select the second draft and edit it to be identical
  • Create a new draft -> The selected draft was edited instead of a new one added.
  • Delete all drafts
  • Create a new draft
  • Multiple attempts to create a new second draft -> The existing draft was changed instead of a new one added

I suspect it either to be the selection never gets dropped or the list got missformed by 2 identical drafts.

Better about page

  • Initial author : Cheapie
  • List of contributors
  • NĀ° of version
  • License
  • GitHub source.

Latest update breaks "reply", causes crash.

  • Server runs "multicraft 2.0.0", not canonical "minetest 5.x"

I am unable to reliably reproduce this though. While trying to reproduce it, I observed that when a sender clicks "send" to send the mail, it just stays in their "Drafts" folder and is instantly delivered to the recipient (if both are logged in and in "/mail" at the same time) until they log out and then back in. Anyway, the stack trace might be useful.

The problem appeared ~7h ago after I updated to the latest mail mod. Sadly, the git revision history shows lots of changes, and without a repro, I am unable to bisect to find which change introduced this bug.

ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mail' in callback on_playerReceiveFields(): /home/1hit/worlds/world/worldmods/mail/ui/message.lua:48: attempt to concatenate field 'body' (a nil value)
stack traceback:
        /home/1hit/worlds/world/worldmods/mail/ui/message.lua:48: in function 'reply'
        /home/1hit/worlds/world/worldmods/mail/ui/message.lua:105: in function </home/1hit/worlds/world/worldmods/mail/ui/message.lua:87>
        /home/1hit/multicraft/bin/../builtin/game/register.lua:441: in function </home/1hit/multicraft/bin/../builtin/game/register.lua:425>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.