File: smtp.txt

package info (click to toggle)
libphp-swiftmailer 5.2.2-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 2,532 kB
  • ctags: 6,451
  • sloc: php: 26,587; xml: 22; sh: 18; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 1,688 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
General Notes
--------------
 * MX is NOT required, but an A record, or CNAME to a MX MUST be present at the least.
 * EHLO should be tried, then fall back to HELO
 * The 250 return code from RCPT TO is not actually clear-cut. A 251 may be
   returned if the message was forwarded to another address.  This could be a
   useful indicator to end-users that an address should be updated.
 * RCPT TO can accpet just "postmaster" without a domain name
 * Server MUST not close connection before:
   - QUIT and returning 221 response
   - Forced requirement, and only after returning a 421 response
   - Clients expriencing a forced connection closure, without prior warning should
     just treat it like a 451 closure regardless
 * ALWAYS use blocking sockets for the initial connection (this should prevent
   Exim4's whining about sync).

Response codes
--------------
 * From RFC2821, 4.2.
   - In particular, the 220, 221, 251, 421, and 551 reply codes
     are associated with message text that must be parsed and interpreted
     by machines.

Error Codes
------------
 * Numeric 5yz = Error
   - 550/RCPT TO = Relay denied
   - 500 = Unknown command
 * Numeric 2yz = Normal
 * Numeric 4yz = Temporary failure??

<?php

class EsmtpTransport implements Transport, EsmtpCommandWriter {
}

interface EsmtpCommandWriter {
  public function getBuffer();
  public function executeCommand($command, $expectedCodes);
}

interface Extension {
  public function getKeyword();
  public function afterEhlo($commandWriter);
  public function getRcptParams();
  public function getMailParams();
  public function atCommand($commandWriter, $command, $expectedResponse) throws CommandSentException;
}