Halo, jumpa lagi,
Kita akan belajar bagaimana caranya bikin smokeping latency grapher, semacem ping monitoring gitu lah, yang tujuannya biar monitor berapa sih ping dari server ke target remote dan disertakan dengan log nya, jam sekian intermittent, dlsb.
Baiklah, pertama tama, install dahulu
apt install sendmail sendmail-bin mailutilslalu
mkdir -m 700 /etc/mail/authinfolalu edit file gmail-smtp-auth
/etc/mail/authinfo/gmail-smtp-authkemudian isikan
AuthInfo: "U:root" "I:USER@gmail.com" "P:GMAIL_USER_PASSWORD"sesuaikan dengan email gmail anda dan passwordnya
sekarang generate sendmail gmail authentication
makemap hash /etc/mail/authinfo/gmail-smtp-auth < /etc/mail/authinfo/gmail-smtp-authjika sudah akan terbentuk file /etc/mail/authinfo/gmail-smtp-auth.db
kemudian edit file /etc/mail/sendmail.mc
di baris paling bawah, ubah setingan seperti berikut ini
dnl #kemudian eksekusi
dnl # Defining Gmail Smarthost for sendmail
define(`SMART_HOST',`[smtp.gmail.com]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/gmail-smtp-auth.db')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
make -C /etc/mailDONE!
...
Creating /etc/mail/relay-domains
# Optional file...
Updating Makefile ...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/Makefile...
Updating sendmail.cf ...
The following file(s) have changed:
/etc/mail/relay-domains /etc/mail/sendmail.cf
** ** You should issue `/etc/init.d/sendmail reload` ** **
make: Leaving directory '/etc/mail'
jangan lupa reload sendmailnya /etc/init.d/sendmail reload
untuk testnya silahkan bisa lakukan seperti berikut :
echo "This is a test for sendmail gmail relay" | sendmail test-user@gmail.com
0 comments:
Post a Comment