More info here http://gcastrop.blogspot.com/2011/02/problemas-con-adjuntos-en-simscan-con.html https://notes.sagredo.eu/en/qmail-notes-185/simscan-38.html#comment1242 diff -ruN simscan-1.4.0 / simscan.c simscan-1.4.0-tested / simscan.c --- simscan-1.4.0 / simscan.c 2011-02-08 20: 26: 06.095067924 -0200 +++ simscan-1.4.0-tested / simscan.c 2011-02-08 18: 16: 11.003064430 -0200 @@ -1735,10 +1735,14 @@ for (i = 0; i if (DebugFlag> 2) fprintf (stderr, "simscan: checking attachment% s against% s \ n", mydirent-> d_name, bk_attachments [i]); lowerit (mydirent-> d_name); - if (str_rstr (mydirent-> d_name, bk_attachments [i]) == 0) { - strncpy (AttachName, mydirent-> d_name, sizeof (AttachName) -1); - closedir (mydir); - return (1); + if (strlen (mydirent-> d_name)> = strlen (bk_attachments [i])) { + if (str_rstr (mydirent-> d_name, bk_attachments [i]) == 0) { + strncpy (AttachName, mydirent-> d_name , sizeof (AttachName) -1); + closedir (mydir); + return (1); +} +} else { + if (DebugFlag> 2) fprintf (stderr, "simscan: attachment name '% s' (% d) is shorter than '% s' (% d). IGNORED \ n", mydirent-> d_name, strlen (mydirent- > d_name), bk_attachments [i], strlen (bk_attachments [i])); } } }