Sun Java System Messaging Server 6.3 Administration Reference

notificationMethod Signature

The following signature can be used for the notificationMethod():


The notification function has the following prototype:
 int symbol(QuotaInfo* info, char** message, int* freeflag)
 info is a pointer to the following structure:
typedef struct QuotaInfo {
   const char* username; /* user name (uid or uid@domain) */
   long quotakb; /* quota in kbytes */
   long quotamsg;  /* quota in number of messages */
  ulong usagekb; /* total usage in kbytes */
   ulong usagemsg; /* total usage in number of messages */
   FolderUsage* folderlist; /* folder list (for -e) */
   long num_folder;  /* number of folders in the folderlist */
   long trigger; /* the exceeded notificationTriggerPercentage */
   const char* rule; /* rulename that triggered notification */
 }
typedef struct FolderUsage {
  const char *foldername;
   ulong usagekb; /* folder usage in kbytes */
 }

               

The address, message, points to the notification message. The notification function is expected to fill in the value of this variable and allocate the memory for the message when necessary. The freeflag variable indicates if the caller is responsible for freeing the memory allocated for message.

The return values are 0 for success and 1 for failure.

If the notification function returns a 0, and *message is pointing to a valid address, the imquotacheck utility will deliver the message to the user. If the *freeflag is set to 1, the caller will free the memory address pointed to by message after the message is sent.

If the -e option is specified, the quota usage for every folder will be stored in the folderlist variable, an array of FolderUsage structure; the num_folder variable is set to the number of folders in the folderlist.


Note –

If the messageFile attribute is also specified, the attributed messageFile will be ignored.