Thanks - I think this helped, but will give it a day or two to see what happens.
My secd was over 32 GB the other day and the iMac wasn't quite its usual self. After restarting, secd's memory usage dropped away, but has been steadily creeping up over the last couple of days and was over 5GB this morning. So I tried dragging the Keychains folder to the trash and restarting.
The thing about dragging your keychain to the trash and restarting is, on logging back in you may be asked for a pile of passwords to all your mail accounts and your keychain will be empty!
I filled out all the requests for icloud passwords, but for the keychain to update properly, this took a while. I think what saved me from panicking about losing all my passwords, was going into System Preferences and signing into iCloud there. I was also requested to verify my iCloud login from another device (e.g., iPAD). I think this is what restored my keychain from the cloud.
Once the keychain had updated itself, I restarted the iMac again, and Mail returned to normal (no more requests for mail account passwords).
The only thing that wasn't restored after restarting was automatic keychain access to my time machine. I had to enter the password and save it to the keychain.