General Info/Mail Server CLI/ESMTP

From r00tedvw.com wiki
Jump to: navigation, search

Mail Server CLI | POP | IMAP | ESMTP

Contents

ESMTP Overview

ESMTP
Extended Simple Mail Transport Protocol : Application layer internet standard protocol that uses TCP/IP.

Testing from a command line interface provides a virtually guaranteed way of confirming basic requirements for a successfully connection. Observations and responses observed come directly from the mail server rather than trying to interpret an application's translation of the scenario. Keep in mind that testing from a command line is generally in plain text, which is insecure, unless you use a connect application such as openssl

While much easier to test from a Linux terminal, it is possible to test from a windows command prompt, however, keep in mind that Windows does not allow you to backspace or delete any mistakes that you make. While unconfirmed, based on behavior it appears that Windows actively submits every keystroke to the mail server rather than waiting for "return".

ESMTP Commands

EHLO
The required first command, is the introduction to the mail server. You can either list a FQDN or Email address. It also lists what commands the server has available for usage.
ehlo domain.com
250-esmail01.eservices.domain.com Hello domain.com [10.45.64.3], pleased to meet you
250-SIZE 52428800
250-STARTTLS
250-PIPELINING 
250-8BITMIME
250 HELP
AUTH LOGIN
Only used for mail servers that require authentication, this requires that the username and password be passed to the server in BASE64 encoding. openssl is capable of encoding/decoding text to BASE64. This step is not required if you are connecting with the recipient's mail exchanger directly, IE connecting to a gmail MX to deliver a message to a gmail recipient.
Do not use this command if you are simply trying to determine if an email address is valid and is being accepted by the MX.
auth login
334 VXNlcm5hbWU6
dXNlcm5hbWU=
334 UGFzc3dvcmQ6
cGFzc3dvcmQ=
235 2.7.0 Authentication successful
MAIL FROM
Specifies who is sending the message, but not necessarily the sender of the message. I will not go into detail as more information is readily available online.
mail from:<[email protected]>
250 2.1.0 Sender OK
RCPT TO
Specifies who is receiving the message, but not necessarily the original recipient or CC. I will not go into detail as more information is readily available online.
rcpt to:<[email protected]>
250 2.1.5 Recipient OK
DATA
This is where the message is inserted, everthing including internet headers, message body, & attachments.
data
354 Start mail input; end with <CRLF>.<CRLF>
test
. 
250 2.6.0 <0b39248e-b2fe-4454-9dc8-d0066082b054@S1P5HUB2.EXCHPROD.domain.com> [InternalId=62880244] Queued mail for delivery
QUIT
Fairly self explanatory, terminates your session with the server.
quit
221 2.0.0 Service closing transmission channel

Full Session Example

~$ telnet exchange.domain.com 25
Trying 10.45.64.2...
Connected to exchange.domain.com.
Escape character is '^]'.
220 exchange.domain.com Microsoft ESMTP MAIL Service ready at Fri, 12 Oct 2012 04:28:29 +0000
ehlo talladegaraceway.com
250-esmail01.eservices.domain.com Hello talladegaraceway.com [10.45.64.3], pleased to meet you
250-SIZE 52428800
250-STARTTLS
250-PIPELINING 
250-8BITMIME
250 HELP
auth login
334 VXNlcm5hbWU6
cmlja3lib2JieUB0YWxsYWRlZ2FyYWNld2F5LmNvbQ==
334 UGFzc3dvcmQ6
c2hha2VhbmRiYWtl
235 2.7.0 Authentication successful
mail from:<[email protected]>
250 2.1.0 Sender OK
rcpt to:<[email protected]>
250 2.1.5 Recipient OK
data
354 Start mail input; end with <CRLF>.<CRLF>
Received: from S1P5DAG2C.EXCHPROD.domain.com ([169.254.2.236]) by
S1P5HUB2.EXCHPROD.domain.com ([10.120.223.32]) with mapi id 14.02.0247.003; Fri,
27 Apr 2012 23:29:55 +0000
From: "Ricky Bobby" <[email protected]>
To: "Chaz Michael Michaels" <[email protected]>
Subject: Shake & Bake
Thread-Topic: Shake & Bake
Thread-Index: Ac0kzaXj1SGKcXxTRU21ts6UZGL4Xw==
Date: Fri, 27 Apr 2012 23:29:54 +0000
Message-ID: <3D4A65565EFB3D4B9A541F98D0DA17D7143C2010@S1P5DAG2C.EXCHPROD.domain.com>

Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Hello,

Shake and Bake forever!  The Iron Lotus sucks.

Yours Truely,
Ricky Bobby
. 
250 2.6.0 <0b39248e-b2fe-4454-9dc8-d0066082b054@S1P5HUB2.EXCHPROD.domain.com> [InternalId=62880244] Queued mail for delivery
quit
221 2.0.0 Service closing transmission channel
Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
2020 Election
Volkswagen
Covid
NCDMV
Toolbox