a/src/internfile/mh_exec.cpp b/src/internfile/mh_exec.cpp
...
...
92
    myparams.push_back(m_fn);
92
    myparams.push_back(m_fn);
93
    if (!m_ipath.empty())
93
    if (!m_ipath.empty())
94
    myparams.push_back(m_ipath);
94
    myparams.push_back(m_ipath);
95
95
96
    // Execute command, store the output
96
    // Execute command, store the output
97
    string& output = m_metaData[cstr_content];
97
    string& output = m_metaData[cstr_dj_keycontent];
98
    output.erase();
98
    output.erase();
99
    ExecCmd mexec;
99
    ExecCmd mexec;
100
    MEAdv adv(filtermaxseconds);
100
    MEAdv adv(filtermaxseconds);
101
    mexec.setAdvise(&adv);
101
    mexec.setAdvise(&adv);
102
    mexec.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
102
    mexec.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
...
...
143
    return true;
143
    return true;
144
}
144
}
145
145
146
void MimeHandlerExec::finaldetails()
146
void MimeHandlerExec::finaldetails()
147
{
147
{
148
    m_metaData[cstr_origcharset] = m_dfltInputCharset;
148
    m_metaData[cstr_dj_keyorigcharset] = m_dfltInputCharset;
149
149
150
    // cfgFilterOutputCharset comes from the mimeconf filter definition line
150
    // cfgFilterOutputCharset comes from the mimeconf filter definition line
151
    string& charset = m_metaData[cstr_charset];
151
    string& charset = m_metaData[cstr_dj_keycharset];
152
    charset = cfgFilterOutputCharset.empty() ? "UTF-8" : cfgFilterOutputCharset;
152
    charset = cfgFilterOutputCharset.empty() ? "UTF-8" : cfgFilterOutputCharset;
153
    if (!stringlowercmp("default", charset)) {
153
    if (!stringlowercmp("default", charset)) {
154
    charset = m_dfltInputCharset;
154
    charset = m_dfltInputCharset;
155
    }
155
    }
156
156
157
    string& mt = m_metaData[cstr_mimetype];
157
    string& mt = m_metaData[cstr_dj_keymt];
158
    mt = cfgFilterOutputMtype.empty() ? "text/html" : 
158
    mt = cfgFilterOutputMtype.empty() ? "text/html" : 
159
    cfgFilterOutputMtype;
159
    cfgFilterOutputMtype;
160
160
161
    // If this is text/plain transcode_to/check utf-8
161
    // If this is text/plain transcode_to/check utf-8
162
    if (!mt.compare(cstr_textplain)) {
162
    if (!mt.compare(cstr_textplain)) {
163
    (void)txtdcode("mh_exec");
163
    (void)txtdcode("mh_exec");
164
    }
164
    }
165
165
166
    string md5, xmd5, reason;
166
    string md5, xmd5, reason;
167
    if (MD5File(m_fn, md5, &reason)) {
167
    if (MD5File(m_fn, md5, &reason)) {
168
    m_metaData[cstr_md5] = MD5HexPrint(md5, xmd5);
168
    m_metaData[cstr_dj_keymd5] = MD5HexPrint(md5, xmd5);
169
    } else {
169
    } else {
170
    LOGERR(("MimeHandlerExec: cant compute md5 for [%s]: %s\n", 
170
    LOGERR(("MimeHandlerExec: cant compute md5 for [%s]: %s\n", 
171
        m_fn.c_str(), reason.c_str()));
171
        m_fn.c_str(), reason.c_str()));
172
    }
172
    }
173
}
173
}