Beranda > Linux, Tutorial > Konfigurasi Postfix RelayHost SMTP Telkom dan Fetchmail

Konfigurasi Postfix RelayHost SMTP Telkom dan Fetchmail


Persiapan :

  1. Linux Centos 5.4 ( Mail Server Lokal )

–          Postfix

–          Dovecot

–          Cyrus-sasl

–          Fetchmail

  1. ISP TelkomSpeedy
  2. Mail Hosting IdwebHost

Note : Huruf  yang ditebalkan pada konfigurasi postfix yang di edit/tambahkan

Konfigurasi Postfix :

vim /etc/postfix/main.cf

# Global Postfix configuration file. This file lists only a subset

# of all parameters. For the syntax, and for a complete parameter

# list, see the postconf(5) manual page (command: “man 5 postconf”).

# For common configuration examples, see BASIC_CONFIGURATION_README

# and STANDARD_CONFIGURATION_README. To find these documents, use

# the command “postconf html_directory readme_directory”, or go to

# http://www.postfix.org/.

# LOCAL PATHNAME INFORMATION

#

# The queue_directory specifies the location of the Postfix queue.

# This is also the root directory of Postfix daemons that run chrooted.

# See the files in examples/chroot-setup for setting up Postfix chroot

# environments on different UNIX systems.

#

queue_directory = /var/spool/postfix

# The command_directory parameter specifies the location of all

# postXXX commands.

#

command_directory = /usr/sbin

# The daemon_directory parameter specifies the location of all Postfix

# daemon programs (i.e. programs listed in the master.cf file). This

# directory must be owned by root

daemon_directory = /usr/libexec/postfix

 

# QUEUE AND PROCESS OWNERSHIP

#

# The mail_owner parameter specifies the owner of the Postfix queue

# and of most Postfix daemon processes.  Specify the name of a user

# account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS

# AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM.  In

# particular, don’t specify nobody or daemon. PLEASE USE A DEDICATED

# USER.

#

mail_owner = postfix

# The default_privs parameter specifies the default rights used by

# the local delivery agent for delivery to external file or command.

# These rights are used in the absence of a recipient user context.

# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.

#

#default_privs = nobody

# INTERNET HOST AND DOMAIN NAMES

#

# The myhostname parameter specifies the internet hostname of this

# mail system. The default is to use the fully-qualified domain name

# from gethostname(). $myhostname is used as a default value for many

# other configuration parameters.

#menggunkan hostname yolita.internal untuk localhost mail

myhostname = yolita.internal

#myhostname = virtual.domain.tld

# Note: you need to stop/start Postfix when this parameter changes.

inet_interfaces = all

#inet_interfaces = $myhostname

#

mydestination = yolita.co.id, $myhostname, localhost.$mydomain, localhost,

#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,

#  mail.$mydomain, http://www.$mydomain, ftp.$mydomain

mynetworks = 192.168.1.0/24, 127.0.0.0/8

#mynetworks = $config_directory/mynetworks

#mynetworks = hash:/etc/postfix/network_table

#relayhost = [gateway.my.domain]

relayhost = [smtp.telkom.net]

#relayhost = uucphost

#relayhost = [an.ip.add.ress]

#alias_maps = dbm:/etc/aliases

alias_maps = hash:/etc/aliases

 

#alias_maps = hash:/etc/aliases, nis:mail.aliases

#alias_maps = netinfo:/aliases

# The alias_database parameter specifies the alias database(s) that

# tables that are not necessarily all under control by Postfix.

#

#alias_database = dbm:/etc/mail/aliases

alias_database = hash:/etc/aliases

# The home_mailbox parameter specifies the optional pathname of a

# mailbox file relative to a user’s home directory. The default

# mailbox file is /var/spool/mail/user or /var/mail/user.  Specify

# “Maildir/” for qmail-style delivery (the / is required).

#

#home_mailbox = Mailbox

home_mailbox = Maildir/

# For details, see “man header_checks”.

#

header_checks = regexp:/etc/postfix/header_checks

body_checks = regexp:/etc/postfix/body_checks

 

#smtpd_banner = $myhostname ESMTP $mail_name

smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

 

# add at the bottom

# limit an email size 5M

message_size_limit = 504857600

# limit mailbox 100M

mailbox_size_limit = 504857600

# for SMTP-Auth setting

#smtpd_sasl_type = dovecot

#smtpd_sasl_path = smtpd

smtpd_sasl_auth_enable = yes

smtp_sasl_type = cyrus

smtp_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

#password email autentikasi ke provider mail

 smtp_sasl_password_maps = hash:/etc/postfix/passwd

#smtpd_sasl_local_domain = $myhostname

#smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit

#smtpd_recipient_restrictions = #permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject

virtual_alias_maps = hash:/etc/postfix/virtual

#memetakan user local ke user email hosting

smtp_generic_maps = hash:/etc/postfix/generic

 ——————————————————————————————————————–

 [root@server postfix]# vim /etc/postfix/generic

 User1lokal@yolita.internal       user1@domainmailhosting.co.id

User2lokal@yolita.internal       user2@domainmailhosting.co.id

 [root@server postfix]# postmap hash:/etc/postfix/generic  à generate DB postfix

[root@server postfix]# vim /etc/postfix/passwd

 

[smtp.telkom.net]       user1@ domainmailhosting.co.id:1qaz2wsx

                                                                  Username/hosting          Password

[root@server postfix]# postmap hash:/etc/postfix/passwd

 

KONFIGURASI DOVECOT IMAP / DISABLE POP3

[root@server postfix]# vim /etc/dovecot.conf

 

# Protocols we want to be serving: imap imaps pop3 pop3s

# If you only want to use dovecot-auth, you can set this to “none”.

 

protocols = imap imaps

 

#   mail_location = maildir:~/Maildir

#   mail_location = mbox:~/mail:INBOX=/var/mail/%u

#   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n

#

# <doc/wiki/MailLocation.txt>

#

mail_location = maildir:~/Maildir

 

save & exit

 

KONFIGURAS FETCHMAIL

 [root@server postfix]# mkdir /home/fethmail

 [root@server postfix]# vim /home/fetchmail/.fetchmail

 #indra.n

set no bouncemail

poll mail.domainhosting.co.id with protocol POP3, with options

no dns

user “indra@domainhosting.co.id” there with password “k4mpr3t” is indra@yolita.internal here

with options rewrite mimedecode fetchall nokeep

 save & exit

 

Testing kirim dan terima email lokal dan internet :

 

[root@server postfix]# mail indra@yolita.internal à lokal

Subject: test bib  bip

testing testing dites langsung bunting …..

Cc: indra@yolita.internal

 

[root@server postfix]# tail –f /var/log/maillog

 

Jun 22 11:13:44 server postfix/qmgr[17411]: BFF266AA05C3: from=<root@yolita.internal>, size=238, nrcpt=1 (queue active)

Jun 22 11:13:44 server postfix/local[17393]: BFF266AA05C3: to=<indra@yolita.internal>, relay=local, delay=0.11, delays=0.04/0/0/0.07, dsn=2.0.0, status=sent (delivered to maildir)

Test kirim email ke YAHOO dan GMAIL dari mail klien.

Untuk testing kirim ke internet gunakan mail klien, thunderbird,outlook expres.

Username : Nama user untuk kirim email

User email : namasuer@domainhosting.co.id

 

Smtp : alamat IP server postfix

IMAP : alamat IP server Dovecot

 Username : user local di server postfix

Password : password local di server postfix

 Save & exit

 

Lihat log file di server postfix :

 [root@server postfix]# tail –f /var/log/maillog

 

Jun 22 11:24:40 server postfix/smtp[17583]: 3055E6AA0540: to=<userxxxx@gmail.com>, relay=smtp.telkom.net[222.124.18.79]:25, delay=4.1, delays=0.05/0.01/1/3, dsn=2.0.0, status=sent (250 2.0.0 p5M4eCCu025792-p5M4eCCv025792 Message accepted for delivery)

Jun 22 11:24:40 server postfix/smtp[17583]: 3055E6AA0540: to=<userxxx@yahoo.com>, relay=smtp.telkom.net[222.124.18.79]:25, delay=4.1, delays=0.05/0.01/1/3, dsn=2.0.0, status=sent (250 2.0.0 p5M4eCCu025792-p5M4eCCv025792 Message accepted for delivery)

Jun 22 11:24:40 server postfix/qmgr[17411]: 3055E6AA0540: removed

 

 

Test terima email dari domain internet YAHOO & GMAIL, etc :

 

  1. Reply / buat email dari account yahoo & gmail kirim ke user email    domainhosting.co.id
  2. Gunakan fetchmail untuk mengunduh email dari provider mail hosting

 

[root@server ~]# fetchmail -f /home/fetchmail/.fetchmail

 

 Gunakan crontab untuk menjadwalkan pengunduhan email dari provider mail hosting

[root@server ~]# crontab  -e

 

*/5 *    *   *   *  fetchmail -f /home/fetchmail/.fetchmail >> /dev/null 2>&1

 

Save & exit

 

Penjadwalan unduh dari provider email hosting setiap 5 menit sekali.

Iklan
Kategori:Linux, Tutorial
  1. Belum ada komentar.
  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: