Thread Net::SMTP::Server auf Windows 7 (70 answers)
Opened by bianca at 2016-02-29 15:58

GwenDragon
 2016-03-15 09:53
#184160 #184160
User since
2005-01-17
14748 Artikel
Admin1
[Homepage]
user image
Mein Code des Servers
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use strict;
use warnings;

use lib 'T:\\'; # eigeneModule

use 5.010;

use Data::Dumper ( qw(Dumper) );
local $Data::Dumper::Purity = 1;
local $Data::Dumper::Useqq = 1;
local $Data::Dumper::Sortkeys = sub {my ($hash) = @_; return [(sort {lc $a cmp lc $b} keys %$hash)]; };


use Net::SMTP::Server;
use Net::SMTP::Server::Client;
my $server = new Net::SMTP::Server('127.0.0.1',25);

while(my $conn = $server->accept()) {
    my $client = new Net::SMTP::Server::Client($conn) or die "Unable to handle client connection: $!\n";
    $client->process;
    say Dumper($client);    
}


Ein Test des Servers mit Netcat
T:\>P:\NMap\ncat.exe 127.0.0.1 25
220 MacGyver SMTP Ready.
MAIL FROM: zaza@er.de
250 Ok...got it.
RCPT TO: lala@er.de
250 Ok...got it.
DATA
354 Give it to me, big daddy.
Subject: Opppp a server!
From: lala@er.de
To: lll@er.de
D-A: aaaa

Aha!
.
^Z
550 Fine...who needs you anyway!
close: Result too large


ergibt

PERL-5.20 T:\>perl server.pl
defined(@array) is deprecated at T:\/Net/SMTP/Server/Client.pm line 129.
(Maybe you should just omit the defined()?)
$VAR1 = bless( {
"FROM" => "zaza\@er.de",
"MSG" => "Subject: Opppp a server!\nFrom: lala\@er.de\nTo: lll\@er.de\nD-A: aaaa\n\nAha!\n.\n",
"SOCK" => bless( \*Symbol::GEN1, 'IO::Socket::INET' ),
"TO" => [
"lala\@er.de"
]
}, 'Net::SMTP::Server::Client' );
*Symbol::GEN1 = {
"io_socket_domain" => 2,
"io_socket_proto" => 6,
"io_socket_timeout" => undef,
"io_socket_type" => 1
};

View full thread Net::SMTP::Server auf Windows 7