This command initiates the SMTP conversation. The host connecting to the remote SMTP server
identifies itself by it's fully qualified DNS host name.
EHLO sendinghostname
An alternative command for starting the conversation. This states that the sending server
wants to use the extended SMTP (ESMTP) protocol.
MAIL From:
This is the start of an email message. The source email address is what will appear in the
"From:" field of the message.
RCPT To:
This identifies the receipient of the email message. This command can be repeated multiple times
for a given message in order to deliver a single message to multiple receipients.
DATA
This command signifies that a stream of data, ie the email message body, will follow.
The stream of data is terminated by a "." on a line by itself.v
RSET
Abort the current e-mail transaction (reset), but stay connected for more to come.
NOOP
No op,. as in .no operation.. Do nothing, but return an .OK. response.
QUIT
This terminates an SMTP connection. Multiple email messages can be transfered during a single TCP/IP connection.
This allows for more efficient transfer of email. To start another email message in the same session,
simply issue another "MAIL" command.
VRFY username
This command will request that the receiving SMTP server verify that a given email username is valid.
The SMTP server will reply with the login name of the user. This feature can be turned off in sendmail because
allowing it can be a security hole. VRFY commands can be used to probe for login names on a system.
EXPN aliasname
EXPN is similar to VRFY, except that when used with a distribution list, it will list all users on that list.
This can be a bigger problem than the "VRFY" command since sites often have an alias such as "all".
Subject:
Cc:
Reply-To:
Custom Headers:
# Client sends headers
From: Foo
To: Bar
Date: Mon, 1 May 2006 10:23:00 +0000 (UTC)
Reply-To:
# Custom header
X-submission: Submitted by 192.0.20.1
Subject: This is my message
Email header lines are not SMTP commands per se. They are sent in the DATA stream for a message.
Header lines appear on a line by themselves, and are seperated from the body of a message by a blank line.
# find command
find -mmin -10
find files changed in the last 10 minutes
find -size +5M -ls
find files larger then 5 Meg. display with extra proprties, not just a listing
Find / replace strings in multiple files
find /path/to/files -type f -exec sed -i 's/old.string/new.string/g' {}/;
-or-
sed -i 's/hello.com/localhost.net/g' /root/test/*
watch command. can be used in combination with many others such as FIND (watch file proprties chagne in real time or DF (watch drive Size in real time)
watch -n 1 find -mmin -1
files that changed in the last minute, refresh every second (the -n option)
# GREP - global regular expression print
grep ""
Search for word in a file
grep -n ""
Search with line numbers
grep -vn ""
Priont all but the
grep -c ""
Print count of an occurance
grep -l "boo" *
prints only the filenames of files in the query that have lines that match the search string
grep -i "BOO"
Ignore case
grep -x "boo"
looks for eXact matches only.
grep -f search
specify a file containing the search string
grep "e$"
search the file for lines ending with the letter "e"
egrep "boot|boots"
egrep supports that grep does not is the pipe (|) funcitons as an "or."
find | grep "hello"
print out the files that find returns that contain the text "hello"
tail -n8 | grep "boo"
performs a grep on the last 8 lines of
Can be used for live grepping with -f
find . -exec grep "boo" {} \;
search for the string "boo" in every directory below the current directory
grep "\([a-z]\)\1"
uses backreferences to find lines that contain two of the same lowercase letter in succession.