X-Git-Url: https://git.llucax.com/software/sercom-old.git/blobdiff_plain/9d5cef9df44a7d6687a9563bc762ae56fe70103b..ac7a3a999286bddd9ab83754fc0e25df0a926493:/src/sc_fetch diff --git a/src/sc_fetch b/src/sc_fetch index 9f14318..6a78b6d 100755 --- a/src/sc_fetch +++ b/src/sc_fetch @@ -201,8 +201,8 @@ function preparar_entrega($intento, $mbox, $msgid, $dir) { $fname = part_filename($part); if ($fname) { logs("Escribiendo archivo '$fname' [enc={$part->encoding}]", DEBUG); - $body = imap_fetchbody($mbox, $msgid, $id + 1); - if (!file_put_contents("$path/$fname", decode_body($body, $part->encoding))) return "Error al guardar el archivo $fname"; + $body = decode_body(imap_fetchbody($mbox, $msgid, $id + 1), $part->encoding); + if (!file_put_contents("$path/$fname", $body) and $body) return "Error al guardar el archivo $fname"; } //if (part_is_source($part) $has_sources = true; //elseif (part_mime_type($part) == 'application/zip') $has_sources = true;