uip_burst_LDADD = $(LDADD) $(POSTLINK)
uip_comp_SOURCES = uip/comp.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \
- uip/attach.c uip/annosbr.c uip/distsbr.c
+ uip/annosbr.c uip/distsbr.c
uip_comp_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_dist_SOURCES = uip/dist.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \
- uip/attach.c uip/annosbr.c uip/distsbr.c uip/forwsbr.c
+ uip/annosbr.c uip/distsbr.c uip/forwsbr.c
uip_dist_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_flist_SOURCES = uip/flist.c
uip_folder_LDADD = $(LDADD) $(POSTLINK)
uip_forw_SOURCES = uip/forw.c uip/whatnowproc.c uip/whatnowsbr.c uip/sendsbr.c \
- uip/attach.c uip/annosbr.c uip/distsbr.c uip/forwsbr.c
+ uip/annosbr.c uip/distsbr.c uip/forwsbr.c
uip_forw_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_inc_SOURCES = uip/inc.c uip/scansbr.c uip/dropsbr.c uip/popsbr.c
uip_mhbuild_SOURCES = uip/mhbuild.c uip/mhbuildsbr.c uip/mhcachesbr.c \
uip/mhlistsbr.c uip/mhoutsbr.c uip/mhmisc.c \
- uip/mhfree.c uip/mhparse.c uip/md5.c uip/attach.c
+ uip/mhfree.c uip/mhparse.c uip/md5.c
uip_mhbuild_LDADD = $(LDADD) $(TERMLIB) $(POSTLINK)
uip_mhfixmsg_SOURCES = uip/mhfixmsg.c uip/mhparse.c uip/mhcachesbr.c \
uip_refile_LDADD = $(LDADD) $(POSTLINK)
uip_repl_SOURCES = uip/repl.c uip/replsbr.c uip/whatnowproc.c uip/whatnowsbr.c \
- uip/sendsbr.c uip/attach.c uip/annosbr.c uip/distsbr.c
+ uip/sendsbr.c uip/annosbr.c uip/distsbr.c
uip_repl_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
uip_rmf_SOURCES = uip/rmf.c
uip_scan_SOURCES = uip/scan.c uip/scansbr.c
uip_scan_LDADD = $(LDADD) $(TERMLIB) $(ICONVLIB) $(POSTLINK)
-uip_send_SOURCES = uip/send.c uip/sendsbr.c uip/attach.c uip/annosbr.c \
+uip_send_SOURCES = uip/send.c uip/sendsbr.c uip/annosbr.c \
uip/distsbr.c
uip_send_LDADD = $(LDADD) $(POSTLINK)
uip_sortm_LDADD = $(LDADD) $(POSTLINK)
uip_whatnow_SOURCES = uip/whatnow.c uip/whatnowsbr.c uip/sendsbr.c \
- uip/attach.c uip/annosbr.c uip/distsbr.c
+ uip/annosbr.c uip/distsbr.c
uip_whatnow_LDADD = $(LDADD) $(READLINELIB) $(TERMLIB) $(POSTLINK)
uip_whom_SOURCES = uip/whom.c uip/distsbr.c
uip_slocal_LDADD = $(LDADD) $(NDBM_LIBS) $(POSTLINK)
uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \
- uip/attach.c uip/annosbr.c uip/distsbr.c
+ uip/annosbr.c uip/distsbr.c
uip_viamail_LDADD = $(LDADD) $(POSTLINK)
test_getfullname_SOURCES = test/getfullname.c
sbr/m_atoi.c sbr/m_backup.c sbr/m_convert.c \
sbr/m_draft.c sbr/m_getfld.c sbr/m_gmprot.c \
sbr/m_maildir.c sbr/m_name.c sbr/m_rand.c \
- sbr/makedir.c sbr/message_id.c sbr/mts.c \
+ sbr/makedir.c sbr/message_id.c sbr/mime_type.c sbr/mts.c \
sbr/norm_charmap.c sbr/path.c \
sbr/peekc.c sbr/pidwait.c sbr/pidstatus.c \
sbr/print_help.c sbr/print_sw.c sbr/print_version.c \
int makedir (char *);
char *message_id (time_t, int);
+/*
+ * Return a MIME content-type string for the specified file.
+ *
+ * If the system supports it, will use the "file" command to determine
+ * the appropriate content-type. Otherwise it will try to determine the
+ * content-type from the suffix. If that fails, the file will be scanned
+ * and either assigned a MIME type of text/plain or application/octet-stream
+ * depending if binary content is present.
+ *
+ * Arguments:
+ *
+ * filename - The name of the file to determine the MIME type of.
+ *
+ * Returns a pointer to a content-type string (which may include MIME
+ * parameters, such as charset). Returns a NULL if it cannot determine
+ * the MIME type of the file. Returns allocated storage that must be
+ * free'd.
+ */
+char *mime_type(const char *filename);
+
/*
* Clear the screen, using the appropriate entry from the terminfo database
*/
int writeBase64 (unsigned char *, size_t, unsigned char *);
int writeBase64raw (unsigned char *, size_t, unsigned char *);
-/*
- * prototypes to support whatnow attach
- */
-int attach(char *, char *, char *, size_t, char *, size_t, int);
-void clean_up_temporary_files(const char *, const char *);
-char *mime_type(const char *);
-char *construct_build_directive(char *, const char *, int);
-
/*
* credentials management
*/
/*
- * attach.c -- routines to help attach files via whatnow
+ * mime_type.c -- routine to determine the MIME Content-Type of a file
*
- * This code is Copyright (c) 2002, by the authors of nmh. See the
+ * This code is Copyright (c) 2014, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
*/
/*
* Try to use external command to determine mime type, and possibly
- * encoding. Caller is responsible for free'ing returned memory.
+ * encoding. If that fails try using the filename extension. Caller
+ * is responsible for free'ing returned memory.
*/
char *
mime_type(const char *file_name) {