Home / Zimbra / Blog article: Improving Domain Key di Zimbra

| Mobile | RSS

Improving Domain Key di Zimbra

17th Mar, 2010 | 2 Comments | Posted in Zimbra

Sebelum menambahkan dkfilter dan dkimproxy ke Zimbra (base on postfix) yang harus dilakukan adalah menambahkan domain key record dan public key sebagai TXT ke zone domain di dns server, dalam kasus ini saya menggunakan domain solusismart.com, maka:

# vi /var/named/master/db.solusismart

_domainkey    IN TXT    ”t=y; o=~;”
mailku._domainkey    IN TXT    ”k=rsa; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4a4cabQeTyGOs8p+vcEBMVQUY
uUc/kDET7xC9THPFutMeVvQIUgjWHLlivGDa94fpG0Vn+T1SPUEnkAJjwIBbCFti
kZwEG1D1WdIiY7UxZ5H/XLTj9HVH+8sz5CoPI9mNNRYxr+wa5t997jXUXFB6hwfn
X6anHnnpkNiXC+viJwIDAQAB”

Untuk memeriksa apakah domain key yang ditambahkan ke DNS sudah bekerja maka bisa di check melalui:

http://domainkeys.sourceforge.net/policycheck.html

Jika valid akan muncul keterangan seperti dibawah ini:

Testing solusismart.com

New test

Policy TXT=t=y; o=~;This policy record appears valid.

Tag Value Explanation
o ~ Domain signs some email
t y Domain is in test mode

Step terakhir dari improving domain key filter di zimbra ini adalah memodifikasi master.cf dan master.cf.in agar semua email keluar diberi signature, tambah script-script dibawah ini ke baris paling bawah dari konfigurasi zimbra:

Untuk dkfilter dan dkimproxy:

# vi /opt/zimbra/postfix/conf/master.cf

############
# DKFILTER #
############
#
# modify the default submission service to specify a content filter
# and restrict it to local clients and SASL authenticated clients only
#
submission  inet  n     -       n       -       -       smtpd
-o smtpd_etrn_restrictions=reject
-o smtpd_sasl_auth_enable=yes
-o content_filter=dksign:[127.0.0.1]:10029
-o receive_override_options=no_address_mappings
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

#
# specify the location of the DomainKeys signing filter
#
dksign    unix  -       -       n       -       10      smtp
-o smtp_send_xforward_command=yes
-o smtp_discard_ehlo_keywords=8bitmime

#
# service for accepting messages FROM the DomainKeys signing filter
#
127.0.0.1:10030 inet  n  -      n       -       10      smtpd
-o content_filter=
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o smtpd_authorized_xforward_hosts=127.0.0.0/8

#############
# DKIMPROXY #
#############
#
# modify the default submission service to specify a content filter
# and restrict it to local clients and SASL authenticated clients only
#
submission  inet  n     -       n       -       -       smtpd
-o smtpd_etrn_restrictions=reject
-o smtpd_sasl_auth_enable=yes
-o content_filter=dksign:[127.0.0.1]:10027
-o receive_override_options=no_address_mappings
-o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

#
# specify the location of the DKIM signing proxy
# Note: we allow “4″ simultaneous deliveries here; high-volume sites may
#   want a number higher than 4.
# Note: the smtp_discard_ehlo_keywords option requires Postfix 2.2 or
# better. Leave it off if your version does not support it.
#
dksign    unix  -       -       n       -       4       smtp
-o smtp_send_xforward_command=yes
-o smtp_discard_ehlo_keywords=8bitmime,starttls

#
# service for accepting messages FROM the DKIM signing proxy
#
127.0.0.1:10028 inet  n  -      n       -       10      smtpd
-o content_filter=
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o smtpd_authorized_xforward_hosts=127.0.0.0/8

Restart postix:

# su – zimbra

# postfix reload

Catatan penting: karena dkfilter dan dkimproxy ini bekerja  hanya untuk memberikan signature berupa domain key ke outgoing mail maka agar incoming email tidak di verifikasi maka dkfilter dan dkim menggunakan submission port 587, sehingga untuk seting di email klien port outgoing smtp server harus menggunakan port 587. Untuk meyakinkan apakah domain key bekerja seperti yang kita harapkan, bisa dengan melakukan pengecekan service (hal ini untuk memastikan dkfilter dan dkimproxy bekerja baik meski diawal sudah dilakukan):

# netstat -plan | grep 100

tcp        0      0 127.0.0.1:10027             0.0.0.0:*                   LISTEN      2680/perl
tcp        0      0 127.0.0.1:10028             0.0.0.0:*                   LISTEN      27721/master
tcp        0      0 127.0.0.1:10029             0.0.0.0:*                   LISTEN      2681/perl
tcp        0      0 127.0.0.1:10030             0.0.0.0:*                   LISTEN      27721/master

Kemudian coba kirim email dari email klien agar bisa menggunakan submission port 587, dan ini salah satu contoh header email yang saya kirim:

Authentication-Results: mta140.mail.sg1.yahoo.com  from=solusismart.com; domainkeys=pass (ok);  from=solusismart.com; dkim=pass (ok)
Received: from 202.47.75.4  (EHLO mail.solusismart.com) (202.47.75.4)
by mta140.mail.sg1.yahoo.com with SMTP; Fri, 12 Mar 2010 02:30:33 +0800
Received: from mail.solusismart.com (localhost.localdomain [127.0.0.1])
by mail.solusismart.com (Postfix) with ESMTP id 00A6A54100F1;
Fri, 12 Mar 2010 01:53:26 +0700 (WIT)
DomainKey-Signature: a=rsa-sha1; c=nofws; d=solusismart.com; h=message-id
:date:from:mime-version:to:subject:content-type
:content-transfer-encoding; q=dns; s=mailku; b=IKmY94YugMPgbamNFt1
UlC4uIwQ4/KQALEiUNHcE3Q65MSkt7KtkVo6jP+LdS5Mi/5qofO7Cfp7bCIhih1p
Y1O5s/fM8Xj12MRlO54+44MYTyekkN4fWO0cenzx/q4znns5SxNBwFGt7POG0OdU
lk0XsW5El+6IqZc2zkB69AIo=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=solusismart.com; h=
message-id:date:from:mime-version:to:subject:content-type
:content-transfer-encoding; s=mailku; bh=WorfrZG3bos9HH1Bvmjx7sLtO
aw=; b=YLMqzQqMUgiForN8VYCm+kTVpxF2+6vO/uuls1zs40vVZRi9JOZMGbiBv
EyH2jetuJlv1tT5a3L5FZiPdzLElSiRD9vPiN139Y5l/MHJM0WyRkvylQDqUwLjM
Sa5USYwZiw7ooYcjuc6fsUaiSrUN7iQdG1ipEB6aD1C6odfP80=

Bila diperhatikan maka di potongan header diatas terdapat beberapa parameter yang yang menunjukan bahwa domain key signature telah di approve oleh yahoo, lihat domainkeys=pass, jika gagal biasanya akan menjadi domainkeys=fail atau hardfail. Semoga bermanfaat…

Referensi:
http://www.elandsys.com

http://jason.long.name/dkfilter

http://dkimproxy.sourceforge.net

http://domainkeys.sourceforge.net

Pages: 1 2 3

Leave a Reply 2246 views, 1 so far today
Follow Discussion

2 Responses

  1. mas narto Says:

    ada yang ingin saya tanyakan pak, saat memodifikasi master.cf dan master.cf.in di zimbra, dan postfix sudah direload ternyata file master.cf dan master.cf.in di zimbra kembali ke set awal. dan apabila saya lihat, ternyata file master.cf read only,..apakah ada cara lain untuk mengupdate file master.cf di zimbra..
    Terima Kasih

  2. David Says:

    Hm…., perlu di ubah permission file nya:
    # chmod 711 master.cf
    kemudian nanti ngeditnya menggunakan owner file tsb…

Leave a Reply

*