How to code a Mail Forwarding agent that only sends mail smaller than a certain size?

Some of our users are forwarding mail to their personal blackberry device which is not using a blackberry server linked to our domino system (it’s external).

The agent runs before new mail arrives and uses a “Simple Action” to send mail and copy the message to their Blackberry address.

Problem is that their blackberry provider recently changed some policies to refuse any message larger than a certain size.

How can I go about creating a new agent using Lotus Script, that will do the following:

If message-size < xxx, send full message.

If message-size > xxx, Send only body without attachment.

I’ve been looking for code samples that specifically do this, but I could only find agents that do a simple forward and delete the message after.

I need the forward to send a copy of the message, the original message has to stay in the mailfile of the user.

Any help?

Subject: How to code a Mail Forwarding agent that only sends mail smaller than a certain size?

You can modify the template for all users and in the forward action you can put your own code.

Also if you can afford a tool, or if the template cannot be modified, you can use MKESL (MK Email Size Limiter) from www.notes-compression.com that will allow you to avoid sending the email if the size of this email is bigger than a given threshold… this verification is made in the workstation side so you don’t even loose bandwidth sending the email to the server and the user receives an instant message box alerting that the email is big so he/she can take actions as soon as the send button is clicked.

HTH

Subject: RE: How to code a Mail Forwarding agent that only sends mail smaller than a certain size?

Not sure that would do. We don’t want to alter the way Domino is setup at the moment, just modify the forwarding agent that some users have (very small base of user) to forward mail to their blackberry. There’s already a maximum size limit of 10Mb for messages on the Domino domain, the issue is that the blackberry server of those users is blocking mail larger than something such as 2Mb’s… The users still want the mail forwarded to their BB, but just with the body (and not the attachment) if it’s larger than what the BB server can take, so we need to use LotusScript instead of Simple Actions so we can add conditions… That also has to run server-side, on every new incoming mail (Before new mail arrives).