On 12/09/15 08:31, Sebastian Nielsen wrote: > Yep. On top of that: ([^-]*) means any charachter except for -, so it > shouldn't match any -, and thus $2 cannot contain the charachter "-" at > all. > > I suspect that postfix in some way matches the whole message in once, > and when the REPLACE word is given, the whole message, even including > parts of message that does not match the regexp, are replaced by the > "REPLACE". But I tried with (.*) before and after, and added $1 to the > beginning and $4 to the end, and also changed $1$2 to $2$3, but that > didnt help.
Indeed, does it dump the email body content for *all* emails or just the ones with inline PGP? If not, a possible rule: /[ \t\r\f]*-----BEGIN ([^-]*)-----[ \t\r\f]*(.*)-----END \1-----/ REPLACE -----BEGIN $1-----\r$2-----END $1----- That should preserve the content inside the PGP message (probably discarding anything outside). You want to avoid changing things between BEGIN and END though because that might cause signature invalidation. -- Stuart Longland (aka Redhatter, VK4MSL) I haven't lost my mind... ...it's backed up on a tape somewhere.
signature.asc
Description: OpenPGP digital signature