29 Jan
2013
29 Jan
'13
8:59 p.m.
Dovecot version: 2.1.13 OS: Centos 6.3 CPU: 64bit x86
There appear to be two related errors in the decode2text.sh file (which can be used for indexing/ searching attachments).
Original problem line (from ./src/plugins/fts/decode2texh.sh):
fmt=echo "$formats" | grep -w "^$content_type" | cut -d ' ' -f 2
Here are two options that appear to solve the problem. The first option is probably preferred, since it matches exactly the extension to the second "column".
- switch the order of commands (cut & grep) and add -m1. for example:
fmt=
echo "$formats" | cut -d ' ' -f 2 | grep -w -m1 "^$content_type"
-OR-
- add "m1" and remove "^". for example:
fmt=
echo "$formats" | grep -w -m1 "$content_type" | cut -d ' ' -f 2