LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-30-2005, 09:04 PM   #1
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Rep: Reputation: 15
Postfix + Virtual Hosts Problem


I'm having a problem with Postfix and virtual hosting. I'm also using MySQL to store my values.

Whenever I try to send an email to what should be a valid user, I get the following message in my maillog (email addys and domains removed to protect the innocent):

Code:
connect from destination.domain[xx.xxx.xxx.xxx]

NOQUEUE: reject: RCPT from destination.domain[xx.xxx.xxx.xxx]: 554 <recipient@recipient.domain: Recipient address rejected: Access denied; from=<sender@destination.domain> to=<recipient@recipient.domain> proto=ESMTP helo=<destination.domain>

lost connection after RCPT from destination.domain[xx.xxx.xxx.xxx]

disconnect from destination.domain[xx.xxx.xxx.xxx]
I have the following setup in my main.cf:

Code:
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_uid_maps = static:501
virtual_gid_maps = static:501
virtual_mailbox_base = /usr/local/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_transport = virtual
smtpd_recipient_restrictions=permit_sasl_authenticated, permit_mynetworks, reject
mysql_virtual_domains_maps.cf:
Code:
user = postfix
password = postfix
hosts = localhost
dbname = maildb
table = domain
select_field = description
where_field = domain
mysql_virtual_mailbox_maps.cf:
Code:
user = postfix
password = postfix
hosts = localhost
dbname = maildb
table = mailbox
select_field = maildir
where_field = username
and mysql_virtual_alias_maps.cf:
Code:
user = postfix
password = postfix
hosts = localhost
dbname = maildb
table = alias
select_field = goto
where_field = address
I've set MySQL to log sql statements, and here is what it logs for this event:

Code:
postfix@localhost on maildb
SELECT goto FROM alias WHERE address='destination.domain'
postfix@localhost on maildb
SELECT description FROM domain WHERE domain='destination.domain'
SELECT goto FROM alias WHERE address='recipient.domain'
SELECT description FROM domain WHERE domain='recipient.domain'
That final SQL statement returns a single row.

Thanks in advance.

Bryce
 
Old 03-30-2005, 09:42 PM   #2
vbfischer
Member
 
Registered: Jun 2004
Location: Tampa, FL
Distribution: CentOS 3.x
Posts: 33

Original Poster
Rep: Reputation: 15
Once again, answering my own questions...

My problem was in the main.cf. Instead of this:

Code:
smtpd_recipient_restrictions=permit_sasl_authenticated, permit_mynetworks, reject
I have this:
Code:
smtpd_recipient_restrictions =
        permit_sasl_authenticated,
        reject_unauth_destination,
        permit
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 07:29 AM
virtual hosts, virtual ip's? kuplo Linux - Newbie 3 11-29-2005 09:44 PM
virtual hosts problem newuser455 Linux - Software 0 08-29-2004 09:01 PM
IP based virtual hosts problem adm1329 Linux - Networking 4 03-11-2004 11:40 AM
Problem with Apache Virtual Hosts jaberwooky Linux - Software 4 09-23-2003 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration