General Info/Mail Server CLI/ESMTP

From r00tedvw.com wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Mail Server CLI | POP | IMAP | [[General Info/Mail Server CLI/ESMTP...")
 
m
 
Line 10: Line 10:
 
===== EHLO =====
 
===== 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.
 
: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 perimeterusa.com
+
  ehlo domain.com
  250-esmail01.eservices.usa.net Hello perimeterusa.com [10.45.64.3], pleased to meet you
+
  250-esmail01.eservices.domain.com Hello domain.com [10.45.64.3], pleased to meet you
 
  250-SIZE 52428800
 
  250-SIZE 52428800
 
  250-STARTTLS
 
  250-STARTTLS
Line 29: Line 29:
 
===== MAIL FROM =====
 
===== 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.
 
: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:<fvazquez@perimeterusa.com>
+
  mail from:<user@domain.com>
 
  250 2.1.0 Sender OK
 
  250 2.1.0 Sender OK
 
===== RCPT TO =====
 
===== 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.
 
: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:<fvazquez@perimeterusa.com>
+
  rcpt to:<user@domain.com>
 
  250 2.1.5 Recipient OK
 
  250 2.1.5 Recipient OK
 
===== DATA =====
 
===== DATA =====
Line 41: Line 41:
 
  test
 
  test
 
  .  
 
  .  
  250 2.6.0 <[email protected].USA.NET> [InternalId=62880244] Queued mail for delivery
+
  250 2.6.0 <[email protected].domain.com> [InternalId=62880244] Queued mail for delivery
  
 
===== QUIT =====
 
===== QUIT =====
Line 49: Line 49:
  
 
== Full Session Example ==
 
== Full Session Example ==
  Franks-MacBook-Pro:~ fvazquez$ telnet exchange.postoffice.net 25
+
  ~$ telnet exchange.domain.com 25
  Trying 165.212.120.200...
+
  Trying 10.45.64.2...
  Connected to exchange.postoffice.net.
+
  Connected to exchange.domain.com.
 
  Escape character is '^]'.
 
  Escape character is '^]'.
  220 exchange.postoffice.net Microsoft ESMTP MAIL Service ready at Fri, 12 Oct 2012 04:28:29 +0000
+
  220 exchange.domain.com Microsoft ESMTP MAIL Service ready at Fri, 12 Oct 2012 04:28:29 +0000
 
  ehlo talladegaraceway.com
 
  ehlo talladegaraceway.com
  250-esmail01.eservices.usa.net Hello talladegaraceway.com [10.45.64.3], pleased to meet you
+
  250-esmail01.eservices.domain.com Hello talladegaraceway.com [10.45.64.3], pleased to meet you
 
  250-SIZE 52428800
 
  250-SIZE 52428800
 
  250-STARTTLS
 
  250-STARTTLS
Line 73: Line 73:
 
  data
 
  data
 
  354 Start mail input; end with <CRLF>.<CRLF>
 
  354 Start mail input; end with <CRLF>.<CRLF>
  Received: from S1P5DAG2C.EXCHPROD.USA.NET ([169.254.2.236]) by
+
  Received: from S1P5DAG2C.EXCHPROD.domain.com ([169.254.2.236]) by
  S1P5HUB2.EXCHPROD.USA.NET ([10.120.223.32]) with mapi id 14.02.0247.003; Fri,
+
  S1P5HUB2.EXCHPROD.domain.com ([10.120.223.32]) with mapi id 14.02.0247.003; Fri,
 
  27 Apr 2012 23:29:55 +0000
 
  27 Apr 2012 23:29:55 +0000
 
  From: "Ricky Bobby" <[email protected]>
 
  From: "Ricky Bobby" <[email protected]>
Line 82: Line 82:
 
  Thread-Index: Ac0kzaXj1SGKcXxTRU21ts6UZGL4Xw==
 
  Thread-Index: Ac0kzaXj1SGKcXxTRU21ts6UZGL4Xw==
 
  Date: Fri, 27 Apr 2012 23:29:54 +0000
 
  Date: Fri, 27 Apr 2012 23:29:54 +0000
  Message-ID: <[email protected].USA.NET>
+
  Message-ID: <[email protected].domain.com>
 
   
 
   
 
  Content-Type: text/plain; charset="US-ASCII"
 
  Content-Type: text/plain; charset="US-ASCII"
Line 94: Line 94:
 
  Ricky Bobby
 
  Ricky Bobby
 
  .  
 
  .  
  250 2.6.0 <[email protected].USA.NET> [InternalId=62880244] Queued mail for delivery
+
  250 2.6.0 <[email protected].domain.com> [InternalId=62880244] Queued mail for delivery
 
  quit
 
  quit
 
  221 2.0.0 Service closing transmission channel
 
  221 2.0.0 Service closing transmission channel

Latest revision as of 22:51, 16 February 2017

Mail Server CLI | POP | IMAP | ESMTP

Contents

[edit] 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".

[edit] ESMTP Commands

[edit] 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
[edit] 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
[edit] 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
[edit] 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
[edit] 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
[edit] QUIT
Fairly self explanatory, terminates your session with the server.
quit
221 2.0.0 Service closing transmission channel

[edit] 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