PDA

View Full Version : [postfix]550 ..: Recipient address rejected: User unknown in virtual mailbox table


RdeWilde
31st May 2008, 13:50
I've been trying for hours and hours getting my postfix to work, but it just won't work.

Of the three scenario's, i can't get one to work:
- external mailserver (isp) to local mailserver (mine) WORKS
- local mailserver (mine) to local mailserver (mine) WORKS
- local mailserver (mine to external mailserver (isp) PROBLEM!

I get this error:

.. postfix/smtpd[16293]: NOQUEUE: reject: RCPT from *host*[*ip*]: 550 5.1.1 <some@external.isp>: Recipient address rejected: User unknown in virtual mailbox table; from=<info@sove.nl> to=<some@external.isp> proto=ESMTP helo=<dev>


It just doesn't seem to get that external.isp isn't my server, but it has to go external :confused:. The external.isp could be anything from hotmail, gmail to some little mailprovider.

My configs for as far as they'll be needed, i added to the bottom.


Hopefully someone can help me getting this up, becuase i've been spending much more hours than I would:eek:. Thanks in advance!! :)



MAIN.CF POSTCONF -N:
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
disable_vrfy_command = yes
html_directory = no
inet_interfaces = all
local_recipient_maps = $virtual_mailbox_maps
mail_owner = postfix
mailbox_command =
mailbox_transport = virtual
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination =
myhostname = mail.sove.nl
mynetworks = host 87.249.107.0/24 127.0.0.0/8
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
proxy_interfaces = 87.249.107.11
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relayhost =
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = nonanonymous
smtpd_sasl_type = dovecot
unknown_local_recipient_reject_code = 550
virtual_gid_maps = static:12
virtual_mailbox_base = /var/www/client/
virtual_mailbox_domains = mysql:/etc/postfix/mysql_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox_maps.cf
virtual_minimum_uid = 8
virtual_transport = dovecot
virtual_uid_maps = static:8



MASTER.CF:

#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# ================================================== ========================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ================================================== ========================
smtp inet n - n - - smtpd
submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
# -o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5

.. a lot more ..

dovecot unix - n n - - pipe
flags=DRhu user=mail:mail argv=/usr/libexec/dovecot/deliver -d ${recipient}

falko
1st June 2008, 11:13
Please check if your server is blacklisted: http://mxtoolbox.com/blacklists.aspx

RdeWilde
1st June 2008, 18:03
All okay. Except for some timeouts, but that won't be the problem i guess:
CSMA TIMEOUT 0 0
HILLI TIMEOUT Return codes were: ERROR, Reponse code=2 0 0
INFORMATIONWAVE TIMEOUT 0 0
NJABLDYNA TIMEOUT 0 0
RANGERSBL TIMEOUT 0 0
RRBL TIMEOUT 0 0
TQMCUBE TIMEOUT 0 0

falko
2nd June 2008, 10:28
I see that mydestination is empty in your main.cf. That could be the problem. Please change it and restart Postfix.

RdeWilde
2nd June 2008, 13:30
What should I change it to? I'm using multiple domain names, which are saved in a mysql database table (used to virtual_mailbox_domain).

Do I have to use a single domain for my host? Or use a SQL statement? It hasn't been empty all the time, i've tried different things. But in working configs I found it was mostly empty.

Please suggest what I could put in there (for example).

falko
3rd June 2008, 10:05
You must use a different hostname from what you've stored in the MySQL DB. What's the output of hostname -f? Is this hostname stored in the MySQL DB?

RdeWilde
3rd June 2008, 10:50
This outputs dewildevds2.jronline.nl which is not hosted as a maildomain. But I'm connecting to the mailserver through the hosted domains itself. For example:

mail.firstdomain.com
mail.seconddomain.com

Works for incoming at least. Outgoing can connect, but not sending as mentioned. Previous settings I've tried are:


#mydestination = $myhostname, localhost.$mydomain, localhost
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$domain


None of them did work. Neither did this change (dewil...) :( Thanks for helping this far anyway..

falko
4th June 2008, 19:08
.. postfix/smtpd[16293]: NOQUEUE: reject: RCPT from *host*[*ip*]: 550 5.1.1 <some@external.isp>: Recipient address rejected: User unknown in virtual mailbox table; from=<info@sove.nl> to=<some@external.isp> proto=ESMTP helo=<dev>Are the host and IP address your own ones or the ones of the remote host?

RdeWilde
4th June 2008, 19:29
My client IP running the mailclient.

falko
5th June 2008, 17:21
Huh? :confused: So you're running a mail server on the client?

RdeWilde
9th June 2008, 17:19
No, I'm running it on the external server. Is there any documentation about where this message come from? It checks my outgoing recipents on the local MySQL table, but it should just send it away (as that is why it's there :S). Hope it's possible to solve.

falko
10th June 2008, 14:28
I'm not sure what the problem is, but you should compare all your configuration files with the ones from the tutorial again to rule out typos, etc.

RdeWilde
11th June 2008, 14:47
I didn't do a tutorial, just installed it by 'yum' and configured it by hand.

Looks like it's looking in the table for incoming e-mail, when sending e-mail. What settings could influence this? Is there any way that auth could fail and cause this problem?

falko
12th June 2008, 14:37
What's in /etc/postfix/mysql_mailbox_domains.cf and
/etc/postfix/mysql_mailbox_maps.cf?

RdeWilde
12th June 2008, 14:50
mysql_mailbox_domains.cf:

user = [MYUSER]
password = [MYPASS]
hosts = localhost
dbname = mail
query = SELECT domain FROM users

users contains a column called domain which holds the domain.tld for the email.

mysql_mailbox_maps.cf

user = [MYUSER]
password = [MYPASS]
hosts = localhost
dbname = mail
query = SELECT CONCAT(domain,'/mail/',username,'/') FROM users WHERE username='%u' AND domain='%d'

Correct path (when prepending the base path)

RdeWilde
17th June 2008, 15:55
Anyone who has an asnwer?

RdeWilde
18th June 2008, 16:36
I think i've found a part of the problem. The outgoing port is 587 (submission) and I think that has to be routed somewhere to port 25? But it isn't anywhere? Shouldn't it be in master.cf?

falko
18th June 2008, 18:25
What's the output of netstat -tap?

RdeWilde
18th June 2008, 19:12
What's the output of netstat -tap?
Here's the output:

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:mysql *:* LISTEN 3134/mysqld
tcp 0 0 *:submission *:* LISTEN 1571/master
tcp 0 0 *:sunrpc *:* LISTEN 1203/portmap
tcp 0 0 *:8176 *:* LISTEN 1727/perl
tcp 0 0 *:ftp *:* LISTEN 1582/proftpd: (acce
tcp 0 0 dewildevds2.jronline:domain *:* LISTEN 1183/named
tcp 0 0 localhost.localdomai:domain *:* LISTEN 1183/named
tcp 0 0 localhost.localdomain:ipp *:* LISTEN 1385/cupsd
tcp 0 0 *:984 *:* LISTEN 1226/rpc.statd
tcp 0 0 *:smtp *:* LISTEN 1571/master
tcp 0 0 localhost.localdomain:rndc *:* LISTEN 1183/named
tcp 0 0 *:pop3 *:* LISTEN 1519/dovecot
tcp 0 0 *:imap *:* LISTEN 1519/dovecot
tcp 0 0 *:http *:* LISTEN 9533/httpd
tcp 0 0 *:ssh *:* LISTEN 1377/sshd
tcp 0 0 localhost6.localdomain:rndc *:* LISTEN 1183/named
tcp 0 0 *:https *:* LISTEN 9533/httpd
tcp 0 0 dewildevds2.jronline.n:http ip51ccc296.s:spw-dnspreload TIME_WAIT -
tcp 0 2668 dewildevds2.jronline.nl:ssh ::ffff:195.222.119.34:pipes ESTABLISHED 8506/0
tcp 0 0 dewildevds2.jronline.n:http 84-104-81-142.cable.q:64005 TIME_WAIT -

falko
19th June 2008, 16:27
Looks ok. I don't think that port 587 is a problem for outgoing emails...

RdeWilde
19th June 2008, 16:29
Don't I need something like

submission:localhost:25

Somewhere as transport?

RdeWilde
28th July 2008, 12:06
Anyone still out there to help me?

RdeWilde
28th July 2008, 13:16
I got this from the logs when trying to send a mail from info [aet} sove.nl to wilde825 [aet} planet.nl (sove.nl is local):

/var/log/maillog

Jul 28 13:08:41 dewildevds2 postfix/qmgr[6425]: E90463FDF1: from=<info@sove.nl>, size=2430, nrcpt=1 (queue active)
Jul 28 13:08:41 dewildevds2 postfix/pipe[6443]: E90463FDF1: to=<wilde825@planet.nl>, relay=dovecot, delay=0.1, delays=0.08/0.01/0/0.01, dsn=5.1.1, status=bounced (user unknown)
Jul 28 13:08:41 dewildevds2 postfix/cleanup[6442]: 078F03FDF3: message-id=<20080728110841.078F03FDF3@sove.nl>
Jul 28 13:08:41 dewildevds2 postfix/bounce[6445]: E90463FDF1: sender non-delivery notification: 078F03FDF3
Jul 28 13:08:41 dewildevds2 postfix/qmgr[6425]: E90463FDF1: removed


/var/log/dovecot.info.log

dovecot: 2008-07-28 13:08:41Info: auth(default): master in: USER 1 wilde825[EDIT]planet.nl service=deliver
dovecot: 2008-07-28 13:08:41Info: auth-worker(default): sql(wilde825[EDIT]planet.nl): SELECT 8 AS uid, 12 AS gid, home FROM users WHERE username = 'wilde825' AND domain = 'planet.nl'
dovecot: 2008-07-28 13:08:41Info: auth-worker(default): sql(wilde825[EDIT]planet.nl): User not found
dovecot: 2008-07-28 13:08:41Info: auth(default): master out: NOTFOUND 1


It looks like it's trying to auth my receipts, but it should only auth the sender. Is this some SASL setting?

My postconf -n if needed:

broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_command =
mailbox_transport = virtual
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = dewildevds2.jronline.nl, localhost.$mydomain, localhost
myhostname = sove.nl
mynetworks = 87.249.107.0/24 127.0.0.0/8
mynetworks_style = host
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_reject_unlisted_recipient = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = nonanonymous
smtpd_sasl_type = dovecot
unknown_local_recipient_reject_code = 450
virtual_gid_maps = static:12
virtual_mailbox_base = /var/www/client/
virtual_mailbox_domains = mysql:/etc/postfix/mysql_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox_maps.cf
virtual_minimum_uid = 8
virtual_transport = dovecot
virtual_uid_maps = static:8


Any help is very very welcome.

falko
29th July 2008, 14:32
Can you post your dovecot configuration?

RdeWilde
29th July 2008, 15:28
I've put it online:
http://sove.nl/dovecot.conf


## Dovecot configuration file

# If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration

# Base directory where to store runtime data.
base_dir = /var/run/dovecot/

# Protocols we want to be serving: imap imaps pop3 pop3s
# If you only want to use dovecot-auth, you can set this to "none".
protocols = imap pop3

listen = [::]

##
## Logging
##

log_path = /var/log/dovecot.log

info_log_path = /var/log/dovecot.info.log

log_timestamp = "%Y-%m-%d %H:%M:%S"

syslog_facility = mail


##
## Mailbox locations and namespaces
##

mail_location = maildir:/var/www/client/%d/mail/%n/


mail_extra_groups = mail

##
## Mail processes
##

# Enable mail process debugging. This can help you figure out why Dovecot
# isn't finding your mails.
mail_debug = yes

first_valid_uid = 4

# Default umask to use for mail files and directories.
umask = 0077

##
## Mailbox handling optimizations
##

##
## IMAP specific settings
##

protocol imap {
}

##
## POP3 specific settings
##

protocol pop3 {
}

##
## LDA specific settings
##

protocol lda {
postmaster_address = postmaster@sove.nl

#hostname =

#mail_plugins =
#mail_plugin_dir = /usr/lib/dovecot/lda

# Binary to use for sending mails.
sendmail_path = /usr/lib/sendmail

# UNIX socket path to master authentication server to find users.
auth_socket_path = /var/run/dovecot/auth-master
}



auth_verbose = yes
auth_debug = yes

auth default {

# SQL database
# http://wiki.dovecot.org/AuthDatabase/SQL
passdb sql {
# Path for SQL configuration file, see doc/dovecot-sql.conf for example
args = /etc/dovecot.mysql.conf
}

# SQL database
# http://wiki.dovecot.org/AuthDatabase/SQL
userdb sql {
# Path for SQL configuration file, see doc/dovecot-sql.conf for example
args = /etc/dovecot.mysql.conf
}

# It's possible to export the authentication interface to other programs:
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0660
# Default user/group is the one who started dovecot-auth (root)
user = dovecot
group = mail
}
client {
path = /var/run/dovecot/auth-client
mode = 0660
user=postfix
group=mail
}
}
}

#auth external {
# socket connect {
# master {
# path = /var/run/dovecot/auth-master
# }
# }
#}

dict {
#quota = mysql:/etc/dovecot-dict-quota.conf
}

##
## Plugin settings
##

plugin {
}




Part of the postfix-logfile:
http://www.sove.nl/maillog.txt

falko
30th July 2008, 15:31
What's in /etc/dovecot.mysql.conf?

RdeWilde
30th July 2008, 15:39
driver = mysql
connect = host=/var/lib/mysql/mysql.sock dbname=mail user=user password=password

password_query = SELECT NULL AS password, CONCAT(username,'@',domain) AS user
FROM users
WHERE username = '%n' AND domain = '%d' AND mysql_pass = MD5('%w')

user_query = SELECT 8 AS uid, 12 AS gid, home
FROM users
WHERE username = '%n' AND domain = '%d'

falko
31st July 2008, 18:31
You might want to play around with the variables in that file: http://wiki.dovecot.org/Variables

This link could be useful as well: http://wiki.dovecot.org/AuthDatabase/SQL

RdeWilde
31st July 2008, 19:14
Hello Falko,

Thanks again for your help. I've looked at the url's you gave me in your previous post and i must say i'd already used many aspects of it. I can't find anything new that'll fix the problem.

Thereforer I'll give up fixing this system, and start all over from scratch with some other software. Hopefully this time I'll have some more 'luck'.