For stand-alone message storage, ejabberd implements the mod_offline module using XEP-0160 .
1) There is no maximum validity for storing offline messages. This means that all messages sent to the offline user will be stored on the server until this user goes online.
2) You can set the limit of messages that you want to save on the server, as:
access: max_user_offline_messages: admin: 5000 all: 100 modules: mod_offline: access_max_user_messages: max_user_offline_messages
This allows you to store up to 5000 offline messages for administrator messages and 100 for all other users.
For more details see official mod_offline docs here
source share