Score:0

I can't receive emails with Foxmail, but the email has been received locally

cn flag

Maillog doesn't show any errors. I see a new email in my /home/mail/domain/www3/new. I just can't read the email by using the client or telnet 110/143. Dovecot info The log doesn't seem to show any errors. I don't know what to do. Everything shows that there seems to be no problem. /etc/postfix/main.cf have some configurations:

ssqueue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = all
inet_protocols = all
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
virtual_uid_maps = static:200 
virtual_gid_maps = static:12
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
virtual_alias_maps = pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf 
virtual_mailbox_domains = pgsql:/etc/postfix/pgsql/virtual_domains_maps.cf 
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql/virtual_mailbox_maps.cf 
virtual_mailbox_base = /home/mail 
relay_domains = $mydestination, proxy:pgsql:/etc/postfix/pgsql/relay_domains.cf
virtual_mailbox_limit = 512000000 
virtual_minimum_uid = 8
virtual_transport = virtual 
local_transport = virtual 
local_recipient_maps = $virtual_mailbox_maps 

dovecot.conf have some configurations:

dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
 #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
!include conf.d/*.conf
mail_location = maildir:/home/mail/%u/
namespace inbox {
  type = private
  inbox = yes
  location =
mailbox Drafts {
  special_use = \Drafts
}
mailbox Junk {
  special_use = \Junk
}
mailbox Sent {
  special_use = \Sent
}
mailbox "Sent Messages" {
  special_use = \Sent
}
mailbox Trash {
  special_use = \Trash
}
prefix =
}
protocols = imap pop3 lmtp
ssl = no
login_greeting = mail.xxxxxx.com
auth_mechanisms = plain login
auth_debug = yes
auth_debug_passwords = yes
service auth {
  # Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
    mode = 0660
    user = postfix
    group = postfix
  }
  # Auth process is run as this user.
  user = postfix
  group = postfix
}
service imap {
    executable = imap
}
userdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}
passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf
}
first_valid_uid = 200 
mail_uid = 200 
mail_gid = 12
disable_plaintext_auth = no
mail_plugins = $mail_plugins zlib
plugin {
    zlib_save_level = 6
    zlib_save = gz
}
protocol imap {
    mail_plugins = $mail_plugins imap_zlib
}
 mail_max_userip_connections = 50
log_path = /var/log/dovecot.log
info_log_path = /var/log/dovecot-info.log

dovecot-sql.conf have some configurations:

driver = pgsql
connect = host=localhost dbname=postfix user=postfix password=xxxxxxxx
default_pass_scheme = MD5-CRYPT
password_query = SELECT username AS user,password FROM mailbox WHERE username = '%u' 
AND active='1'
user_query = SELECT '/home/mail/' || maildir AS home, 200 as uid, 12 as gid FROM 
mailbox WHERE username = '%u' AND active = '1'

virtual_mailbox_maps or others like this:

user = postfix
password = xxxxxxxx
hosts = localhost
dbname = postfix
query = SELECT maildir FROM mailbox WHERE username='%s' AND active = true

Other configurations should be irrelevant.Can anyone help me, because all the information seems to indicate that they are normal, but I can't get the expected results.Thanks.By the way, I can use Foxmail to send mail. maillog:

Mar 31 15:33:40 mail postfix/master[28261]: daemon started - 
version 2.10.1, configuration /etc/postfix
Mar 31 15:33:58 mail postfix/smtpd[28327]: connect from 
xmbg7.mail.xx.com[101.91.43.51]
Mar 31 15:33:58 mail postfix/smtpd[28327]: D0F0D1413AC: 
client=xmbg7.mail.xx.com[101.91.43.51]
Mar 31 15:33:59 mail postfix/cleanup[28335]: D0F0D1413AC: 
message-id=<[email protected]>
Mar 31 15:33:59 mail postfix/qmgr[28263]: D0F0D1413AC: from= 
<[email protected]>, size=2746, nrcpt=1 (queue active)
Mar 31 15:33:59 mail postfix/virtual[28337]: D0F0D1413AC: to= 
<[email protected]>, relay=virtual, delay=0.26, 
delays=0.24/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to 
maildir)

Mar 31 15:33:59 mail postfix/qmgr[28263]: D0F0D1413AC: removed

Score:1
in flag

Dovecot searches for your e-mail in mail_location+username

mail_location = maildir:/home/mail/%u/

The normal behavior of postfix virtual delivery agent is to store them in virtual_mailbox_base+domain+username (documentation here) just like you mentioned:

I see a new email in my /home/mail/domain/www3/new

Using postfix virtual as delivery agent is not very practical. It lacks one of the most critical features: quota.

I suggest you use dovecot lmtp as delivery agent instead since dovecot lmtp has far more features.

If you still want to keep using postfix virtual delivery agent make sure your user_query takes in consideration the 'domain' part of the maildir location.

恋なつ avatar
cn flag
i just changed SELECT '/home/mail/' || maildir AS home to As mail ,it can receive the mail
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.