Escape from open ()
source link: https://www.codesd.com/item/escape-from-open.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Escape from open ()
I am a newcomer to Perl, however not to programming in general. I have been looking for any hints how to escape from open() in Perl, but have not been lucky, and that is why I am asking here.
I have a:
$mailprog = '/usr/lib/sendmail';
open(MAIL,"|$mailprog -t");
read(STDIN, $buffer, 18);
print MAIL "To: [email protected]\n";
print MAIL "From: [email protected]\n";
print MAIL "Subject: xxx\n";
print MAIL $buffer;
close (MAIL);
Is there any way how I can shape the input into the $buffer so as to escape from sendmail ? The buffer input length is arbitrary. Input is totally under my control. Thanks a lot for any ideas !
man sendmail
says:
By default, Postfix sendmail(1) reads a message from standard input until EOF or until it reads a line with only a . character, and arranges for delivery. Postfix sendmail(1) relies on the postdrop(1) command to create a queue file in the maildrop directory.
So you would want your input to contain the sequence "\n.\n"
somewhere.
Recommend
-
127
Escape Team – an escape room to print at home. “The most original concept we’ve come across in years.” Gamezebo An “ingenio...
-
151
Explore PostsOptions Menu
-
71
Finally Free! Escape is now Open Source! Bart Spaans, November 27, 2017 Today we’re excited to announce that Escape, our cross-cloud release engineering toolkit, has been
-
59
Jupiter Broadcasting 404 Page Not Found
-
70
Ardan Labs Go Programming Blog
-
82
Did you know that when you’re using OpenSSH from the command line you have a variety of escape sequences available to you? SSH somewhere, then type “~” and “?” (tilde, then question mark) to see all the options. You should get something like: Su...
-
89
Post with 2242 views. Just Hit Escape
-
52
Well, yes, I’m still working on Dinit, my portable and “lightweight” intended-as-an-alternative to Systemd. The first commit was on August 27, 2015 – just under three years ago – and my first announcement about Dinit on t...
-
40
News Bling - Escape your political bubble in 5 min - NEXT
-
72
VirtualBox E1000 Guest-to-Host Escape. Contribute to MorteNoir1/virtualbox_e1000_0day development by creating an account on GitHub.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK