[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-15 Thread Akshay Pushparaj via Postfix-users




1. How much control do you have over the remote server?

  None.

2. Is the remote server using LDAP to identify users too?

  Its a Gmail server.

3. If you have little to no control and LDAP is not being used, then
   how co-operative are the administrators of the remote server?

  They are very co-opertative.

Other than that if you can get a valid list of delivery addresses from
the remote server scripting a solution to turn it into a valid map for
forwarding is relatively easy.
Yes, this is what i have done now. I wanted to check recipients with 
LDAP and forward so that i need not add a valid recipient list. I 
configured the server as such using address rewriting. Later, it 
occurred to me that not having valid recipient list would cause 
backscatter mail.



--
-- Akshay
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-15 Thread Akshay Pushparaj via Postfix-users





I would like to know if i can configure postfix to forward mails if user
not found in local recipient table.


That is possible (with static: mapping) but not a good idea.

May i know why it's not a good idea?


Forwarding ALL recipients not in the local recipient table will
make your server a source of backscatter mail (accept spam from an
innocent sender address to a non-existent recipient, then return
the mail as undeliverable).
I thought you were talking about creating a static map with valid 
recipients. I had configured to forward ALL; later it occurred to me.



Users are split between LDAP in my server and a remote server for
example.com. So if u...@example.com is not present in LDAP it must
forward to remote server.


How would Postfix know that the address is valid? If your answer
is: return the message to the sender if ther recipient is not valid,
then that is the wrong reply.



I would have to use a static map of valid addresses, otherwise the mail
would loop between 2 servers.


You have changed the problem from "forward ALL recipients not
in the local recipient table" to "forward SPECIFIC recipients".
The latter can be done with virtual_alias_maps.

/etc/postfix/main.cf
 myorigin = example.com
 virtual_alias_maps = hash:/etc/postfix/virtual
 # NOT: virtual_alias_domains = example.com

/etc/postfix/virtual
 f...@example.com   foo@other.example
 b...@example.com   bar@other.example


Have configured with a list of valid recipients. Thanks for all the help.


--
-- Akshay
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-14 Thread Nikolai Lusan via Postfix-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Tue, 2024-02-06 at 22:31 +0530, Akshay Pushparaj via Postfix-users
wrote:
> I would like to know if i can configure postfix to forward mails if
> user not found in local recipient table.
> 
> Usecase:
> 
> Users are split between LDAP in my server and a remote server for 
> example.com. So if u...@example.com is not present in LDAP it must 
> forward to remote server.

My questions would be:
   1. How much control do you have over the remote server?
   2. Is the remote server using LDAP to identify users too?
   3. If you have little to no control and LDAP is not being used, then
  how co-operative are the administrators of the remote server?
 
In that case that 1 and 2 are true then slave the remote LDAP into a
separate directory on your local server and adjust the postfix
configuration to take it into account accordingly.

Other than that if you can get a valid list of delivery addresses from
the remote server scripting a solution to turn it into a valid map for
forwarding is relatively easy. If the administrators of the remote host
are not being helpful, and wanting you to split the hosting of addresses
for a domain you can either convince them to become helpful, or hand the
the entire domain to them. I will admit that at a previous employer I
had problems getting some of the other sysadmins to accept that with the
postfix/dovecot/ldap setup we had we could have mail delivered to
specific office servers (we had one mail server in the head office that
everyone, including offices in foreign locations, accessed via IMAP - we
frequently got complaints from overseas that email access was "slow". My
argument was that local delivery of their email would fix this and could
be done via existing VPN tunnels we had - some people mistook that as
local storage with remote dovecot using NFS to access mail stores). 


- -- 
Nikolai Lusan Email: niko...@lusan.id.au
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEVfd4GW6z4nsBxdLo4ZaDRV2VL6QFAmXMxaUACgkQ4ZaDRV2V
L6Sp2g//dpIlHe9Ns6bnDIKHtzUyETlbIaBKa7sWig0lL3kJjQm2I8dtV47ObVve
+RDWnELgRGSlXmzUrKKClgifqHotK9XuBdzhQgknxAMjJDirCWJxTYgWmXhiE8TW
vnMty3D0yiHCOZsvuoBT5T5poWeysK5OHzvkoEXRl7KSyw+0/uwvocERwRw0bc98
JO4ludmvHwXw/YlcWLF7D2FwSE483pG0QZhWlU/A/g1rGrHPAy8NyYSi+ikQvB12
lOoQVbfS+3rFTn1y4vH0GJ5h6cNqPkm6l9bKfa4ghZ/Xhm5oURTiuLkn5MtRTtiv
EFMNTQICOYbM9HvfmUmVRwAWnXKDQh8TojBgVwx+KGox4rXWXTnEWdBF/fLVWlOU
VL4PjiryvOBji2aySt9KRh3FJ4FMm1JvQum8XAcj6X3ribbOQEmJMKeqMms3HkaI
bOyuCowD3WGjzBJvZkkhl0lJKzDgvcppXtHXPU2qtiOdDVNwsXt2JExlIzVw7tch
0QRSB0EDopkj2H6D5dbMasprMSReyYqaMVIfng1YUljFZ99EdZEJcRede291qG3y
uAg4GhKjN96UrsjaxhtEpmFR9y8lC85owX1o8R5B3sLuSIq2IDi1ak5hdC9MGIZg
GSepC+SmZ+ET2vyiJJqW7c8ol8nXY+kSPpSiFFl/wsRQKl49Kzc=
=fo1T
-END PGP SIGNATURE-
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-13 Thread Wietse Venema via Postfix-users
Akshay Pushparaj via Postfix-users:
> 
> 
> >> I would like to know if i can configure postfix to forward mails if user
> >> not found in local recipient table.
> > 
> > That is possible (with static: mapping) but not a good idea.
> May i know why it's not a good idea?

Forwarding ALL recipients not in the local recipient table will
make your server a source of backscatter mail (accept spam from an
innocent sender address to a non-existent recipient, then return
the mail as undeliverable).

> >> Users are split between LDAP in my server and a remote server for
> >> example.com. So if u...@example.com is not present in LDAP it must
> >> forward to remote server.
> > 
> > How would Postfix know that the address is valid? If your answer
> > is: return the message to the sender if ther recipient is not valid,
> > then that is the wrong reply.

> I would have to use a static map of valid addresses, otherwise the mail 
> would loop between 2 servers.

You have changed the problem from "forward ALL recipients not
in the local recipient table" to "forward SPECIFIC recipients".
The latter can be done with virtual_alias_maps.

/etc/postfix/main.cf
myorigin = example.com
virtual_alias_maps = hash:/etc/postfix/virtual
# NOT: virtual_alias_domains = example.com

/etc/postfix/virtual
f...@example.comfoo@other.example
b...@example.combar@other.example

This ensures that Postfix accepts only mail for 'valid" recipients.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-12 Thread Akshay Pushparaj via Postfix-users





I would like to know if i can configure postfix to forward mails if user
not found in local recipient table.


That is possible (with static: mapping) but not a good idea.

May i know why it's not a good idea?


Users are split between LDAP in my server and a remote server for
example.com. So if u...@example.com is not present in LDAP it must
forward to remote server.


How would Postfix know that the address is valid? If your answer
is: return the message to the sender if ther recipient is not valid,
then that is the wrong reply.
I would have to use a static map of valid addresses, otherwise the mail 
would loop between 2 servers.


--
Akshay
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-12 Thread Akshay Pushparaj via Postfix-users




On 06/02/24 23:18, Viktor Dukhovni via Postfix-users wrote:

That's not the right question.  The right question is:

 - How to deliver some users for a domain locally and and some to a
   remote server?

Will frame questions better next time.


For that, I'd typically configure the domain as a relay domain, and
*rewrite* the addresses that should be delivered locally to a local
or virtual mailbox (mydestination or virtual_mailbox_domains) domain.

My actual preference is to make such domains be virtual alias domains,
and rewrite both the forwarded and the local recipients to internal
domains, with some forwarded and some delivered locally.  But that's
a bit more complicated when the relay destination expects unmodified
envelope recipients.  It may be possible to give the relay recipients
*additional* internal addresses and rewrite to that form...

Thanks.


--
Akshay
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-06 Thread Viktor Dukhovni via Postfix-users
On Tue, Feb 06, 2024 at 10:31:06PM +0530, Akshay Pushparaj via Postfix-users 
wrote:

> I would like to know if i can configure postfix to forward mails if user not
> found in local recipient table.

That's not the right question.  The right question is:

- How to deliver some users for a domain locally and and some to a
  remote server?

For that, I'd typically configure the domain as a relay domain, and
*rewrite* the addresses that should be delivered locally to a local
or virtual mailbox (mydestination or virtual_mailbox_domains) domain.

My actual preference is to make such domains be virtual alias domains,
and rewrite both the forwarded and the local recipients to internal
domains, with some forwarded and some delivered locally.  But that's
a bit more complicated when the relay destination expects unmodified
envelope recipients.  It may be possible to give the relay recipients
*additional* internal addresses and rewrite to that form...

-- 
Viktor.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Forward mails if user unknown in local recipient table

2024-02-06 Thread Wietse Venema via Postfix-users
Akshay Pushparaj via Postfix-users:
> Hi,
> I would like to know if i can configure postfix to forward mails if user 
> not found in local recipient table.

That is possible (with static: mapping) but not a good idea.

> Usecase:
> 
> Users are split between LDAP in my server and a remote server for 
> example.com. So if u...@example.com is not present in LDAP it must 
> forward to remote server.

How would Postfix know that the address is valid? If your answer
is: return the message to the sender if ther recipient is not valid,
then that is the wrong reply.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org