2015年11月4日水曜日

unbound について

4)  unbound
/etc/resolv.conf nameserver 127.0.0.1 にして /etc/rc.d/unbound -f restart だけで動きます。
http://gihyo.jp/admin/feature/01/unbound/0001  によると以下です。
Unbound は本来はキャシュサーバーなのですが、簡易的なコンテンツサーバとしての機能を持ち,LAN内 のホストの名前の解決などに利用できます。 
なおDNSコ ンテンツサーバは権威サーバとも呼ばれ,自身が権威を持っているゾーンに対する問い合わせのみに回答します。
参考: http://murasaki.cocolog-nifty.com/cloud/2009/07/unbound-1f2d.html




全体の状況は

internet
|
|
|
run0:dhcp
<openbsd(mail+dhcpd server)>
bge0:192.168.11.1
|
|
|
fxp0:dhcp
<PC>

PC send and revieve mail by sylpheed .



サーバーの /etc/dhcpd.intefaces                                       
bge0


サーバーの /etc/dhcpd.conf                                            
option  domain-name-servers 192.168.11.1;
subnet 192.168.11.0 netmask 255.255.255.0 {
        option routers 192.168.11.1;
        range 192.168.11.50 192.168.11.57;
}


サーバーの /etc/resolv.conf                                           
nameserver 127.0.0.1

############# 

以下は不安定ですが 一応ローカルLANでメールの送受信ができます。


/var/unbound/etc/unbound.conf                                        <
-----------------
server:
        interface: 127.0.0.1
        interface: ::1
        access-control: 0.0.0.0/0 refuse
        access-control: 127.0.0.0/8 allow
        access-control: ::0/0 refuse
        access-control: ::1 allow
        hide-identity: yes
        hide-version: yes
###############################--->join name & adress
        interface: 192.168.11.1
        access-control: 192.168.11.0/24 allow
        local-zone: "home." static
        local-data: "server.home.  IN A 192.168.11.1"
        local-data: "kerai.home. IN A 192.168.11.50"
        local-data-ptr: "192.168.11.1   server.home."
        local-data-ptr: "192.168.11.50   kerai.home."
###############################--->to build mail server
 local-data: "home. IN MX 10 server.home."
 local-data-ptr: "192.168.11.1   server.home."



#  /etc/hosts                                                 
-------------------------
127.0.0.1       localhost
::1             localhost
192.168.100.101 aoiyuma.mydns.jp
192.168.11.1    server.home


 
# /etc/myname                                                
-------------------------
aoiyuma.mydns.jp



# /etc/postfix/main.cf                                       
------------------------------------------
myhostname = server.home
mydomain = home
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname localhost.$mydomain
home_mailbox = Maildir/
mynetworks = 192.168.11.0/24, 127.0.0.0/8
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/postfix
mail_owner = _postfix
inet_protocols = all
unknown_local_recipient_reject_code = 550
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/sbin/newaliases
mailq_path = /usr/local/sbin/mailq
setgid_group = _postdrop
html_directory = /usr/local/share/doc/postfix/html
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
readme_directory = /usr/local/share/doc/postfix/readme
meta_directory = /etc/postfix
shlib_directory = no





/etc/postfix/master.cf                                        
--------------------------------------
smtp      inet  n       -       -       -       -       smtpd
pickup    unix  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      unix  n       -       -       300     1       qmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
relay     unix  -       -       -       -       -       smtp
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache



/etc/dovecot/dovecot.conf                                        <
protocols = imap
listen = *
!include conf.d/*.conf




/etc/dovecot/conf.d/10-mail.conf  
   mail_location = maildir:~/Maildir
namespace inbox {
  inbox = yes
}
mmap_disable = yes
first_valid_uid = 1000
mail_plugin_dir = /usr/local/lib/dovecot
mbox_write_locks = fcntl





/etc/dovecot/conf.d/10-master.conf                                        
<
service imap-login {
  inet_listener imap {
  }
  inet_listener imaps {
  }
}
service pop3-login {
  inet_listener pop3 {
  }
  inet_listener pop3s {
  }
}
service lmtp {
  unix_listener lmtp {
  }
}
service imap {
}
service pop3 {
}
service auth {
  unix_listener auth-userdb {
  }
}
service auth-worker {
}
service dict {
  unix_listener dict {
  }
}





 /etc/dovecot/conf.d/10-auth.conf 
auth_mechanisms = plain login
!include auth-system.conf.ext
disable_plaintext_auth = no





/etc/dovecot/conf.d/10-ssl.conf                                        <
ssl = yes
ssl_cert = </etc/ssl/dovecotcert.pem
ssl_key = </etc/ssl/private/dovecot.pem






あとは sylpheed で
メールアドレス t@server.home
imap
送受信さーばー ともに server.home
高度な設定でポートを25と143
にするだけです。

0 件のコメント:

コメントを投稿