作者 主題: 請教用Postfix+Dovecot+MySQL收發信的問題  (閱讀 2261 次)

0 會員 與 1 訪客 正在閱讀本文。

cindywill317

  • 可愛的小學生
  • *
  • 文章數: 1
    • 檢視個人資料
更新一下~後來全部打掉重練了,謝謝 :)

各位前輩大家好!
最近在Linux Debian10上架設了mail server
一步一步照著教學做了
結果收、發信還是都不行..
目前Postfix有正常運作
(雖然顯示exited,但爬文後好像這是Debian的bug?似乎不影響?)
Dovecot跟MySQL也有正常運作
新手卡在這裡好久..希望有人能幫忙求解!萬分感謝!

這邊附上一些資訊
maillog
代碼: [選擇]
Feb  7 04:35:44 localhost postfix/cleanup[24415]: fatal: trace: remove 3470F1ECCF log: Permission denied
Feb  7 04:35:44 localhost postfix/cleanup[24416]: fatal: trace: remove 3795E1ECD2 log: Permission denied
Feb  7 04:35:45 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/cleanup pid 24415 exit status 1
Feb  7 04:35:45 localhost postfix/master[22985]: warning: /usr/lib/postfix/sbin/cleanup: bad command startup -- throttling
Feb  7 04:35:45 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/cleanup pid 24416 exit status 1
Feb  7 04:35:45 localhost postfix/smtpd[24402]: fatal: unable to connect to the public cleanup service
Feb  7 04:35:46 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/smtpd pid 24402 exit status 1
Feb  7 04:35:46 localhost postfix/master[22985]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling
Feb  7 04:35:46 localhost postfix/cleanup[24417]: fatal: trace: remove 395B41ECCF log: Permission denied
Feb  7 04:35:47 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/cleanup pid 24417 exit status 1
Feb  7 04:35:54 localhost postfix/master[22985]: warning: master_wakeup_timer_event: service pickup(public/pickup): Resource temporarily unavailable
Feb  7 04:36:02 localhost postfix/qmgr[24426]: fatal: scan_dir_push: open directory deferred/7: Permission denied
Feb  7 04:36:03 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/qmgr pid 24426 exit status 1
Feb  7 04:36:03 localhost postfix/master[22985]: warning: /usr/lib/postfix/sbin/qmgr: bad command startup -- throttling
Feb  7 04:36:46 localhost postfix/cleanup[24434]: fatal: defer: remove 484BE1ECCF log: Permission denied
Feb  7 04:36:47 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/cleanup pid 24434 exit status 1
Feb  7 04:36:47 localhost postfix/master[22985]: warning: /usr/lib/postfix/sbin/cleanup: bad command startup -- throttling
Feb  7 04:36:48 localhost postfix/cleanup[24435]: fatal: defer: remove 4CE921ECCF log: Permission denied
Feb  7 04:36:49 localhost postfix/master[22985]: warning: process /usr/lib/postfix/sbin/cleanup pid 24435 exit status 1
Feb  7 04:36:54 localhost postfix/master[22985]: warning: master_wakeup_timer_event: service pickup(public/pickup): Resource temporarily unavailable

/etc/postfix/main.cf

代碼: [選擇]
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/letsencrypt/live/mydomain.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mydomain.com/privkey.pem
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous

# Authentication
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

# Restrictions
smtpd_helo_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_invalid_helo_hostname,
        reject_non_fqdn_helo_hostname
smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_recipient,
        reject_unknown_recipient_domain,
        reject_unlisted_recipient,
        reject_unauth_destination
smtpd_sender_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_sender,
        reject_unknown_sender_domain
smtpd_relay_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        defer_unauth_destination

# Milter configuration
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:/opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydomain = mydomain.com
myorigin = $mydomain
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

# Handing off local delivery to Dovecot's LMTP, and telling it where to store mail
virtual_transport = lmtp:unix:private/dovecot-lmtp

# Virtual domains, users, and aliases
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,
        mysql:/etc/postfix/mysql-virtual-email2email.cf

# Even more Restrictions and MTA params
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
#smtpd_etrn_restrictions = reject
#smtpd_reject_unlisted_sender = yes
#smtpd_reject_unlisted_recipient = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtp_always_send_ehlo = yes

#smtpd_hard_error_limit = 1
smtpd_timeout = 30s
smtp_helo_timeout = 15s
smtp_rcpt_timeout = 15s
smtpd_recipient_limit = 40
minimal_backoff_time = 180s
maximal_backoff_time = 3h

# Reply Rejection Codesinvalid_hostname_reject_code = 550
non_fqdn_reject_code = 550
unknown_address_reject_code = 550
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550

另外,在configure DKIM時的OpenDKIM也是無法運作..
不知道有沒有相關聯?
也順便附上 OpenDKIM status

代碼: [選擇]
opendkim.service - OpenDKIM DomainKeys Identified Mail (DKIM) Milter
   Loaded: loaded (/lib/systemd/system/opendkim.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2021-02-07 03:38:35 CST; 4s ago
     Docs: man:opendkim(8)
           man:opendkim.conf(5)
           man:opendkim-genkey(8)
           man:opendkim-genzone(8)
           man:opendkim-testadsp(8)
           man:opendkim-testkey
           http://www.opendkim.org/docs.html
  Process: 23469 ExecStart=/usr/sbin/opendkim -x /etc/opendkim.conf (code=exited, status=0/SUCCESS)
 Main PID: 23470 (code=exited, status=69)

Feb 07 03:38:35 myhostname systemd[1]: opendkim.service: Main process exited, code=exited, status=69/UNAVAILABLE
Feb 07 03:38:35 myhostname systemd[1]: opendkim.service: Failed with result 'exit-code'.
Feb 07 03:38:35 myhostname systemd[1]: opendkim.service: Service RestartSec=100ms expired, scheduling restart.
Feb 07 03:38:35 myhostname systemd[1]: opendkim.service: Scheduled restart job, restart counter is at 5.
Feb 07 03:38:35 myhostname systemd[1]: Stopped OpenDKIM DomainKeys Identified Mail (DKIM) Milter.
Feb 07 03:38:35 myhostname systemd[1]: opendkim.service: Start request repeated too quickly.
Feb 07 03:38:35 myhostname systemd[1]: opendkim.service: Failed with result 'exit-code'.
Feb 07 03:38:35 myhostname systemd[1]: Failed to start OpenDKIM DomainKeys Identified Mail (DKIM) Milter.

« 上次編輯: 2021-02-08 01:41 由 cindywill317 »