projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring in spost.
[mmh]
/
uip
/
spost.c
diff --git
a/uip/spost.c
b/uip/spost.c
index
ee36a6f
..
e3cf211
100644
(file)
--- a/
uip/spost.c
+++ b/
uip/spost.c
@@
-137,8
+137,6
@@
static enum {
static char tmpfil[] = "/tmp/pstXXXXXX";
static char tmpfil[] = "/tmp/pstXXXXXX";
-static char from[BUFSIZ]; /* my network address */
-static char signature[BUFSIZ]; /* my signature */
static char *filter = NULL; /* the filter for BCC'ing */
static char *subject = NULL; /* the subject field for BCC'ing */
static char *fccfold[FCCS]; /* foldernames for FCC'ing */
static char *filter = NULL; /* the filter for BCC'ing */
static char *subject = NULL; /* the subject field for BCC'ing */
static char *fccfold[FCCS]; /* foldernames for FCC'ing */
@@
-155,13
+153,10
@@
extern char *sendmail;
extern char *getfullname(void);
extern char *getusername(void);
extern char *getfullname(void);
extern char *getusername(void);
-extern boolean draft_from_masquerading; /* defined in mts.c */
-
/*
** static prototypes
*/
static void putfmt(char *, char *, FILE *);
/*
** static prototypes
*/
static void putfmt(char *, char *, FILE *);
-static void start_headers(void);
static void finish_headers(FILE *);
static int get_header(char *, struct headers *);
static void putadr(char *, struct mailname *);
static void finish_headers(FILE *);
static int get_header(char *, struct headers *);
static void putadr(char *, struct mailname *);
@@
-293,7
+288,6
@@
main(int argc, char **argv)
if ((in = fopen(msg, "r")) == NULL)
adios(msg, "unable to open");
if ((in = fopen(msg, "r")) == NULL)
adios(msg, "unable to open");
- start_headers();
if (debug) {
verbose++;
out = stdout;
if (debug) {
verbose++;
out = stdout;
@@
-526,12
+520,19
@@
putfmt(char *name, char *str, FILE *out)
/*
/*
-** Construct signature name
+** Add yet missing headers.
*/
static void
*/
static void
-start_headers(void)
+finish_headers(FILE *out)
{
char *cp;
{
char *cp;
+ char from[BUFSIZ]; /* my network address */
+ char signature[BUFSIZ]; /* my signature */
+ char *resentstr = (msgstate == resent) ? "Resent-" : "";
+
+ if (!(msgflags & MDAT)) {
+ fprintf(out, "%sDate: %s\n", resentstr, dtimenow(0));
+ }
strncpy(from, getusername(), sizeof(from));
if ((cp = getfullname()) && *cp) {
strncpy(from, getusername(), sizeof(from));
if ((cp = getfullname()) && *cp) {
@@
-539,29
+540,10
@@
start_headers(void)
} else {
snprintf(signature, sizeof(signature), "%s", from);
}
} else {
snprintf(signature, sizeof(signature), "%s", from);
}
-}
-
-
-/*
-** Add yet missing headers.
-*/
-static void
-finish_headers(FILE *out)
-{
- char *resentstr = (msgstate == resent) ? "Resent-" : "";
-
- if (!(msgflags & MDAT)) {
- fprintf(out, "%sDate: %s\n", resentstr, dtimenow(0));
- }
if (!(msgflags & MFRM)) {
fprintf(out, "%sFrom: %s\n", resentstr, signature);
if (!(msgflags & MFRM)) {
fprintf(out, "%sFrom: %s\n", resentstr, signature);
- } else if (!draft_from_masquerading) {
- /*
- ** mts.conf didn't contain "masquerade:[...]draft_from[...]"
- ** so we'll reveal the user's actual account@thismachine
- ** address in a Sender: header (and use it as the envelope
- ** From: later).
- */
+ } else {
+ /* In case the From: header contains multiple addresses. */
fprintf(out, "%sSender: %s\n", resentstr, from);
}
#ifdef notdef
fprintf(out, "%sSender: %s\n", resentstr, from);
}
#ifdef notdef
@@
-724,13
+706,8
@@
make_bcc_file(void)
if (!(msgflags & MFRM)) {
/* Construct a From: header. */
fprintf(out, "From: %s\n", signature);
if (!(msgflags & MFRM)) {
/* Construct a From: header. */
fprintf(out, "From: %s\n", signature);
- } else if (!draft_from_masquerading) {
- /*
- ** mts.conf didn't contain "masquerade:[...]draft_from[...]"
- ** so we'll reveal the user's actual account@thismachine
- ** address in a Sender: header (and use it as the envelope
- ** From: later).
- */
+ } else {
+ /* Add a Sender: header in case the From: header is fake. */
fprintf(out, "Sender: %s\n", from);
}
if (subject)
fprintf(out, "Sender: %s\n", from);
}
if (subject)