It sounds like you might not need to use the with binding at all.
The reason it is not working is because it is looking for an array called "mails" within the chosenFolderData binding context. If chosenFolderData is the array containing the emails, then you can do away with the with binding altogether:
<tbody data-bind="foreach: chosenFolderData">
You can mutate the underlying array with any of the ordinary methods that work on arrays. KO provides a few convenience functions. There are also some projects out there that are more efficient at updating arrays, if the arrays you are using will become quite large. I believe that these will be incorporated by default into KO 4.0, so unless you experience performance issues I would just wait.
If what you are asking is how to get which specific item (index within the array) that a user has clicked on, you will want to log the full event triggered by the click binding. It will include both the html element and context within the view model.