Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

If email receiver is not in a state to receive it, what happens to the email?

Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
07-20-2007 16:46
If an email is sent to an object that is not in a state to receive it, what happens to the email? Suppose the script is in a state that does not call llGetNextEmail. Does the email stay in some sort of queue until the object changes to a state where the email event can get triggered? If so, is there a time limit for how long the message would be held until the receiving object can respond to it.

On a related note, I would think that if an email is sent to a non-existent object, it would simply evaporate. I don't believe there's a mechanism in SL for returning emails that are undeliverable for either of these two reasons. Or is there?
Masakazu Kojima
ケロ
Join date: 23 Apr 2004
Posts: 232
07-21-2007 08:08
If I remember correctly, an object has to call llGetNextEmail() at least once before emails will be queued for it.

Up to 100 emails will be queued even if the object doesn't exist anymore. I am not sure how long they stay in the queue but I'm pretty sure it is at least 24 hours. SL will bounce emails when the queue is full, but not when/if they expire from the queue as far as I know. Bounce messages directed to other objects are silently discarded, so you'll only see them for messages from an external source.
Espresso Saarinen
old geek
Join date: 22 Jan 2006
Posts: 93
07-21-2007 10:26
If you are chasing a bug, be aware that email has been strangely borked on and off for a few days.
Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
07-21-2007 12:02
No Espresso, I'm not chasing a bug. Just writing a script that uses it for inter-object communication. Just trying to understand the email system better. I couldn't find any info on this anywhere.

So Masakazu, are you saying that llGetNextEmail has to be called at least once in the lifetime of the object, or from a particular state and when that happens email starts getting queued. Does the queue only come into existence upon the first call to llGetNextEmail from that object? If llGetNextEmail has never been called, would the emails sent to the object silently die? The point here is do I have to do something to clear out junk email that may have been sent to the object before its decides to start processing them?

What happens when you change to a state where llGetNextEmail is not called, even though it may have been called in another state? In other words is the queue tied to the state or to the object? Your comments about email being queued even if the object no longer exists suggests that the queue is tied to the object. Same point as above, do I have to clear out emails sent when the script was not in a state to receive them?

If the state changes back to one that traps the email event, I would think you would have to call llGetNextEmail again to start reading from the queu since the state would reset itself.