Melihat Header Email

[K]embali menuliskan tugas kuliah. Tugas terakhir dari kuliahnya pak Budi, tentang email attachment. Pertama, saya kirim email berupa lampiran/attachment dari alamat kampus ke gmail saya. Ada dua email, pertama berisi attachment gambar, yang kedua attachment file teks (.txt). Tak perlu diceritakan kan bagaimana caranya? :D. Berikut header email yang terkirim.

Delivered-To: usermail[at]gmail.com
Received: by 10.220.4.195 with SMTP id 3cs81479vcs;
        Thu, 1 Dec 2011 17:00:22 -0800 (PST)
Received: by 10.68.72.234 with SMTP id g10mr9311896pbv.94.1322787620502;
        Thu, 01 Dec 2011 17:00:20 -0800 (PST)
Return-Path: <emailasal[at]students.itb.ac.id>
Received: from mx4.ITB.ac.id (mx4.itb.ac.id. [167.205.1.69])
        by mx.google.com with ESMTP id i5si5221759pbv.37.2011.12.01.17.00.19;
        Thu, 01 Dec 2011 17:00:20 -0800 (PST)
Received-SPF: pass (google.com: domain of emailasal[at]students.itb.ac.id designates 167.205.1.69 as permitted sender) client-ip=167.205.1.69;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of emailasal[at]students.itb.ac.id designates 167.205.1.69 as permitted sender) smtp.mail=emailasal[at]students.itb.ac.id
Received: from av1.itb.ac.id (av1.itb.ac.id [167.205.1.71])
	by mx4.ITB.ac.id (Postfix) with ESMTP id C053A7B3E
	for <usermail[at]gmail.com>; Fri,  2 Dec 2011 07:59:54 +0700 (WIT)
Virus-Scanned: antivirus1-ITB-slb
Received: from mx4.ITB.ac.id ([167.205.1.69])
	by av1.itb.ac.id (av1.itb.ac.id [167.205.1.73]) (amavisd-new, port 10004)
	with ESMTP id axwZIKUFpERl for <usermail[at]gmail.com>;
	Fri,  2 Dec 2011 07:59:46 +0700 (WIT)
Received: from students.itb.ac.id (students.itb.ac.id [167.205.1.72])
	by mx4.ITB.ac.id (Postfix) with ESMTP id B480D7B34
	for <usermail[at]gmail.com>; Fri,  2 Dec 2011 07:59:36 +0700 (WIT)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by students.itb.ac.id (Postfix) with ESMTP id CA54265151DF
	for <usermail[at]gmail.com>; Fri,  2 Dec 2011 07:59:29 +0700 (WIT)
X-Virus-Scanned: amavisd-new at students.itb.ac.id
Received: from students.itb.ac.id ([127.0.0.1])
	by localhost (students.itb.ac.id [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id UisDqbcyf97s for <usermail[at]gmail.com>;
	Fri,  2 Dec 2011 07:59:29 +0700 (WIT)
Received: from students.itb.ac.id (localhost.localdomain [127.0.0.1])
	by students.itb.ac.id (Postfix) with ESMTP id 3040D65151D9
	for <usermail[at]gmail.com>; Fri,  2 Dec 2011 07:59:29 +0700 (WIT)

Date: Fri, 2 Dec 2011 07:59:27 +0700 (WIT)
From: Hanhan Husna <emailasal[at]students.itb.ac.id>
To: hahn  <usermail[at]gmail.com>
Message-ID: <2101547024.30841.1322787567816.JavaMail.root[at]students.itb.ac.id>
In-Reply-To: <1543924981.30838.1322787562983.JavaMail.root[at]students.itb.ac.id>
Subject: kirim attachment teks
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_Part_30840_412065736.1322787567815"
X-Originating-IP: [114.79.11.31]
X-Mailer: Zimbra 6.0.7_GA_2473.RHEL5_64 (ZimbraWebClient - SAF3 (Linux)/6.0.7_GA_2473.RHEL5_64)

------=_Part_30840_412065736.1322787567815

Bagian header dapat dianalogikan sebagai amplop surat. Berdasarkan RFC 5322, di bagian ini minimal harus terdapat siapa pengirimnya (From) dan waktu (origin-date). Selain itu bagian Message-ID dan in-reply-to disarankan untuk ada.

Namun biasanya sekarang header email sangatlah lengkap (lihat di atas). Ada sender, To, Subject, dll. Bagian header ini ditutup dengan baris baru dan ——=_Part_xxxxx.

Masuk ke bagian body. Berikut isi email yang dikirim

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

ini harus bener, attachmentnya .txt

------=_Part_30840_412065736.1322787567815

berikut file yang dilampirkan.

Content-Type: text/plain; name=alin.txt
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=alin.txt

VHJhbnNsYXNpIFZla3Rvcgp0cmFuc2xhc2kgc2VidWggdmVrdG9yIGFkYWxhaCB0cmFuc2Zvcm1h
c2kgUCh4LHkpIGtlIHRpdGlrIFAnKHgnLHknKSBkZW5nYW4gbWVuYW1iYWhrYW4ga29uc3RhbnRh
IChoLGspIHNlZGVtaWtpYW4gc2VoaW5nZ2EgeCcgPSB4ICsgaCwgeScgPSB5ICsgawpKaWthIGRp
dHVsaXMgZGFsYW0gYmVudHVrIHZla3RvciwgbWFrYSB0cmFuc2xhc2kgUCBrZSBQJyBhZGFsYWgg
Cih4J3knKSA9ICh4LHkpICsgKGgsaykgCgpjb250b2gsIEEgKDEsMSksIEIoMywxKSwgQygyLDIp
LCBEKDEuNSwzKSBha2FuIGRpdHJhbnNsYXNpa2FuIGtlIFQoMywtMikuIE1ha2EgCgpBJyA9ICgx
LDEpICsgKDMsLTIpID0gKDQsIC0xKSAKQicgPSAoMywxKSArICgzLC0yKSA9ICg2LCAtMSkKQycg
PSAoMiwyKSArICgzLC0yKSA9ICg1LCAwKQpEJyA9ICgxLjUsMykgKyAoMywtMikgPSAoMy41LDEp
CgpTa2FsYSAoc2NhbGluZykKQWRhbGFoIHRyYW5zZm9ybWFzaSB2ZWt0b3IgUCh4LHkpIGtlIFAn
KHgnLHknKSBkZW5nYW4gbWVuZ2FsaWthbiBrb29yZGluYXQgeCBkYW4geSBvbGVoIGtvbnN0YW50
YSB0YWsgbm9sIHN4LHN5Cgo=
------=_Part_30840_412065736.1322787567815--

Di bagian ini terlihat jika yang dilampirkan adalah file teks dengan nama alin.txt. Untuk keamanan, lampiran ini dienkripsi dengan base64. Bagian berikutnya adalah file yang sudah dikodekan jadi tidak terbaca langsung.

Tapi ketika saya coba lampirkan file teks yang tidak pakai akhiran *.txt ternyata tidak diencoding -___-. Contohnya seperti ini:

Content-Type: application/octet-stream; name=tugas_email
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=tugas_email

yang dilakukan:
hahn[at]matcherapy:~$ telnet students.itb.ac.id 25
Trying 167.205.1.72...
Connected to students.itb.ac.id.
Escape character is '^]'.
220 students.itb.ac.id ESMTP Postfix
Helo localhost
250 students.itb.ac.id
421 4.4.2 students.itb.ac.id Error: timeout exceeded
Connection closed by foreign host.
hahn[at]matcherapy:~$ telnet students.itb.ac.id 25
Trying 167.205.1.72...

[..dst, panjang isinya -_-]

Ada komentar?

%d bloggers like this: