Bab5 - Sendmail

  • Uploaded by: Eli Priyatna
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Bab5 - Sendmail as PDF for free.

More details

  • Words: 1,838
  • Pages: 45
Penggunaan Sendmail Akhmad Daniel Rudi Nursasono IUC on Microelectronics ITB Computer Network Research Group ITB - 1995

Slide - 1

Pokok Bahasan ■ ■ ■ ■ ■

Menjalankan Sendmail Sebagai Daemon Sendmail aliases File sendmail.cf Konfigurasi sendmail.cf Rewriting mail address

Computer Network Research Group ITB - 1995

Slide - 2

Objektif Mampu mengkonfigurasi sendmail pada UNIX ■ Mampu menggunakan sendmail ■

Computer Network Research Group ITB - 1995

Slide - 3

Overview Sendmail dibuat untuk mengatasi masalah dalam konfigurasi bermacam-macam program dan protocol yang digunakan untuk e-mail yang memiliki delivery program dan addressing scheme yang berbeda

Computer Network Research Group ITB - 1995

Slide - 4

Fungsi sendmail ■

■ ■

Mengirim mail ke seorang user dengan program delivery yang cocok yang berdasarkan kepada alamat e-mail. Menerima dan mengirim internet (SMTP) mail Menyediakan system-wide mail aliases, sehingga memungkinkan mailing lists

Computer Network Research Group ITB - 1995

Slide - 5

Fungsi sendmail bin/mail

/usr/ucb/mail

/usr/new/mh

Senmail

UUCP

Computer Network Research Group ITB - 1995

TCP/IP

Local

Slide - 6

Menjalankan sendmail sebagai Daemon if [ -f /usr/lib/sendmail ]; then (cd /usr/spool/mqueue; rm -f lf*) /usr/lib/sendmail -bd -q1h; echo -n ' sendmail' > /dev/console fi

Computer Network Research Group ITB - 1995

Slide - 7

Sendmail aliases ■

Gunanya: – alternate name untuk setiap user – forwarding mail ke host lain – mailing list



Basic Format file /etc/aliases: – alias_name: recipient1[ ,recipient2, ...]

Computer Network Research Group ITB - 1995

Slide - 8

Sendmail aliases Contoh file /etc/aliases #special name postmaster: adnan root: arman #accept [email protected] rudi: [email protected] daniel: daniel@cnrg #a mailing list admin: adnan, ismail, arman, [email protected], tetih@biotek owner-admin: arman Computer Network Research Group ITB - 1995

Slide - 9

Personal mail forwarding Dilakukan dengan membuat file .forward yang berisi alamat tujuan pada home directory ■ Contoh file .forward ■

[email protected]

Computer Network Research Group ITB - 1995

Slide - 10

File sendmail.cf Fungsi utama: ■ definisi sendmail environment ■ rewrite address kedalam bentuk yang tepat bagi mailer penerima ■ map address ke instruksi yang diperlukan untuk mengirim mail

Computer Network Research Group ITB - 1995

Slide - 11

Mendapatkan sample file sendmail.cf ftp.uu.net mail/sendmail/sendmail.5.65.tar.Z Berisi beberapa prototype file: ■ tcpuucpproto.cf ■ tcpproto.cf ■ uucpproto.cf

Computer Network Research Group ITB - 1995

Slide - 12

General sendmail.cf structure Local Information General Macro Classes Version Number Special Macro Option Message Precedence Trusted User Format of Header Rewriting Rules Mailers Rule Set Zero Machine-dependent Part of Rule Set Zero Computer Network Research Group ITB - 1995

Slide - 13

Konfigurasi sendmail Define Macro Define Class Define Class Set Option Trusted Users Set Precedence Define Mailer Define Header Set Ruleset Define Rule

Dxvalue Ccword1[ word2]... Fcfile Oovalue Tuser1[ user2...] Pname=number Mname,{field=value} H[?mflag?]name:format Sn Rlhs rhs comment

Computer Network Research Group ITB - 1995

Set Macro x to value Set class c to word1 word2 ... Load class c from file Set option o to value Trusted users are user1,user2, ... Set name to precedence number Define mailer name Set header format Start ruleset number n Rewrite lhs pattern to rhs format

Slide - 14

Konfigurasi sendmail DDcnrg.itb.ac.id

■ ■ ■

Define Macro Command Name of the Macro being defined Value assigned to the Macro

Computer Network Research Group ITB - 1995

Slide - 15

Define Macro Command (D) Mendefinisikan macro dan mengisikan nilai padanya. ■ Beberapa macro internal harus didefinisikan, yaitu: ■

Computer Network Research Group ITB - 1995

Slide - 16

Define Macro Command (D) Internal Macro

e j l n o q

SMTP entry mesages site's official ddomain name format of the UNIX from line name used in error message set of operators in addresses default sender address format

Computer Network Research Group ITB - 1995

De$j Sendmail $v ready at $b Dj$w.$D DlFrom $g $d DnMAILER-DAEMON Do.:%\@!^=/ Dq$g$?x ($x)$.

Slide - 17

Define Macro Command (D) ■

■ ■

Internal macro menggunakan huruf kecil, User-defined macro menggunakan huruf besar. Untuk melihat isi dari macro digunakan tanda $ Contoh

Dwalmond DDnuts.com Dj$w.$D

Computer Network Research Group ITB - 1995

Slide - 18

Conditional ■



Macro q mengandung conditional Dq$g$?x ($x)$. Jika g berisi [email protected] dan x berisi Yeni Marlina maka q akan berisi [email protected] (Yeni Marlina)

Computer Network Research Group ITB - 1995

Slide - 19

Conditional ■



Conditional dapat berupa konstruksi "else", dilambangkan dengan $| Sintaksnya $?x text1 $| text2 $.

Computer Network Research Group ITB - 1995

Slide - 20

Define Class Macro (C atau F) Class adalah array of value ■ Digunakan untuk segala sesuatu yang memiliki bermacam-macam harga tapi ditangani dengan cara yang sama ■

Computer Network Research Group ITB - 1995

Slide - 21

Define Class Macro (C atau F) ■

Contoh CVbronson ora CVbronson CVora Fw/etc/sendmail.cw

Computer Network Research Group ITB - 1995

Slide - 22

Set Option Command (O) Assign values to sendmail options ■ Tidak ada user-created option ■

Computer Network Research Group ITB - 1995

Slide - 23

Set Option Command (O) Afile define the name of alias file aN wait N minutes for @:@; the rebuild the alias file Bc define the blank subtitution file c queue mail for expensive mailers D rebuild the alias database db deliver in background mode ..

Computer Network Research Group ITB - 1995

Slide - 24

Set Option Command (O) ■

Contoh OA/usr/lib/aliases OF0600 OT3d

Computer Network Research Group ITB - 1995

Slide - 25

Defining Trusted Users (T) ■



Mendefinisikan user yang dapat dipercaya untuk mengganti alamat pengirim dengan menggunakan flag -f dari mailer. Paling umum Troot Tdaemon Tuucp

Computer Network Research Group ITB - 1995

Slide - 26

Defining Mail Predence (P) Untuk menentukan prioritas messasge dalam antriannya ■ Contoh ■

Pfirst-class=0 Pspecial-delivery=100 Pbulk=-60 Pjunk=-100 Computer Network Research Group ITB - 1995

Slide - 27

Defining Mail Header (H) Mendefinisikan format header yang disertakan dalam message. ■ Header flag terdapat beberapa tanda tanya, menentukan apakah header itu disertakan atau tidak untuk suatu mailer tertentu. ■

Computer Network Research Group ITB - 1995

Slide - 28

Defining Mail Header (H) ■

Contoh H?P?Return-Path: <$g> HReceived:$?sfrom $s $.by $j ($v/$Z) H?D?Recent-Date: $a H?D?Date: $a H?F?Resent-From: $q H?F?From: $q H?x?Full-Name: $x HSubject: H?M?Resent-Message-Id: <$t.$i@$j> H?M?Message-Id: <$t.$i@$j>

Computer Network Research Group ITB - 1995

Slide - 29

Defining Mailer (M) Mendefinisikan program mailer yang dipakai sendmail ■ Sintaks: Mname, {field=value} ■

Computer Network Research Group ITB - 1995

Slide - 30

Defining Mailer (M) Mailer Definition Fields P F S R A E M

Path Path of the mailer P=/bin/mail Flags sendmail flags for this mailer F=lsDFMe Sender Ruleset for sender addresses S=10 Recipient Ruleset for recipient addresses R=20 Argv The mailer argument vector A=sh -c $u Eol End-of-line string for the mailer E=\r\n Maxsize Maximum message length M=100000

Computer Network Research Group ITB - 1995

Slide - 31

Defining Mailer (M) ■

Contoh:

Mlocal, P=/bin/mail, F=rlsDFMmn, S=10, R=20, A=mail -d $u Mprog, P=/bin/sh, F=lsDFMe, S=10, R=20, A=sh -c $u Mtcp, P=[IPC], F=mDFMueXLC, S=14, R=24, A=IPC $h, E=\r\n

Computer Network Research Group ITB - 1995

Slide - 32

Rewriting Mail Address ■

Sintaks:

Rpattern ■

transformation

comment

Pattern Matching: $* $+ $$=x $~x $x $%x $!X $%y

Match zero or more tokens Match one or more tokens Match exactly one token Match any token in class x Match any token not in class x Match all token in macro x Match any token in NIS map named in macro x Match any token not in NIS map named in macro x Match any token in the NIS hosts.byname map

Computer Network Research Group ITB - 1995

Slide - 33

Rewriting Mail Address Token adalah string dalam e-mail address yang dipisahkan oleh operator ■ Contoh : alamat [email protected] mengandung token: tetih, @, cnrg, . , itb, . , ac, . , id. ■ Alamat itu akan match dengan pattern: $-@ $+ ■

Computer Network Research Group ITB - 1995

Slide - 34

Rewriting Mail Address ■

■ ■ ■

Indefinite token adalah string yang match, dan dinomori berurutan Contoh: address [email protected] Pattern $-@$+ Ada dua indefinite token yaitu $1 yang berisi tetih dan $2 yang berisi cnrg,.,itb,.,ac,.,id



Indefinite token dapat direfer dengan $1, $2, $3 , dan seterusnya.

Computer Network Research Group ITB - 1995

Slide - 35

Transforming the address Mendefinisikan format yang digunakan untuk me-rewrite address ■ Transformation metasimbol ■

$n $[name$] $>n $@ $: Computer Network Research Group ITB - 1995

Substitute indefinite token n Substitute canonical name Call ruleset n Terminate ruleset Terminate rewrite rule Slide - 36

Transforming the address Contoh trasformasi address Address: hunt<@nbsenh.bitnet> Rewrite rule: R$+<@$+.bitnet>

$1%$2@<@SB>

Use the Bitnet relay

Hasil transformasi: hunt%nbsenh<@cunyum.cuny.edu>

Computer Network Research Group ITB - 1995

Slide - 37

Transforming the address address tokens

hunt

< @

| pattrern

$+

nbsenh

.

bitnet

| |

|

|

< @

$+

.

bitnet

| indefinite tokens hunt | transformation $1 | rewritten address hunt

Computer Network Research Group ITB - 1995

|

>

| >

| nbsenh

| %

$2

< @

$B

>

|

|

| |

|

|

%

nbsenh < @ cunyum.cuny.edu >

Slide - 38

Transforming the address ■

■ ■

Symbol $[name$] mengkonversi host's nickname atau IP addressnya kedalam canonical namenya dengan memberikan harga name ke nameserver Symbol $>n memanggil ruleset n. Contoh $>9$1%$2 akan memanggil rulset 9 dan memberikan harga $1, %, $2 kepadanya untuk diproses

Computer Network Research Group ITB - 1995

Slide - 39

Transforming the address ■ ■



Symbol $@ dan $: untuk control processing Jika transformasi diawali dengan $@, ruleset berhenti, dan hasilnya adalah hasil akhir proses transformasi. Jika trasformasi diawali dengan $: ruleset hanya dieksekusi sekali, dapat menghindari loops saat memanggil ruleset lain

Computer Network Research Group ITB - 1995

Slide - 40

Special Rewrite Rule ■



Special rewrite rule syntax yang hanya ada pada ruleset 0 untuk menuliskan $#mailer$@host$:user Rewrite rule: #resolveSMTP traffic R$*<@$+>$* $#tcpld$@$2$:$1<@$2>$3



[email protected]

Address: tetih<@cnrg.itb.ac.id>



Hasil transformasi: $#[email protected]$:tetih<@cnrg.itb.ac.id>

Computer Network Research Group ITB - 1995

Slide - 41

Set ruleset Command (S) Set adalah kumpulan dari ruleset yang dapat di-refer dengan angka. ■ Sintaks: Sn ■

Computer Network Research Group ITB - 1995

Slide - 42

Set ruleset Command (S) ■ ■



■ ■ ■

Rulset yang punya fungsi khusus dalam sendmail: Rulset 3, yang pertama kali dikenakan pada address. Mengkonversi address kedalam bentuk canonical-nya [email protected] Ruleset 0, dikenakan pada recipient address. Menghasilkan triple mailer,host,user. Ruleset 1, dikenakan paad seluruh alamat pengirim Ruleset 2, dikenakan pada seluruh alamat penerima Ruleset 4, dikenakan pada seluruh address. Menterjemahkan internal address format ke dalam external address format

Computer Network Research Group ITB - 1995

Slide - 43

Set ruleset Command (S) 0

delivery address sender address all addresses

3

S R

1

S

D recipient address

D

The (mailer, host, user) triple

4 2

all addresses

R

Sender domain information added Mailer-specific sender rewriting Mailer-specific recipient rewriting

Computer Network Research Group ITB - 1995

Slide - 44

More Information ■



Referensi “TCP/IP Network Administrator”, Craig Hunt, O’Reilly & Associates, Inc. ftp://... sendmail.8.6.12

Computer Network Research Group ITB - 1995

Slide - 45

Related Documents

Bab5 - Sendmail
December 2019 35
Bab5
May 2020 14
Bab5.pdf
November 2019 24
Sendmail Configuration
November 2019 28
Bab5.docx
May 2020 12
Bab5-matriks_invers
July 2020 15

More Documents from ""

Rpp Cikembar Bab 5
December 2019 40
Chapter_6_id
April 2020 20
Sejarah 2000
December 2019 29
Soal Pai Smt 1 Kls X
December 2019 51
Seni Musik
December 2019 46