aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-02 13:50:47 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-02 13:50:47 +0200
commita52af29aa96be8d59a6e7806283ca91dcf46c8a7 (patch)
tree2981728703a46d6988581bd7be96a49f9829c5c1
parent41474c2e685b3b36c6298b1e7493924afa9cea06 (diff)
downloadmblaze-a52af29aa96be8d59a6e7806283ca91dcf46c8a7.tar.gz
mmime: simplify
-rw-r--r--man/mmime.112
-rw-r--r--mmime.c26
2 files changed, 2 insertions, 36 deletions
diff --git a/man/mmime.1 b/man/mmime.1
index 4bdb598..056913b 100644
--- a/man/mmime.1
+++ b/man/mmime.1
@@ -6,23 +6,15 @@
.Nd encode MIME mails
.Sh SYNOPSIS
.Nm
-.Ar files\ ...
.Sh DESCRIPTION
.Nm
-encodes the
-.Ar files
-given as arguments into a MIME message.
+encodes the standard input into a MIME message.
.Pp
-If there is more than one file, a
-.Sq Li multipart/mixed
-mail is generated.
-.Pp
-With no arguments,
.Nm
generates a
.Sq Li multipart/mixed
mail from standard input,
-extending the header as neccessary,
+extending, wrapping, and encoding the header as neccessary,
and replacing body lines looking like
.Pp
.D1 Li # Ns Ar type Pa filename
diff --git a/mmime.c b/mmime.c
index bff5112..4b34c35 100644
--- a/mmime.c
+++ b/mmime.c
@@ -173,26 +173,6 @@ int gen_file(char *file, char *ct)
}
}
-int
-gen_mixed(int argc, char *argv[])
-{
- char sep[100];
- snprintf(sep, sizeof sep, "----_=_%08lx%08lx%08lx_=_",
- lrand48(), lrand48(), lrand48());
- int i;
-
- printf("Content-Type: multipart/mixed; boundary=\"%s\"\n", sep);
- printf("\n");
- printf("This is a multipart message in MIME format.\n\n");
- for (i = 0; i < argc; i++) {
- printf("--%s\n", sep);
- gen_file(argv[i], 0);
- }
- printf("--%s--\n", sep);
-
- return 0;
-}
-
void
print_header(char *line) {
char *s, *e;
@@ -347,10 +327,4 @@ main(int argc, char *argv[])
if (argc == 1)
return gen_build();
-
- printf("MIME-Version: 1.0\n");
- if (argc >= 2)
- return gen_mixed(argc-1, argv+1);
- else
- return gen_file(argv[1], 0);
}