Skip to content

other: DockerMailserver无法给qq邮箱发送邮件 #3352

@wang-dagou

Description

@wang-dagou

Subject

I would like to contribute to the project

Description

Docker Mailserver cannot send mail to QQmail after logging in through LDAP authentication, because the recipient's LDAP authentication is performed when sending mail to QQmail, but this error will not occur when sending mail to other mailboxes, such as mailbox 163. My Lucky Star, my Docker Mailserver can log in through the mail configured in LDAP, but when it is sent to QQmail, it will encounter the following error:

mailserver  | May 18 05:42:42 mail postfix/smtp-amavis/smtp[1036]: 4D765A0192A0: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.27, delays=0.13/0.01/0/0.12, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 87D5EA0192A1)
mailserver  | May 18 05:42:42 mail postfix/qmgr[905]: 4D765A0192A0: removed
mailserver  | May 18 05:42:42 mail dovecot: lmtp(1042): Connect from local
mailserver  | May 18 05:42:42 mail dovecot: auth: ldap([email protected]): unknown user
mailserver  | May 18 05:42:42 mail postfix/lmtp[1041]: 87D5EA0192A1: to=<[email protected]>, relay=mail.sichuancredit.cn[/var/run/dovecot/lmtp], delay=0.12, delays=0.02/0.01/0.01/0.08, dsn=5.1.1, status=bounced (host mail.sichuancredit.cn[/var/run/dovecot/lmtp] said: 550 5.1.1 <[email protected]> User doesn't exist: [email protected] (in reply to RCPT TO command))

After failing to send an email, I will receive an email informing me why I cannot send the email:

This is the mail system at host mail.sichuancredit.cn.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

              The mail system
<[email protected]>: host mail.sichuancredit.cn[/var/run/dovecot/lmtp] said:
    550 5.1.1 <[email protected]> User doesn't exist: [email protected] (in
    reply to RCPT TO command)

The following is the configuration of environment variables in my Docker Compose file:

    environment:
      - ENABLE_SPAMASSASSIN=0
      - SPAMASSASSIN_SPAM_TO_INBOX=1
      - ENABLE_CLAMAV=1
      - ENABLE_FAIL2BAN=1
      - ENABLE_POSTGREY=0
      - ONE_DIR=1

      - ACCOUNT_PROVISIONER=LDAP
      - LDAP_SERVER_HOST=xxxx:10389
      - LDAP_SEARCH_BASE=ou=users,dc=ldap,dc=sichuancredit,dc=cn
      - LDAP_BIND_DN=cn=admin,dc=ldap,dc=sichuancredit,dc=cn
      - LDAP_BIND_PW=xxxxx
      #- LDAP_QUERY_FILTER_USER=(&(|(objectClass=inetOrgPerson))(|(memberOf=cn=mail,ou=groups,dc=ldap,dc=sichuancredit,dc=cn)(memberOf=cn=sichuancredit,ou=groups,dc=ldap,dc=sichuancredit,dc=cn))(mail=%u))
      - LDAP_QUERY_FILTER_USER=(&(|(objectClass=inetOrgPerson))(|(memberOf=cn=mail,ou=groups,dc=ldap,dc=sichuancredit,dc=cn)(memberOf=cn=sichuancredit,ou=groups,dc=ldap,dc=sichuancredit,dc=cn))(|(mail=%u)(mail=*@%s)))

      - LDAP_QUERY_FILTER_GROUP=(&(objectClass=inetOrgPerson)(mail=%[email protected]))
      - LDAP_QUERY_FILTER_ALIAS=(&(objectClass=inetOrgPerson)(mail=%[email protected]))
      - LDAP_QUERY_FILTER_DOMAIN=(mail=*@%s)
      - LDAP_QUERY_FILTER_SENDERS=(mail=%s)

      # <<< Dovecot Authentication
      - DOVECOT_PASS_FILTER=(&(|(objectClass=inetOrgPerson))(|(memberOf=cn=mail,ou=groups,dc=ldap,dc=sichuancredit,dc=cn)(memberOf=cn=sichuancredit,ou=groups,dc=ldap,dc=sichuancredit,dc=cn))(mail=%u))
      #- DOVECOT_PASS_ATTRS=uid=user,userPassword=password
      - DOVECOT_USER_FILTER=(&(|(objectClass=inetOrgPerson))(|(memberOf=cn=mail,ou=groups,dc=ldap,dc=sichuancredit,dc=cn)(memberOf=cn=sichuancredit,ou=groups,dc=ldap,dc=sichuancredit,dc=cn))(mail=%u))
      - DOVECOT_USER_ATTRS=homeDirectory=home,=uid=5000,=gid=5000
      # <<< Dovecot Authentication

      - ENABLE_SASLAUTHD=0
      - SASLAUTHD_MECHANISMS=ldap
      - SASLAUTHD_LDAP_SERVER=xxxxxx:10389
      - SASLAUTHD_LDAP_BIND_DN=cn=admin,dc=ldap,dc=sichuancredit,dc=cn
      - SASLAUTHD_LDAP_PASSWORD=xxxxx
      - SASLAUTHD_LDAP_SEARCH_BASE=ou=users,dc=ldap,dc=sichuancredit,dc=cn
      - SASLAUTHD_LDAP_FILTER=(&(|(objectClass=inetOrgPerson))(|(memberOf=cn=mail,ou=groups,dc=ldap,dc=sichuancredit,dc=cn)(memberOf=cn=sichuancredit,ou=groups,dc=ldap,dc=sichuancredit,dc=cn))(mail=%u))
      - [email protected]
      - POSTFIX_MESSAGE_SIZE_LIMIT=100000000

      - SSL_TYPE=manual
      - SSL_CERT_PATH=/tmp/ssl/mail.sichuancredit.cn_bundle.pem
      - SSL_KEY_PATH=/tmp/ssl/mail.sichuancredit.cn.key

A friend can tell me why I can't send an email to QQmail because of this problem. Maybe it's because the address of QQmail is composed of pure numbers, while mailbox 163 is not composed of pure numbers (this is just my guess).

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta/closed due to age or inactivityThis issue / PR has been closed due to inactivitymeta/help wantedThe OP requests help from others - chime in! :Dmeta/staleThis issue / PR has become stale and will be closed if there is no further activityservice/ldap

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions