It used to work like this, but in version 1.5 of the plugin this change was made:
use the wpcf7_before_send_mail hook instead of wpcf7_mail_components to hide mail groups. The wpcf7_before_send_mail hook is called earlier, so it allows to also hide groups in the attachment field and in messages.
I guess it wouldn’t hurt if I could just update the attachment fields and messages in the wpcf7_before_send_mail and update the email fields in the wpcf7_mail_components. Can I just use the default priority of 10, or should I get a higher/lower number in order not to conflict with your plugin?
Yes, I see. Too much processing of those fields occurs before the wpcf7_mail_components hook. The downside of using only wpcf7_before_send_mail is that it fires before most additional mails get attached. You could process mail and messages properties as you do now, but also attach to wpcf7_additional_mail then process all the message arrays present in that filtered array, including mail_2. That should preserve your processing of all the properties you do now and offer attachment processing to the additional messages.
Do you agree that it makes sense to extend your conditional tag processing to all messages?
I used 8 for the priorities in mine so that the additional messages would be available to any other code that attaches with the default priority (10), but also to allow modification/removal at priority 9. You could increase your chances of catching all messages if you use a very late priority, like (PHP_INT_MAX - (PHP_INT_MAX % 2)) / 2.