Hallo All,
In a previuos thread, I manage to start replacing characters in the body of an email, ignoring the headers by something like this:
# Set field-separator.
BEGIN { FS = " *= *" }
# Remove trailing spaces.
{ sub(/[ \t]+$/, "") }
/^$/ {flg=1}
flg!=1{next}
This works fine, the end result is as expected when run form the command line.
Problem:
The idea of this is to rewrite the email, then re-inject it to the MTA for delivery. As the result of the awk script strips all the headers out, this obviously results in an undeliverable email.
Challenge:
Is it possible to keep all the headers intact, and only process the body? Somthing like:
don't touch headers, keep intact and write
start awk at the beginning of a completely empty line
/^$/ {flg=1}
flg!=1{next}
Any ideas?
In a previuos thread, I manage to start replacing characters in the body of an email, ignoring the headers by something like this:
# Set field-separator.
BEGIN { FS = " *= *" }
# Remove trailing spaces.
{ sub(/[ \t]+$/, "") }
/^$/ {flg=1}
flg!=1{next}
This works fine, the end result is as expected when run form the command line.
Problem:
The idea of this is to rewrite the email, then re-inject it to the MTA for delivery. As the result of the awk script strips all the headers out, this obviously results in an undeliverable email.
Challenge:
Is it possible to keep all the headers intact, and only process the body? Somthing like:
don't touch headers, keep intact and write
start awk at the beginning of a completely empty line
/^$/ {flg=1}
flg!=1{next}
Any ideas?