Revision 24016,
791 bytes
checked in by broder, 15 years ago
(diff) |
In msmtp-config:
* Replace shell script with Perl script that respects
/etc/aliases. (Trac: #83)
Patch by David Wilson.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use Mail::ExpandAliases; |
---|
4 | |
---|
5 | $ticketlist = `klist 2>/dev/null`; |
---|
6 | $ticketlist =~ /Default principal: (.*?)\@ATHENA.MIT.EDU/; |
---|
7 | $kuser = $1; |
---|
8 | |
---|
9 | $parser = Mail::ExpandAliases->new; |
---|
10 | foreach $arg (@ARGV) { |
---|
11 | push @aliases, $parser->expand($arg); |
---|
12 | } |
---|
13 | |
---|
14 | if ($kuser && |
---|
15 | (($ENV{'DEBATHENA_SENDMAIL_AUTH'} eq 'yes') || |
---|
16 | (!$ENV{'DEBATHENA_SENDMAIL_AUTH'}))) { |
---|
17 | #send auth |
---|
18 | exec(qw{msmtp --host=outgoing.mit.edu --port=587 --auth=gssapi}, "--user=$kuser", qw{--auto-from=on --maildomain=mit.edu}, @aliases); |
---|
19 | } |
---|
20 | elsif ($ENV{'DEBATHENA_SENDMAIL_AUTH'} eq 'yes') { |
---|
21 | $! = 1; |
---|
22 | die "Could not find valid ATHENA.MIT.EDU Kerberos tickets.\n"; |
---|
23 | } |
---|
24 | else { |
---|
25 | #send unauth |
---|
26 | exec(qw{msmtp --host=outgoing.mit.edu --port=25 --auth=off --auto-from=on --maildomain=mit.edu}, @aliases); |
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.