OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
local vs virtual accounts

From: Alex (postfixwebgate.ro)
Date: Wed Mar 10 2004 - 11:39:56 CST


Hello postfix experts,

I have installed and working postfix-2.0.16+Mysql+Maildrop used as LDA
and EVERITHING IS "VIRTUALIZED".... No shell accounts! Now i'm a little
bit confused with some settings imposed by some pseudo shell accounts
used to send mail from (for ex: mysql, ftp, spam, www) containing some
daily reports about activities of some daemons. On present
configuration, i can send email FROM but i can't sent TO this users.
Could be some situations, when message sent by a pseudo user, is
bounced, and should be returned to sender. Because on my server does not
exist this email account, message will be double bounced and will arrive
to postmastermydom.com email account. Here is the problem, because i
don't want message to be double bounced.

To solve this problem there are 2 methods AFAIK:
1.Use sql to vitualize ALL pseudo shell accounts and redirect mail for
them to root OR,
2.Use something STATIC, like /etc/aliases and redirect mail to root.

I would like to use the second one methond to skip some SQL queries.

All i want to know is how to setup postfix to accept as destination,
mysqlmydom.com if account mysql exist in /etc/aliases and redirect
message to address specified in this file (rootmydom.com)

For example /etc/aliases contain:
bin: root
mysql: root
spam: root
mailer-daemon: postmaster

NOW <bin> is trying to send mail to <mysql>.

In a telnet session, just sender address is accepted!

telnet localhost 25
....
mail from:<bin>
250 Ok
rcpt to:<mysql>
550 <mysql>: User unknown in virtual mailbox table
rcpt to: <root>
250 Ok
.....
PLEASE NOTE THAT HERE <root> is A SQL VIRTUALIZED ACCOUNT

See below some representative parts of my main.cf related to this problem.

### General settings ###
myhostname = mail.mydom.com
mydomain = mydom.com
myorigin = $mydomain
mydestination = localhost, localhost.localdomain, $myhostname
mynetworks = 127.0.0.1/32

### Redirections for pseudo accounts ###
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
local_recipient_maps = $alias_maps
local_transport = virtual

### Maildrop as LDA - Mysql settings ###
transport_maps = mysql:/etc/postfix/mysql_transport.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_users.cf
virtual_maps = mysql:/etc/postfix/mysql_redirections.cf
virtual_transport = virtual