1

(5 篇回复,发表在 iRedMail 技术支持)

ZhangHuangbin 写道:

/etc/postfix/mysql/ 底下的文件指定的sql帐号密码没问题?

问题解决了
[root@mail1 ~]# ll /etc/passwd
-rw------- 1 root root 1604 1月   5 01:16 /etc/passwd
[root@mail1 ~]# chmod 604 /etc/passwd
[root@mail1 ~]# chmod 604 /etc/group

Jan  9 15:15:14 mail1 postfix/smtpd[4385]: connect from mail1.example.com[127.0.0.1]
Jan  9 15:15:14 mail1 postfix/smtpd[4385]: 70E7E21458: client=mail1.example.com[127.0.0.1], sasl_method=LOGIN, sasl_username=user2@tappal1.com
Jan  9 15:15:14 mail1 postfix/cleanup[4395]: 70E7E21458: message-id=<d7a1755776bfcc8a6e212504c79d6a56@tappal1.com>
Jan  9 15:15:14 mail1 postfix/qmgr[22999]: 70E7E21458: from=<user2@tappal1.com>, size=530, nrcpt=1 (queue active)
Jan  9 15:15:14 mail1 roundcube: User user2@tappal1.com [192.168.100.5]; Message for user1@tappal1.com; 250: 2.0.0 Ok: queued as 70E7E21458
Jan  9 15:15:14 mail1 postfix/smtpd[4385]: disconnect from mail1.example.com[127.0.0.1]
Jan  9 15:15:21 mail1 postfix/smtpd[4424]: connect from mail1.example.com[127.0.0.1]
Jan  9 15:15:21 mail1 postfix/smtpd[4424]: A6400214B0: client=mail1.example.com[127.0.0.1]
Jan  9 15:15:21 mail1 postfix/cleanup[4395]: A6400214B0: message-id=<d7a1755776bfcc8a6e212504c79d6a56@tappal1.com>
Jan  9 15:15:21 mail1 postfix/qmgr[22999]: A6400214B0: from=<user2@tappal1.com>, size=977, nrcpt=1 (queue active)
Jan  9 15:15:21 mail1 postfix/smtpd[4424]: disconnect from mail1.example.com[127.0.0.1]
Jan  9 15:15:21 mail1 amavis[3274]: (03274-01) Passed CLEAN {RelayedInternal}, MYNETS/MYUSERS LOCAL [127.0.0.1]:19200 <user2@tappal1.com> -> <user1@tappal1.com>, Queue-ID: 70E7E21458, Message-ID: <d7a1755776bfcc8a6e212504c79d6a56@tappal1.com>, mail_id: crTLOKXp_P2q, Hits: 1.013, size: 530, queued_as: A6400214B0, 7185 ms
Jan  9 15:15:21 mail1 postfix/smtp[4400]: 70E7E21458: to=<user1@tappal1.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=7.4, delays=0.14/0.04/0.03/7.2, 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 A6400214B0)
Jan  9 15:15:21 mail1 postfix/qmgr[22999]: 70E7E21458: removed
Jan  9 15:15:21 mail1 postfix/pipe[4341]: A6400214B0: to=<user1@tappal1.com>, relay=dovecot, delay=0.13, delays=0.02/0.01/0/0.11, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan  9 15:15:21 mail1 postfix/qmgr[22999]: A6400214B0: removed
Jan  9 15:15:40 mail1 clamd[3663]: SelfCheck: Database status OK.

2

(5 篇回复,发表在 iRedMail 技术支持)

ZhangHuangbin 写道:

/etc/postfix/mysql/ 底下的文件指定的sql帐号密码没问题?

[root@mail1 mysql]# cat sender_login_maps.cf
user        = vmail
password    = 2HV0JPZs3eki4Ujf7MWayEwiqRFJ2k
hosts       = 127.0.0.1
port        = 3306
dbname      = vmail
query       = SELECT mailbox.username FROM mailbox,domain WHERE mailbox.username='%s' AND mailbox.domain='%d' AND mailbox.domain=domain.domain AND mailbox.enablesmtp=1 AND mailbox.active=1 AND domain.backupmx=0 AND domain.active=1
[root@mail1 mysql]# mysql -uvmail -p2HV0JPZs3eki4Ujf7MWayEwiqRFJ2k -e "use vmail;show tables;"
+----------------------+
| Tables_in_vmail      |
+----------------------+
| admin                |
| alias                |
| alias_domain         |
| anyone_shares        |
| deleted_mailboxes    |
| domain               |
| domain_admins        |
| mailbox              |
| recipient_bcc_domain |
| recipient_bcc_user   |
| sender_bcc_domain    |
| sender_bcc_user      |
| share_folder         |
| used_quota           |
+----------------------+

3

(5 篇回复,发表在 iRedMail 技术支持)

ZhangHuangbin 写道:
cenhuqing 写道:

Jan  5 11:19:37 mail1 postfix/pipe[23179]: fatal: get_service_attr: unknown username: vmail

你的服务器上没有 vmail 这个系统帐号?


有系统账号
[root@mail1 ~]# id vmail
uid=2000(vmail) gid=2000(vmail) 组=2000(vmail)
[root@mail1 ~]# grep vmail /etc/passwd
vmail:x:2000:2000::/var/vmail:/sbin/nologin

4

(5 篇回复,发表在 iRedMail 技术支持)

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):mysql
- 使用的 Linux/BSD 发行版名称及版本号:centos6.5
- 与您的问题相关的日志信息:
Jan  5 11:19:37 mail1 postfix/pipe[23179]: fatal: get_service_attr: unknown username: vmail
Jan  5 11:19:37 mail1 amavis[22692]: (22692-01) Passed CLEAN {RelayedInternal}, MYNETS/MYUSERS LOCAL [127.0.0.1]:16470 <user1@tappal1.com> -> <user2@tappal1.com>, Queue-ID: 5420F213EE, Message-ID: <ac42a6d9483d891f1166b6cdec0d5c11@tappal1.com>, mail_id: CjYTEx3_Eg1J, Hits: 0, size: 532, queued_as: 95D9A213F3, 259 ms
Jan  5 11:19:37 mail1 postfix/smtp[23026]: 5420F213EE: to=<user2@tappal1.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.37, delays=0.09/0/0.02/0.26, 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 95D9A213F3)
Jan  5 11:19:37 mail1 postfix/qmgr[22999]: 5420F213EE: removed
Jan  5 11:19:38 mail1 postfix/qmgr[22999]: warning: private/dovecot socket: malformed response
Jan  5 11:19:38 mail1 postfix/qmgr[22999]: warning: transport dovecot failure -- see a previous warning/fatal/panic logfile record for the problem description
Jan  5 11:19:38 mail1 postfix/master[22996]: warning: process /usr/libexec/postfix/pipe pid 23179 exit status 1
Jan  5 11:19:38 mail1 postfix/master[22996]: warning: /usr/libexec/postfix/pipe: bad command startup -- throttling
Jan  5 11:19:38 mail1 postfix/error[23053]: 95D9A213F3: to=<user2@tappal1.com>, relay=none, delay=1, delays=0.01/1/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)
====

看了论坛里也有这个错误的帖子,貌似有些不同

[root@mail1 ~]# id vmail
uid=2000(vmail) gid=2000(vmail) 组=2000(vmail)
[root@mail1 ~]# id -u vmail
2000
[root@mail1 ~]# id -g vmail
2000
[root@mail1 ~]# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
allow_percent_hack = no
biff = no
bounce_queue_lifetime = 4h
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
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
delay_warning_time = 0h
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 4h
message_size_limit = 15728640
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = example.com
myhostname = mail1.example.com
mynetworks = 127.0.0.0/8
mynetworks_style = host
myorigin = mail1.example.com
newaliases_path = /usr/bin/newaliases.postfix
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = /usr/share/doc/postfix-2.11.0/README_FILES
receive_override_options = no_address_mappings
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf
recipient_delimiter = +
relay_domains = $mydestination, proxy:mysql:/etc/postfix/mysql/relay_domains.cf
sample_directory = /usr/share/doc/postfix-2.11.0/samples
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf, proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp-amavis_destination_recipient_limit = 1
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_loglevel = 0
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_note_starttls_offer = yes
smtp_tls_protocols = !SSLv2 !SSLv3
smtp_tls_security_level = may
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:7777, check_policy_service inet:127.0.0.1:10031,
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, check_policy_service inet:127.0.0.1:10031, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/pki/tls/certs/iRedMail.crt
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/iRedMail.crt
smtpd_tls_key_file = /etc/pki/tls/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtpd_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_security_level = may
swap_bangpath = no
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf, proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf, proxy:mysql:/etc/postfix/mysql/catchall_maps.cf, proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000