Ticket #460 (closed defect: fixed)

Opened 12 years ago

Last modified 11 years ago

mail / sendmail should respect $ATHENA_USER for from

Reported by: adehnert Owned by:
Priority: normal Milestone:
Component: -- Keywords:
Cc: Fixed in version:
Upstream bug:


Sending mail with mailx(1) / /usr/sbin/sendmail should respect the $ATHENA_USER variable for setting the from address.

--- /usr/lib/debathena-msmtp.orig	2009-12-08 10:52:01.000000000 -0500
+++ /usr/lib/debathena-msmtp	2009-12-08 15:29:18.000000000 -0500
@@ -10,6 +10,7 @@
 	echo "Could not find valid ATHENA.MIT.EDU Kerberos tickets." >&2
 	exit 1
+    export USER=${ATHENA_USER:-$USER}
     exec msmtp --host=outgoing.mit.edu --port=587 --auth=gssapi --user="$kuser" --auto-from=on --maildomain=mit.edu "$@"
    exec msmtp --host=outgoing.mit.edu --port=25 --auth=off --auto-from=on --maildomain=mit.edu "$@"

appears to resolve this issue, though in a mildly kludgy way. (It might be best to add a similar modification to USER to the unauthed stanza.)

Change History

comment:1 Changed 12 years ago by andersk

I think it’s better to use explicit --from=… instead of --auto-from=on --maildomain=mit.edu and setting $USER. And yeah, this should also be done in the unauthenticated case.

comment:2 Changed 12 years ago by adehnert

So MSMTP sets the envelope sender / Return-Path based on --from or --auto-from, and then fills in the From: header if it doesn't already exist based on the same value? I guess then --from might be the right option. (I originally assumed that --from= would make it impossible to set another From: address, but I guess not.)

comment:3 Changed 11 years ago by lizdenys

  • Status changed from new to proposed

Fixed in r24488, uploaded to proposed

comment:4 Changed 11 years ago by andersk

That change is wrong for two reasons: (1) this ticket is about the From: address, not the envelope-from; (2) that will bring back the bug where mail from root appears to be from root@…. r24488 and r24489 should be reverted. See zephyr for more detail.

comment:5 Changed 11 years ago by broder

  • Status changed from proposed to new

Blargh. Reverted in r24490, along with a note about why we're not using ATHENA_USER.

comment:6 Changed 11 years ago by broder

I think this ticket may secretly be about the envelope-from.

As far as I can tell, neither mailx nor msmtp set a From header if one is missing. However, I've tested and found that outgoing.mit.edu adds a From header that matches the envelope-from address if one isn't in the original e-mail.

So given the semantics we're forcing on the envelope from (see r24490), this may be as closed to fixed as this ticket gets.

comment:7 Changed 11 years ago by adehnert

  • Status changed from new to closed
  • Resolution set to fixed

Cursory testing with mail and sendmail seems to indicate that this works. Sending mail (while I have tickets) makes my sender adehnert@….

Note: See TracTickets for help on using tickets.