Berikut contoh dialog antara server dan client pada SMTP. C adalah Client, S adalah Server.
S: 220 smtp.example.com ESMTP Postfix C: HELO relay.example.org S: 250 Hello relay.example.org, I am glad to meet you C: MAIL FROM: S: 250 Ok C: RCPT TO: S: 250 Ok C: RCPT TO: S: 250 Ok C: DATA S: 354 End data with . C: From: "Bob Example" C: To: Alice Example C: Cc: theboss@example.com C: Date: Tue, 15 Jan 2008 16:02:43 -0500 C: Subject: Test message C: C: Hello Alice. C: This is a test message with 5 header fields and 4 lines in the message body. C: Your friend, C: Bob C: . S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye
Berikut adalah contoh yang POP3
S: C: S: +OK POP3 server ready C: APOP mrose c4c9334bac560ecc979e58001b3e22fb S: +OK mrose's maildrop has 2 messages (320 octets) C: STAT S: +OK 2 320 C: LIST S: +OK 2 messages (320 octets) S: 1 120 S: 2 200 S: . C: RETR 1 S: +OK 120 octets S: S: . C: DELE 1 S: +OK message 1 deleted C: RETR 2 S: +OK 200 octets S: C: QUIT S: +OK dewey POP3 server signing off (maildrop empty) C: S: Untuk implementasi tubes progin, protokol di atas disederhanakan saja. Misalnya untuk sendingC: HELO S: OK C: MAIL S: OK C: SNDR user1 password S: OK C: RCPT user2 S: OK C: DATA subject: hello. content: . hello world!. . S: OK C: QUIT S: BYECatatan untuk di atas, mengakhiri bagian data cukup akhiri dengan karakter '\n' dan karakter '.' yang berurutan.
Untuk yang fetching misalnya
C: HELO S: OK C: FTCH S: OK C: LGIN user1 password S: OK C: LIST S: 2 MAIL 1 To: user1. From: user2. Time: 09-03-09 Subject: Hello World. Hello World. . MAIL 2 To: user1 From: user3 Time: 11-05-09 Subject: Hello Lagi. Hello World Lagi. . C: QUIT S: BYEini contoh sederhana aja.... tapi ada beberapa (sedikit) kasus yang harus diperhatikan.....
Implementasinya tinggal gabungin yang ada di Server Tebak-Tebakan ^_^
Filed under: Uncategorized



Ko mereka ga ada yang nge BUZZ or kirim icon emotion gt ya :-0
maksudnya?