+1  A: 

Add a BOOL property or instance variable: careAboutKeyboard that's accessible to both your keyboardWasShown: and keywardWasHidden: methods, likely in the view controller those methods are in.

Have it set to YES when in the viewWillAppear method, and set to NO when you show the mail view and in viewWillDisappear.

Then put all of your scrolling logic in an if block:

if(careAboutKeyboard) {
    // Scrolling logic
}
Ben S
Great mind think alike! After I posted this, I was thinking that this apporach would be something to try.Could you clarify what is "atomic" property? I was thkning just adding BOOL variable to class, not even a property.
leon
If your application is single threaded, you don't have to worry about atomicity. Actually, since only the event thread should be calling the methods I named, just forget I even said atomic. I've edited my answer.
Ben S