diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-09-04 16:28:43 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-09-04 16:28:43 +0000 |
commit | 077a146d0300804ea2c4ad1cc3b9eade40806eb5 (patch) | |
tree | b06ac523eea8735f8da85f2f9870ec2e657a2aab /usr.sbin | |
parent | 6aac63725fd0ce3475a1196aa6b5600bceaba34f (diff) |
Prepend Return-Path.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/smtpd/mda.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/mda.c b/usr.sbin/smtpd/mda.c index 2762180ecf5..3033979f7a9 100644 --- a/usr.sbin/smtpd/mda.c +++ b/usr.sbin/smtpd/mda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mda.c,v 1.28 2009/09/04 11:49:23 jacekm Exp $ */ +/* $OpenBSD: mda.c,v 1.29 2009/09/04 16:28:42 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -422,6 +422,15 @@ mda_store(struct batch *b) return 0; if ((src = fdopen(b->datafd, "r")) == NULL) return 0; + + /* add Return-Path to preserve envelope sender */ + /* XXX: remove user provided Return-Path, if any */ + if (b->message.sender.user[0] && + b->message.sender.domain[0]) { + fprintf(dst, "Return-Path: %s@%s\n", + b->message.sender.user, + b->message.sender.domain); + } /* add Delivered-To to help loop detection */ fprintf(dst, "Delivered-To: %s@%s\n", |