PKGBUILDs/extra/smtpprox/smtpprox-tmpname-and-xforward.patch
2009-10-09 21:23:22 -05:00

44 lines
1.3 KiB
Diff

diff -urN smtpprox-1.2/MSDW/SMTP/Server.pm smtpprox-1.2-fixed/MSDW/SMTP/Server.pm
--- smtpprox-1.2/MSDW/SMTP/Server.pm 2003-03-09 13:52:24.000000000 -0500
+++ smtpprox-1.2-fixed/MSDW/SMTP/Server.pm 2007-01-18 13:27:44.000000000 -0500
@@ -13,6 +13,7 @@
package MSDW::SMTP::Server;
use IO::Socket;
use IO::File;
+use File::Temp qw(mkstemp);
=head1 NAME
@@ -183,13 +184,21 @@
return 0 unless defined($_ = $self->getline);
s/[\r\n]*$//;
$self->{state} = $_;
- if (s/^helo\s+//i) {
+ if (s/^(helo|ehlo)\s+//i) {
s/\s*$//;s/\s+/ /g;
$self->{helo} = $_;
+ } elsif (s/^xforward\s*//i) {
+ my (@attr) = split(/\s+/, $_);
+ my ($attr);
+ foreach $attr (@attr) {
+ my ($name, $value) = ($attr =~ /^(.*?)=(.*)$/);
+ $self->{xforward}->{lc($name)} = $value;
+ }
} elsif (s/^rset\s*//i) {
delete $self->{to};
delete $self->{data};
delete $self->{recipients};
+ delete $self->{xforward};
} elsif (s/^mail\s+from:\s*//i) {
delete $self->{to};
delete $self->{data};
@@ -208,7 +217,8 @@
$self->{data}->seek(0, 0);
$self->{data}->truncate(0);
} else {
- $self->{data} = IO::File->new_tmpfile;
+ (undef, $self->{datafilename}) = mkstemp("/tmp/smtpproxXXXXXX");
+ $self->{data} = new IO::File $self->{datafilename}, "r+";
}
while (defined($_ = $self->getline)) {
if ($_ eq ".\r\n") {