move ProcessAttachments subroutine to align with upstream, RT#25260 kinda