I want to test mail relay. It requires me to send CRLF at the end of DATA.
I can use toggle CRLFin telnet, or -C option for NC. But is there a way to input CRLF from keyboard in linux terminal?
I want to test mail relay. It requires me to send CRLF at the end of DATA.
I can use toggle CRLFin telnet, or -C option for NC. But is there a way to input CRLF from keyboard in linux terminal?
Using vi, create a file having these two characters
vi file
then i to enter input mode^M
:CR
:wq
since LF is automatically added by viIf you have it (or install it) doing
should show
Now you can copy / paste or
cat
that file where necessary.You could also prepare the file with other characters, headers that you
cat
one shot to your application.Another, way is to install
dos2unix
(depending on your distrib), then prepare the file as necessary (ie without theCR
aka^M
), then doand all
0a
will be converted to0d0a
Normally I would expect you can just press enter/return but if you really need to send CRLF then you can use
Ctrlm for CR and
Ctrlj for LF