LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   trying set up a postfix+dovecot server in vmware,but cant receive mail to myself (https://www.linuxquestions.org/questions/linux-distributions-5/trying-set-up-a-postfix-dovecot-server-in-vmware-but-cant-receive-mail-to-myself-4175599730/)

rhinolt 02-14-2017 07:43 AM

trying set up a postfix+dovecot server in vmware,but cant receive mail to myself
 
CentOS7 with postfix+dovecot+postfixadmin+cyrus+mariadb
each service running w\o error
check telnet seems fine

Code:

telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.example.com ESMTP Postfix
ehlo example.com
250-mail.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN CRAM-MD5
250-AUTH=PLAIN LOGIN CRAM-MD5
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit

and postfixadmin could add mailboxes

Code:

MariaDB [postfix]> select * from mailbox;
+------------------------+----------------------------------------------------------------------------+-------+-------------------------+------------+------------+------------------+---------------------+---------------------+--------+
| username              | password                                                                  | name  | maildir                | quota      | local_part | domain          | created            | modified            | active |
+------------------------+----------------------------------------------------------------------------+-------+-------------------------+------------+------------+------------------+---------------------+---------------------+--------+
| test1@example.com      | {CRAM-MD5}8314fef5923bb513c7e8be9e663501bbc56ce1012aae68e4c68852be5ab8da76 | test1 | example.com/test1/      | 1024000000 | test1      | example.com      | 2017-02-13 00:22:20 | 2017-02-13 00:22:20 |      1 |
| test1@mail.example.com | {CRAM-MD5}8314fef5923bb513c7e8be9e663501bbc56ce1012aae68e4c68852be5ab8da76 | test2 | mail.example.com/test1/ | 1024000000 | test1      | mail.example.com | 2017-02-13 00:31:46 | 2017-02-13 00:31:46 |      1 |
| test2@mail.example.com | {CRAM-MD5}8314fef5923bb513c7e8be9e663501bbc56ce1012aae68e4c68852be5ab8da76 | test2 | mail.example.com/test2/ | 1024000000 | test2      | mail.example.com | 2017-02-13 00:32:00 | 2017-02-13 00:32:00 |      1 |
| test2@example.com      | {CRAM-MD5}8314fef5923bb513c7e8be9e663501bbc56ce1012aae68e4c68852be5ab8da76 | test2 | example.com/test2/      |    2048000 | test2      | example.com      | 2017-02-14 08:36:26 | 2017-02-14 08:36:26 |      1 |
+------------------------+----------------------------------------------------------------------------+-------+-------------------------+------------+------------+------------------+---------------------+---------------------+--------+
4 rows in set (0.00 sec)

the problem is i cant receive a mail deliver by thunderbird

check dovecot_info.log

Code:

Feb 14 08:05:37 auth-worker(121546): Info: passwd(test2@mail.example.com,192.168.10.1): unknown user
Feb 14 08:05:37 imap-login: Info: Login: user=<test2@mail.example.com>, method=CRAM-MD5, rip=192.168.10.1, lip=192.168.10.1, mpid=121553, secured, session=<LGldOH1I9wDAqAoB>
[root@server /var/log]

check dovecot_debug.log

Code:

Feb 14 08:05:36 auth: Debug: client in: AUTH        2        CRAM-MD5        service=smtp        nologin        lip=192.168.10.1        rip=192.168.10.1
Feb 14 08:05:36 auth: Debug: client passdb out: CONT        2        PDA3MzY2MjM2MDEyNzkyMTAuMTQ4NzA3NzUzNkBzZXJ2ZXIuZXhhbXBsZS5jb20+
Feb 14 08:05:36 auth: Debug: client in: CONT        2        dGVzdDJAbWFpbC5leGFtcGxlLmNvbSBjNmMxMWQ5YWVjYzc3NmFhZjk1ZGIzZjZjMDc2ZDY0Nw== (previous base64 data may contain sensitive data)
Feb 14 08:05:36 auth: Debug: password(test2@mail.example.com,192.168.10.1): passdb doesn't support credential lookups
Feb 14 08:05:37 auth-worker(121546): Debug: Loading modules from directory: /usr/lib64/dovecot/auth
Feb 14 08:05:37 auth-worker(121546): Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Feb 14 08:05:37 auth-worker(121546): Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_pgsql.so
Feb 14 08:05:37 auth-worker(121546): Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Feb 14 08:05:37 auth-worker(121546): Debug: sql(test2@mail.example.com,192.168.10.1): query: SELECT username AS user,password FROM mailbox WHERE username = 'test2@mail.example.com' AND active='1'
Feb 14 08:05:37 auth: Debug: password(test2@mail.example.com,192.168.10.1): Credentials: 8314fef5923bb513c7e8be9e663501bbc56ce1012aae68e4c68852be5ab8da76
Feb 14 08:05:37 auth: Debug: client passdb out: OK        2        user=test2@mail.example.com
Feb 14 08:05:37 auth: Debug: auth client connected (pid=121552)
Feb 14 08:05:37 auth: Debug: client in: AUTH        1        CRAM-MD5        service=imap        secured        session=LGldOH1I9wDAqAoB        lip=192.168.10.1        rip=192.168.10.1        lport=143        rport=51959
Feb 14 08:05:37 auth: Debug: client passdb out: CONT        1        PDYzNDI1NjY5OTMzMzc2MzQuMTQ4NzA3NzUzN0BzZXJ2ZXIuZXhhbXBsZS5jb20+
Feb 14 08:05:37 auth: Debug: client in: CONT        1        dGVzdDJAbWFpbC5leGFtcGxlLmNvbSBiNzU3ZmZiODFlMThmMjg2NWFlYjcyMTk4ODJmZGYwZQ== (previous base64 data may contain sensitive data)
Feb 14 08:05:37 auth: Debug: password(test2@mail.example.com,192.168.10.1,<LGldOH1I9wDAqAoB>): passdb doesn't support credential lookups
Feb 14 08:05:37 auth-worker(121546): Debug: sql(test2@mail.example.com,192.168.10.1): query: SELECT username AS user,password FROM mailbox WHERE username = 'test2@mail.example.com' AND active='1'
Feb 14 08:05:37 auth: Debug: password(test2@mail.example.com,192.168.10.1,<LGldOH1I9wDAqAoB>): Credentials: 8314fef5923bb513c7e8be9e663501bbc56ce1012aae68e4c68852be5ab8da76
Feb 14 08:05:37 auth: Debug: client passdb out: OK        1        user=test2@mail.example.com
Feb 14 08:05:37 auth: Debug: master in: REQUEST        4013948929        121552        1        7db25eab82cbd0274899c2dcadd586e4        session_pid=121553        request_auth_token
Feb 14 08:05:37 auth-worker(121546): Debug: passwd(test2@mail.example.com,192.168.10.1): lookup
Feb 14 08:05:37 auth: Debug: master userdb out: USER        4013948929        test2@mail.example.com        uid=5000        gid=5000        home=/home/vmail/mail.example.com/test2        auth_token=113dcf23896dfec364c80ae471a8ffebc983758a
Feb 14 08:05:37 imap(test2@mail.example.com): Debug: Effective uid=5000, gid=5000, home=/home/vmail/mail.example.com/test2
Feb 14 08:05:37 imap(test2@mail.example.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/home/vmail/mail.example.com/test2/Maildir
Feb 14 08:05:37 imap(test2@mail.example.com): Debug: maildir++: root=/home/vmail/mail.example.com/test2/Maildir, index=, indexpvt=, control=, inbox=/home/vmail/mail.example.com/test2/Maildir, alt=

check postfix log

Code:

Feb 14 08:05:36 server postfix/smtpd[121491]: connect from server.example.com[192.168.10.1]
Feb 14 08:05:37 server postfix/smtpd[121491]: 17F2A61603D5: client=server.example.com[192.168.10.1], sasl_method=CRAM-MD5, sasl_username=test2@mail.example.com
Feb 14 08:05:37 server postfix/cleanup[121505]: 17F2A61603D5: message-id=<07fa6ba7-d6d1-2a83-e426-33730dacf48b@mail.example.com>
Feb 14 08:05:37 server postfix/qmgr[120987]: 17F2A61603D5: from=<test2@mail.example.com>, size=598, nrcpt=1 (queue active)
Feb 14 08:05:37 server postfix/trivial-rewrite[121501]: warning: do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains
Feb 14 08:05:37 server postfix/local[121506]: 17F2A61603D5: to=<test1@mail.example.com>, relay=local, delay=0.12, delays=0.09/0.02/0/0.01, dsn=5.1.1, status=bounced (unknown user: "test1")
Feb 14 08:05:37 server postfix/cleanup[121505]: 30B9C64D711B: message-id=<20170214130537.30B9C64D711B@mail.example.com>
Feb 14 08:05:37 server postfix/bounce[121507]: 17F2A61603D5: sender non-delivery notification: 30B9C64D711B
Feb 14 08:05:37 server postfix/qmgr[120987]: 17F2A61603D5: removed
Feb 14 08:05:37 server postfix/qmgr[120987]: 30B9C64D711B: from=<>, size=2463, nrcpt=1 (queue active)
Feb 14 08:05:37 server postfix/trivial-rewrite[121501]: warning: do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains
Feb 14 08:05:37 server postfix/local[121506]: 30B9C64D711B: to=<test2@mail.example.com>, relay=local, delay=0.07, delays=0.05/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "test2")
Feb 14 08:05:37 server postfix/qmgr[120987]: 30B9C64D711B: removed
Feb 14 08:05:37 server postfix/smtpd[121491]: disconnect from server.example.com[192.168.10.1]

journalctl -xe

Code:

Feb 14 08:05:36 server.example.com postfix/smtpd[121491]: connect from server.example.com[192.168.10.1]
Feb 14 08:05:37 server.example.com postfix/smtpd[121491]: 17F2A61603D5: client=server.example.com[192.168.10.1], sasl_method=CRAM-MD5, sasl_username=test2@mail.example.com
Feb 14 08:05:37 server.example.com postfix/cleanup[121505]: 17F2A61603D5: message-id=<07fa6ba7-d6d1-2a83-e426-33730dacf48b@mail.example.com>
Feb 14 08:05:37 server.example.com postfix/qmgr[120987]: 17F2A61603D5: from=<test2@mail.example.com>, size=598, nrcpt=1 (queue active)
Feb 14 08:05:37 server.example.com postfix/trivial-rewrite[121501]: warning: do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains
Feb 14 08:05:37 server.example.com postfix/local[121506]: 17F2A61603D5: to=<test1@mail.example.com>, relay=local, delay=0.12, delays=0.09/0.02/0/0.01, dsn=5.1.1, status=boun
Feb 14 08:05:37 server.example.com postfix/cleanup[121505]: 30B9C64D711B: message-id=<20170214130537.30B9C64D711B@mail.example.com>
Feb 14 08:05:37 server.example.com postfix/bounce[121507]: 17F2A61603D5: sender non-delivery notification: 30B9C64D711B
Feb 14 08:05:37 server.example.com postfix/qmgr[120987]: 17F2A61603D5: removed
Feb 14 08:05:37 server.example.com postfix/qmgr[120987]: 30B9C64D711B: from=<>, size=2463, nrcpt=1 (queue active)
Feb 14 08:05:37 server.example.com postfix/trivial-rewrite[121501]: warning: do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains
Feb 14 08:05:37 server.example.com postfix/local[121506]: 30B9C64D711B: to=<test2@mail.example.com>, relay=local, delay=0.07, delays=0.05/0.01/0/0.01, dsn=5.1.1, status=boun
Feb 14 08:05:37 server.example.com postfix/qmgr[120987]: 30B9C64D711B: removed
Feb 14 08:05:37 server.example.com postfix/smtpd[121491]: disconnect from server.example.com[192.168.10.1]



somebody help me pretty pls :P

descendant_command 02-15-2017 12:36 AM

Quote:

Originally Posted by rhinolt (Post 5670321)
Code:

warning: do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains
.... status=bounced (unknown user: "test2")


This is the relavent bit.

rhinolt 02-15-2017 06:10 AM

Quote:

Originally Posted by descendant_command (Post 5670752)
This is the relavent bit.

hrm,how to fix it pls?


/etc/postfix/main.cf

Code:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps =
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.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/spool/postfix/private/auth
smtpd_sasl_application_name = smtpd
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,reject_unknown_sender_domain
smtpd_sasl_security_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
virtual_mailbox_base = /home/vmail/
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
virtual_alias_maps =
  proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf,
  proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf,
  proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
virtual_mailbox_maps =
  proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf,
  proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1


/etc/postfix/sql/mysql_virtual_domains_maps.cf

Code:

user = postfix
password = postfix
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' AND active = '1'


descendant_command 02-15-2017 06:13 AM

Quote:

Originally Posted by rhinolt (Post 5670834)
hrm,how to fix it pls?

do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains

rhinolt 02-15-2017 06:25 AM

Quote:

Originally Posted by descendant_command (Post 5670837)
do not list domain mail.example.com in BOTH mydestination and virtual_mailbox_domains

i put a comment # before "mydestination = $myhostname, localhost.$mydomain, localhost" in main.cf,but doesnt work

rhinolt 02-15-2017 06:31 AM

command "postfix check" shows

Code:

/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_sasl_application_name=smtpd
/usr/sbin/postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_sasl_security_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
/usr/sbin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtpd_sasl_application_name=smtpd


rhinolt 02-16-2017 04:43 PM

someone help me pretty please??

also have these messages seems to be lda issue,but dunno how to fix it

Code:

Feb 16 03:00:08 server.example.com dovecot[1064]: lda: Error: userdb lookup(test2@example.com): Disconn
Feb 16 03:00:08 server.example.com dovecot[1064]: lda: Fatal: Internal error occurred. Refer to server
Feb 16 03:00:08 server.example.com dovecot[1024]: auth: Fatal: master: service(auth): child 1052 killed



All times are GMT -5. The time now is 10:06 AM.