diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-06-05 21:55:41 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-06-05 21:55:41 +0000 |
commit | 805f83430ffd35a86cb5f71bd2ff83fc35c65484 (patch) | |
tree | b8726c9293c4b6b0dc9a10d1bdca79c85c9988f8 | |
parent | 0621608a58a9e8875054406636735dbdab86dacf (diff) |
Remove unneeded function that prepends mail with "From " marker.
mail.local(8) does it for us in mbox case, maildir doesn't need
this, and in ext. mda case we delegate it to the external program.
committing on gilles@'s behalf
-rw-r--r-- | usr.sbin/smtpd/store.c | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/usr.sbin/smtpd/store.c b/usr.sbin/smtpd/store.c index f56d7306a33..d96e32a71f4 100644 --- a/usr.sbin/smtpd/store.c +++ b/usr.sbin/smtpd/store.c @@ -1,4 +1,4 @@ -/* $OpenBSD: store.c,v 1.18 2009/05/27 13:14:18 jacekm Exp $ */ +/* $OpenBSD: store.c,v 1.19 2009/06/05 21:55:40 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -85,48 +85,6 @@ file_copy(FILE *dest, FILE *src, enum action_type type) } int -store_write_header(struct batch *batchp, struct message *messagep, FILE *fp, - int finalize) -{ - time_t tm; - void *p; - char addrbuf[INET6_ADDRSTRLEN]; - - tm = time(NULL); - - if (messagep->session_ss.ss_family == PF_INET) { - struct sockaddr_in *ssin = (struct sockaddr_in *)&messagep->session_ss; - p = &ssin->sin_addr.s_addr; - } - if (messagep->session_ss.ss_family == PF_INET6) { - struct sockaddr_in6 *ssin6 = (struct sockaddr_in6 *)&messagep->session_ss; - p = &ssin6->sin6_addr.s6_addr; - } - - bzero(addrbuf, sizeof (addrbuf)); - inet_ntop(messagep->session_ss.ss_family, p, addrbuf, sizeof (addrbuf)); - - if (messagep->recipient.rule.r_action != A_MBOX) { - if (batchp->type & T_DAEMON_BATCH) { - if (fprintf(fp, "From %s@%s %s\n", "MAILER-DAEMON", - batchp->env->sc_hostname, time_to_text(tm)) == -1) { - return 0; - } - } - else { - if (fprintf(fp, "From %s@%s %s\n", - messagep->sender.user, messagep->sender.domain, time_to_text(tm)) == -1) - return 0; - } - } - - if (finalize && fprintf(fp, "\n") == -1) - return 0; - - return 1; -} - -int store_write_daemon(struct batch *batchp, struct message *messagep) { u_int32_t i; @@ -142,9 +100,6 @@ store_write_daemon(struct batch *batchp, struct message *messagep) if (messagefp == NULL) goto bad; - if (! store_write_header(batchp, messagep, mboxfp, 1)) - goto bad; - if (fprintf(mboxfp, "Hi !\n\n" "This is the MAILER-DAEMON, please DO NOT REPLY to this e-mail it is\n" "just a notification to let you know that an error has occurred.\n\n") == -1) @@ -238,9 +193,6 @@ store_write_message(struct batch *batchp, struct message *messagep) if (messagefp == NULL) goto bad; - if (! store_write_header(batchp, messagep, mboxfp, 0)) - goto bad; - if (! file_copy(mboxfp, messagefp, messagep->recipient.rule.r_action)) goto bad; |