Browse Source

not group

main
pvincent 7 days ago
parent
commit
b50b8e76c8
  1. 5
      sympa/recipe/sympa_fix_personalization.recipe

5
sympa/recipe/sympa_fix_personalization.recipe

@ -23,6 +23,7 @@ function fix_personalization {
function patch_message_pm {
if [[ -f $MESSAGE_PM ]]; then
if ! grep -q '^.*qw/subject x-originating-ip message-id date x-original-to x-original-from.*$' "$MESSAGE_PM"; then
echo 'applying patch message pm'
/opt/miaou-bash/tools/append_or_replace '^.*qw/subject x-originating-ip message-id date x-original-to.*$' ' qw/subject x-originating-ip message-id date x-original-to x-original-from from to thread-topic content-type/' "$MESSAGE_PM"
FOUND=true
else
@ -30,7 +31,7 @@ function patch_message_pm {
fi
message=$(prepend_2lines_of_text_before_existing_line "$MESSAGE_PM" '$data->{sender} = $self->{sender};' '$data->{gecos} = $self->{gecos};' '$data->{subject} = $self->{decoded_subject};')
if [[ $message =~ 'do prepend' ]]; then
echo 'sender and gecos now prepended'
echo 'prepending sender and gecos in message pm'
FOUND=true
else
echo 'sender and gecos already prepended!'
@ -49,7 +50,7 @@ function prepend_2lines_of_text_before_existing_line {
[[ ! -f $file ]] && echo "file: $file not found!" && exit 20
if ! grep "^$existing$" $file -B2 | grep -qz "$line1.*$line2.*$existing"; then
if ! (grep "^$existing$" $file -B2 | grep -qz "$line1.*$line2.*$existing"); then
echo 'do prepend'
sed -i "/^$existing$/s/^/$line1\n$line2\n/" $file
else

Loading…
Cancel
Save