+ /* Skip empty attachment_header_field_name lines. */
+ if (strlen (p) > 0) {
+ struct stat st;
+ if (stat (p, &st) == OK) {
+ if (S_ISREG (st.st_mode)) {
+ /* Don't set the default content type so take
+ make_mime_composition_file_entry() will try
+ to infer it from the file type. */
+ make_mime_composition_file_entry(p, attachformat, 0);
+ } else {
+ adios (NULL, "unable to attach %s, not a plain file",
+ p);
+ }
+ } else {
+ adios (NULL, "unable to access file \"%s\"", p);
+ }
+ }