Manage Learn to apply best practices and optimize your operations.

Beware of attachments when writing docs to in R6

This tip tells you why you should beware of attachments when writing docs to a in R6.

View member feedback to this tip.

Picture this scenario: You have a workflow application involving e-mail notifications out to users where the notifications come "from" the application itself. It worked perfectly in R5. But when you place it on an R6 server, it begins to error with a "You are not authorized" message. You're stumped! Nothing has changed ACL-wise! But the application is now unusable and your users are hopping mad.

Before this happens to you, you might want to review your code for the following.

We all know that in the good ole days of R5, everyone coded to send mail by creating and saving documents directly in the rather than using the doc.Send method. Using this scenario, you could ensure that the router would then send your doc with whatever "From" information you saved the doc with, rather than worrying about what ID actually created the document.

However, you should listen when Lotus tells you not to do this in R6, especially if your code uses the doc.embedobject() method and the object it's embedding happens to be an attachment of any length. Because in this instance, if the ID executing the code has only depositor access to the (as most do) and the has LZ1 compression turned on (as is default in R6), your code will generate a "You are not authorized to perform that operation." It's an odd bug in R6, and it is documented in the Technote The LotusScript "EmbedObject" Method Results in the Error: "You are not Authorized to Perform that Operation", and in my testing it didn't even crop up on every R6 server, so it's best to take it out of your code ahead of time.

The best way to code around this, of course, is to create your documents in the database you're sending from or another database where the sending ID has editor access. If you need to control who the mail appears to be from, use the Principal field. To control where mail gets replied, use the ReplyTo field.

Of course, the sending ID will still be visible to the receiving party on the memo letterhead as "Sent by." But that makes the corporate auditors happier anyway, and your code will hopefully be more stable in the long term.


Wouldn't the best option be to disable LZ1 compression like the technote says? That would seem to be an easier solution than having to possibly change a ton of applications.

—Steve H.

Do you have comments on this tip? Let us know.

This tip was submitted to the tip exchange by member Marie Britton Turner. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on Lotus Notes 5

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...