#author("2025-06-09T08:14:54+00:00","hhh","hhh") #author("2025-06-09T08:15:02+00:00","hhh","hhh") &size(24){&color(olive){''FreeBSD''};}; #topicpath #contents #br *** dovecot [#qebe5d22] - Message from dovecot-2.3.21.1_2: You must create the configuration files yourself. Copy them over to /usr/local/etc/dovecot and edit them as desired: cp -R /usr/local/etc/dovecot/example-config/* \ /usr/local/etc/dovecot The default configuration includes IMAP and POP3 services, will authenticate users agains the system's passwd file, and will use the default /var/mail/$USER mbox files. Next, enable dovecot in /etc/rc.conf: dovecot_enable="YES" To avoid a risk of mailbox corruption, do not set the security.bsd.see_other_uids or .see_other_gids sysctls to 0 if Dovecot is storing mail for multiple concurrent users (PR 218392). Similarly, setting sysctls security.bsd.hardlink_check_uid or security.bsd.hardlink_check_gid to 1 might result in non-working mailboxes, depending on what mailbox locking mechanism is used (PR 242223). If you want to be able to search within attachments using the decode2text plugin, you'll need to install textproc/catdoc, and one of graphics/xpdf or graphics/poppler-utils. There are some potentially breaking changes in Dovecot 2.3. If you are upgrading from Dovecot 2.2: * https://doc.dovecot.org/2.3/installation_guide/upgrading/from-2.2-to-2.3/ * Merge the configuration file changes from /usr/local/etc/dovecot/examples-config/ *** tcpserver [#p316a2b6] - ports/sysutils/ucspi-tcp # make config SSL make make install make clean *** qmail-tls [#gbfe6ba6] - ports/mail/qmailと排他 - ports/mail/qmail-tls - ATTENTION -- Add the following line to your /etc/make.conf QMAIL_SLAVEPORT=tls -- Do not forget to read /var/qmail/doc/TLS.readme. -- After all, this is NOT our old stock qmail. -- You can enable qmail as your default mailer executing: /var/qmail/scripts/enable-qmail -- As you need to provide a working certificate in /var/qmail/control/cert.pem : # makes a self-signed certificate 3) do "make certificate" # makes a certificate request 4) do "make certificate-req" - dehydrated -- certbotの代替らしい *** qmail [#i5028214] - portconfig - gmake - fakeroot - ucspi-tcp - ports/mail/qmail for the first time make config DISBOUNCES_PATCH DNS_CNAME DOCS LOCALTIME_PATCH OUTGOINGIP_PATCH RCDLINK SMTP_AUTH_PATCH SPF_PATCH make make install pkg lock netqmail make clean - ports/mail/qmail updating make showconfig make pkg unlock netqmail make deinstall make reinstall pkg lock netqmail make clean - rc.conf qmailsend_enable="YES" qmailsmtpd_enable="YES" qmailsubmission_enable="YES" qmailpop3d_enable="YES" sendmail_enable="NO" sendmail_submit_enable="NO" sendmail_outbound_enable="NO" sendmail_msp_queue_enable="NO" - /etc/mail/mailer.conf #sendmail /usr/libexec/sendmail/sendmail #mailq /usr/libexec/sendmail/sendmail #newaliases /usr/libexec/sendmail/sendmail #hoststat /usr/libexec/sendmail/sendmail #purgestat /usr/libexec/sendmail/sendmail sendmail /var/qmail/bin/sendmail mailq /var/qmail/bin/qmail-qread newaliases /var/qmail/bin/newaliases hoststat /var/qmail/bin/qmail-tcpto purgestat /var/qmail/bin/qmail-tcpok - OUTGOINGIP_PATCH control/outgoingip 1.2.3.4 - qmailを使ってる自宅サーバーからGmailに転送するには - https://ameblo.jp/halki/entry-12292187843.html - SPFレコードの書き方とは?記述例を総まとめ - https://baremail.jp/blog/2020/02/28/579/ - /usr/local/etc/nsd IN TXT "v=spf1 +ip4:1.2.3.4" - qmail spf patch - https://www.saout.de/misc/spf/ /var/qmail/control/spfbehavior 3: Reject mails when SPF resolves to fail (deny) - SPF Record Testing Tools - https://www.kitterman.com/spf/validate.html - DOVECOT The Secure IMAP server - https://www.dovecot.org/ *** qmail-dk [#m5914b97] - DomainKeysとDKIMは違う規格 - DomainKeysは古い - libdomainkeys - ports/mail/qmail-dk make config SMTP_AUTH make make install pkg lock qmail-dk - create domainkeys mkdir -p /usr/local/etc/domainkeys/your_domain_name cd /usr/local/etc/domainkeys/your_domain_name /usr/local/share/libdomainkeys/dknewkey default 1024 > default.pub chown -R qmailq:qmail /usr/local/etc/domainkeys chmod 640 /usr/local/etc/domainkeys/your_domain_name/default.pub chmod 600 /usr/local/etc/domainkeys/your_domain_name/default // chown simscan:wheel /usr/local/etc/domainkeys/your_domain_name/default - usage -- 方法1 qmailにQMAILQUEUE patcheをあててenv QMAILQUEUEでqmail-dkを指定 -- port/qmailはすでにQMAILQUEUEを参照するようになっているらしい -- 方法2 qmail-dkをqmail-queueにリネームしてオリジナルを置き換え vi /etc/tcp.smtp 127.:allow,RELAYCLIENT="",QMAILQUEUE="/var/qmail/bin/qmail-dk",DKSIGN="/usr/local/etc/domainkeys/%/default",DKVERIFY="DEGIJKfh" :allow,QMAILQUEUE="/var/qmail/bin/qmail-dk",DKSIGN="/usr/local/etc/domainkeys/%/default",DKVERIFY="DEGIJKfh" tcprules /etc/tcp/tcp.smtp.cdb /etc/tcp/tcp.smtp.tmp < /etc/tcp/tcp.smtp - https://freebsd.sing.ne.jp/daily/09/06/01.html - https://notes.sagredo.eu/en/qmail-notes-185/installing-a-let-s-encrypt-certificate-for-your-qmail-dovecot-and-apache-servers-233.html *** DKIM [#x2e28af6] - dkim - https://sagredo.eu/configuring-dkim-for-qmail-92.html - DKIM test - https://www.appmaildev.com/en/dkim - docker-postfixでDKIM対応送信専用SMTPリレーを立てる - https://qiita.com/macropygia/items/4007981e3cf56827abfb *** vpopmail [#e55d3f79] - ports/mail/vpopmail for the firsttime make config AUTH_LOG DOCS FILE_LOCKING MD5_PASSWORDS ROAMING SEEKABLE SMTP_AUTH_PATCH USERS_BIG_DIR CDB make make install pkg lock vpopmail make clean - ports/mail/vpopmail updating make showconfig make pkg unlock vpopmail make deinstall make reinstall pkg lock vpopmail make clean - SMTP AUTH vpopmail user not found workaround # ls -la /usr/local/vpopmail/bin/vchkpw -rwx--x--x 1 vpopmail vchkpw 110136 Jun 6 09:32 /usr/local/vpopmail/bin/vchkpw # chown root:vchkpw /usr/local/vpopmail/bin/vchkpw # chmod 4711 /usr/local/vpopmail/bin/vchkpw # ls -la /usr/local/vpopmail/bin/vchkpw -rws--x--x 1 root vchkpw 110136 Jun 6 09:32 /usr/local/vpopmail/bin/vchkpw - /usr/local/etc/rc.d rm qmailsmtpd cp /var/qmail/boot/qmailsmtpd . -- qmailsmtpd : ${qmailsmtpd_fqdn:=`cat /var/qmail/control/me`} : ${qmailsmtpd_checkpassword:=/usr/local/vpopmail/bin/vchkpw} -- qmailsubmission -- copy qmailsmtpd and replace 'smtp' with 'submission' - /usr/local/etc/rc.d/qmailpop3d !/bin/sh # PROVIDE: qmailpop3d # REQUIRE: LOGIN cleanvar # KEYWORD: shutdown . /etc/rc.subr name=qmailpop3d rcvar=qmailpop3d_enable load_rc_config $name : ${qmailpop3d_tcpserver:=/usr/local/bin/tcpserver} : ${qmailpop3d_pidfile:=/var/run/qmailpop3d.pid} : ${qmailpop3d_enable:=NO} : ${qmailpop3d_flags="-R -H"} : ${qmailpop3d_host:=0} : ${qmailpop3d_port:=pop3} : ${qmailpop3d_popup:=/var/qmail/bin/qmail-popup} : ${qmailpop3d_fqdn:=`cat /var/qmail/control/me`} : ${qmailpop3d_checkpassword:=/usr/local/vpopmail/bin/vchkpw} : ${qmailpop3d_pop3d:=/var/qmail/bin/qmail-pop3d} start_cmd=qmailpop3d_start start_precmd=qmailpop3d_precmd pidfile=${qmailpop3d_pidfile} procname=${qmailpop3d_tcpserver} qmailpop3d_start() { echo "Starting qmailpop3d." $qmailpop3d_tcpserver $qmailpop3d_flags $qmailpop3d_host $qmailpop3d_port \ $qmailpop3d_popup $qmailpop3d_fqdn $qmailpop3d_checkpassword $qmailpop3d_pop3d Maildir & echo $! > $pidfile } qmailpop3d_precmd() { if ! [ -e "${qmailpop3d_tcpserver}" ]; then echo "sysutils/ucspi-tcp is required" >&2 return 1 fi } run_rc_command "$1" - 初期設定 vi /var/qmail/control/me cp /usr/local/vpopmail/etc/tcp.smtp /etc vadddomain dataz.dyndns.info vaddaliasdomain dataz.dyndns.info `cat /var/qmail/control/me` /usr/local/vpopmail/bin/vadduser hoge@dataz.dyndns.info vi /usr/local/vpopmail/etc/defaultdomain - 設定をミスしてローカル配送されなくなったら qmail[65614]: 1562547200.894274 new msg 5938972 qmail[65614]: 1562547200.894302 info msg 5938972: bytes 214 from <root@wivicom.co.jp> qp 777 uid 0 qmail[65614]: 1562547200.895843 starting delivery 39: msg 5938972 to local root@wivicom.co.jp qmail[65614]: 1562547200.895879 status: local 1/10 remote 0/20 qmail[65614]: 1562547200.898999 new msg 5938960 qmail[65614]: 1562547200.899054 info msg 5938960: bytes 313 from <root@wivicom.co.jp> qp 780 uid 81 qmail[65614]: 1562547200.900425 starting delivery 40: msg 5938960 to local './Maildir/'@ns.wivicom.co.jp qmail[65614]: 1562547200.900462 status: local 2/10 remote 0/20 qmail[65614]: 1562547200.900524 delivery 39: success: did_0+1+0/qp_780/ qmail[65614]: 1562547200.900568 status: local 1/10 remote 0/20 qmail[65614]: 1562547200.900574 end msg 5938972 qmail[65614]: 1562547200.901813 delivery 40: failure: Sorry,_no_mailbox_here_by_that_name._(#5.1.1)/ - domainsを一時退避してvadddmainしてみる。 - postmasterへのローカル配送を確認したらdomainsをもとにもどす。