projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
596f081
)
RT# 79705 fakesmtpserver - saved messages viewable with e-mail client
author
Mitch Jackson
<mitch@freeside.biz>
Wed, 18 Jul 2018 22:38:44 +0000
(22:38 +0000)
committer
Mitch Jackson
<mitch@freeside.biz>
Wed, 18 Jul 2018 22:38:44 +0000
(22:38 +0000)
bin/fakesmtpserver.pl
patch
|
blob
|
history
diff --git
a/bin/fakesmtpserver.pl
b/bin/fakesmtpserver.pl
index
1f2ca3f
..
5da6cb5
100755
(executable)
--- a/
bin/fakesmtpserver.pl
+++ b/
bin/fakesmtpserver.pl
@@
-10,6
+10,9
@@
it could be updated to fork on client connections.
When an e-mail is delivered, the TO and FROM are printed to STDOUT.
The TO, FROM and MSG are saved to a file in $message_save_dir
When an e-mail is delivered, the TO and FROM are printed to STDOUT.
The TO, FROM and MSG are saved to a file in $message_save_dir
+Open a saved .eml file with Mozilla Thunderbird (or other mail clients)
+to review e-mail with all html/pdf attachments
+
=cut
use strict;
=cut
use strict;
@@
-33,21
+36,21
@@
while(my $conn = $server->accept()) {
$client->process || next;
$client->process || next;
- open my $fh, '>', $message_save_dir.'/'.time().'.
txt
'
+ open my $fh, '>', $message_save_dir.'/'.time().'.
eml
'
or die "error: $!";
for my $f (qw/TO FROM/) {
if (ref $client->{$f} eq 'ARRAY') {
print "$f: $_\n" for @{$client->{$f}};
or die "error: $!";
for my $f (qw/TO FROM/) {
if (ref $client->{$f} eq 'ARRAY') {
print "$f: $_\n" for @{$client->{$f}};
- print $fh "$f: $_\n" for @{$client->{$f}};
+
#
print $fh "$f: $_\n" for @{$client->{$f}};
} else {
print "$f: $client->{$f}\n";
} else {
print "$f: $client->{$f}\n";
- print $fh "$f: $client->{$f}\n";
+
#
print $fh "$f: $client->{$f}\n";
}
}
}
}
- print $fh "
\n\n
$client->{MSG}\n";
+ print $fh "$client->{MSG}\n";
print "\n";
close $fh;
}
print "\n";
close $fh;
}