sys-process/fcron don't add "content-transfer-encoding" and "content-type" tags in mail header. As result, international characters in e-mail from fcron become unreadable, in case of default encoding in e-mail client not the same, as fcron system local encoding. For example, my system local encoding is UTF-8, but e-mail client in mobile phone use CP1251 as default encoding. Reproducible: Always Steps to Reproduce: 1. Schedule any job in fcron with mailing output. For example: echo Здравствуй, мир! 2. Check received e-mail. 3. "content-transfer-encoding" and "content-type" tags in mail header missed. I wrote patch, for fixing this problem in same way, as in another cron clones. in case of fcron found environment variables CONTENT_TYPE or CONTENT_TRANSFER_ENCODING, it use they values for corresponding e-mail header tags. For example: CONTENT_TYPE="text/plain; charset=utf-8" CONTENT_TRANSFER_ENCODING="8bit" === diff -urN fcron-3.0.6/job.c fcron-3.0.6.patch/job.c --- fcron-3.0.6/job.c 2010-03-03 00:47:03.000000000 +0300 +++ fcron-3.0.6.patch/job.c 2011-07-05 14:08:58.000000000 +0400 @@ -232,11 +232,23 @@ /* is this a complete mail address ? (ie. with a "@", not only a username) */ char complete_adr = 0; int i; + env_t *env; + char *env_string; if ( mailf == NULL ) die_e("Could not fdopen() mailfd"); /* write mail header */ + for ( env = line->cl_file->cf_env_base; env; env = env->e_next) { + if ( strncmp(env->e_val,"CONTENT_TYPE=",strlen("CONTENT_TYPE="))==0 ) { + env_string=strchr(env->e_val,'=')+1; + fprintf(mailf, "Content-Type: %s\n", env_string); + } else + if ( strncmp(env->e_val,"CONTENT_TRANSFER_ENCODING=",strlen("CONTENT_TRANSFER_ENCODING="))==0 ) { + env_string=strchr(env->e_val,'=')+1; + fprintf(mailf, "Content-Transfer-Encoding: %s\n", env_string); + } + } fprintf(mailf, "To: %s", line->cl_mailto); #ifdef HAVE_GETHOSTNAME --
Created attachment 280129 [details] Add content-transfer-encoding and content-type tags in message header
Can you please send this to the upstream author? Thanks
I sent this patch to Thibault Godouet <fcron@free.fr> at 14/07/2011 21:12 MSK (UTC+3) He accept it at 22/08/2011 1:16 MSK (UTC+3) But last version of fcron from 04/05/2010 and next version isn't scheduled. Have you any other idea?
Good enough for me — let me make sure that the current ebuild works fine then I'll merge it.
Heh, I forgot about this but it's now fixed as 3.1.0 is in tree and includes a variation of this.