mtlsproxy feedback
1 direct reply — Read more / Contribute
|
by linuxlegends
on Dec 16, 2025 at 18:01
|
I have this perl code this uses App::Spec and HTTP::Proxy to act as a forward proxy that handles mTLS requests - https://gitlab.com/infrastructure24/mitmtls/-/blob/main/src/mtlsproxy.sh?ref_type=heads. I'm planning on converting it to a CPAN module named App::Mtlsproxy since I was not able to find anything in CPAN that performs this task with a good CLI interface. The PAUSE documentation recommends posting here before uploading to get feedback. Does this seem like a good thing to upload to CPAN?
|
getting headers from essage
4 direct replies — Read more / Contribute
|
by Anonymous Monk
on Dec 16, 2025 at 14:25
|
I am trying to get some headers from an email message using an imap module but it is getting complicated. I am trying to work with a hash reference in which the keys are the header field names and the values are references to arrays of values. This is what the documentation says. I managed to capture those headers in arrays, but there is always only one element where all the info is stored. It does not matter with 'From' or 'Subject', but with 'To' it is unwanted because there is often more then one of those.So iam trying to get to this array of arrays element I solved it with splitting the string and removing leading and trailing spaces, but it's not fantastic. Could someone have a look at my script and give me some advice on how to proceed? I'll show you what i got so far:
use strict;
use warnings;
use Mail::IMAPClient;
my $imap = Mail::IMAPClient->new(
Server => 'imap.gmail.com',
User => 'jim@gmail.com',
Password => '*******',
Ssl => 1,
Debug => 0,
);
die "failed to instantiate $@." unless defined $imap;
$imap->select('INBOX');
my $msgcount = $imap->message_count();
print "$msgcount number of measages in your mailbox\n\n";
my @messages = $imap->messages;
pop(@messages);
my $msgid = pop(@messages);
my $text = $imap->bodypart_string($msgid,1);
my $hashref = $imap->parse_headers( $msgid, "Subject","To","From");
my @sender = @{%$hashref{"From"}};
my @recs = @{%$hashref{"To"}};
my @subject = @{%$hashref{"Subject"}};
my @rec = split(/,/, $recs[0]);
print "From: $sender[0]\n";
print "Subject: $subject[0]\n\n";
foreach(@rec){
$_=~ s/^\s+|\s+$//g;
print "To: $_\n";
}
print $text;
$imap->logout();
|