Hi Magnus,

Thanks for replying...

Yup, I know about spoofing and I'm taking care of it in my system.

So let's assume that user is not spoofed.

Now I have scenario: Only some users can send email to particular user.
When I receive email on postfix, I just want to query: Is this sender can send 
email to this receiver?

So again my question is, how can I have sender email address during validation 
of local_recipient_maps?

Many Thanks,
Sumit Arora

-----Original Message-----
From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] 
On Behalf Of Magnus Bäck
Sent: Wednesday, November 11, 2009 1:41 AM
To: postfix-users@postfix.org
Subject: Re: Required sender email address while table lookup for rejecting 
mails for unknown local users

On Tuesday, November 10, 2009 at 07:49 CET,
     "Arora, Sumit" <sumit.ar...@hp.com> wrote:

> I'm using mysql local_recipient_maps for rejecting email for unknown
> local users.
> 
> Here are the changes in my main.cf
> 
> local_recipient_maps = proxy:unix:passwd.byname $alias_maps 
> virtual_alias_maps = mysql:/etc/postfix/mysql-relays.cf

I assume this should be:

local_recipient_maps = proxy:unix:passwd.byname $alias_maps
virtual_alias_maps = mysql:/etc/postfix/mysql-relays.cf

> Here is my mysql-relays.cf
> 
> hosts=16.123.123.123
> user=root
> password=*****
> dbname=testDB
> table=users
> query = select emailaddress from users where emailaddress='%s'
> 
> I'm able to query successfully.
> 
> But I'm stuck as my requirement is to query database according to sender.
> 
> Let's say some user with emailaddress 'sen...@myhostname.com' is
> sending email to my postfix and I need to validate him.

What does "validate the sender" mean? Check that the sender address, if
it's one of your own domains, is a valid recipient address? Only allow a
select number of sender addresses? Please be more complete.

You do know that sender addresses are easily spoofed?

[...]

-- 
Magnus Bäck
mag...@dsek.lth.se

Reply via email to