PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.postfix.users > redirect all emails from an adress to another server
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
redirect all emails from an adress to another server

Réponse
 
LinkBack Outils de la discussion
Vieux 28/02/2006, 17h59   #1
benjamin.sebbah@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut redirect all emails from an adress to another server

Hello,

When I receive an email,
if the user "TO" is in my LDAP directory then send email correctly
if the user is not in the LDAP directory but the domain is ok, forward
it to another server with another IP.

Thanks

  Réponse avec citation
Vieux 01/03/2006, 06h38   #2
benjamin.sebbah@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect all emails from an adress to another server

I forgot to say that I am using Postfix 2 with cyrus
I'm thinking of doing a catch-all user but I don't know how to really
do it

  Réponse avec citation
Vieux 02/03/2006, 02h43   #3
Greg Hackney
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect all emails from an adress to another server

benjamin.sebbah@gmail.com wrote:
> Hello,
>
> When I receive an email,
> if the user "TO" is in my LDAP directory then send email correctly
> if the user is not in the LDAP directory but the domain is ok, forward
> it to another server with another IP.
>
> Thanks


I haven't tested this scenario, but I think you could do it like this:


In the transports configuration, perform an LDAP lookup for existing
email addresses, and if they exist, use the "local:" transport.

If not, route that domain's traffic to the other server.

--< main.cf >--
transport_maps = ldap:/etc/postfix/ldap.cf,
proxy:hash:/etc/postfix/transport

--< transport >--
@mydomain.com smtp:[server2.mydomain.com]

--< ldap.cf >--
bind = no
domain = mydomain.com
timeout = 120
search_base = o=MyLDAPdatabaseNAME
server_host = ldap://ldap.mydomain.com
server_port = 389
query_filter = (mail=%s)
result_attribute = "local:"


--
Greg




  Réponse avec citation
Vieux 03/03/2006, 09h12   #4
benjamin.sebbah@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect all emails from an adress to another server

Thanks Greg for your answer

Unfortunately before testing this solution I'd like to understand
something without the LDAP directory:
if I send an email to smtp1.mydomain.com and the user is not known in
any base then transfer (I should say transport?) it to
smtp2.mydomain.com
I understand it should be done with "transport" but I just can't
succeed to do it with the same domain.

If you have any idea...

Ben

  Réponse avec citation
Vieux 03/03/2006, 18h28   #5
Greg Hackney
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect all emails from an adress to another server

benjamin.sebbah@gmail.com wrote:
> Thanks Greg for your answer
>
> Unfortunately before testing this solution I'd like to understand
> something without the LDAP directory:
> if I send an email to smtp1.mydomain.com and the user is not known in
> any base then transfer (I should say transport?) it to
> smtp2.mydomain.com
> I understand it should be done with "transport" but I just can't
> succeed to do it with the same domain.
>
> If you have any idea...
>
> Ben
>


If I understand correctly, you want to test manually before using an LDAP solution?

You could put some email addresses in the /etc/postfix/transport file. This assumes
using "transport_maps = hash:/etc/postfix/transport", or equivalent in the main.cf file:

---< /etc/postfix/transport >---
# Local users
user1@mydomain.com local:
user2@mydomain.com local:

# Users on other machine
user3@mydomain.com smtp:[smtp2.mydomain.com]
user4@mydomain.com smtp:[smtp2.mydomain.com]
# Or else use a default for all other users not listed above
mydomain.com smtp:[smtp2.mydomain.com]

--
Greg



  Réponse avec citation
Vieux 05/03/2006, 00h11   #6
benjamin.sebbah@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect all emails from an adress to another server

Actually I found something very interesting:

--< main.cf >--
fallback_transport = smtp:server2.mydomain.com

Local users stay on server1 and the others move on to server2 which is
absolutely what I wanted to do.
I didn't test it with LDAP yet but I think it will not be a problem.


Ben

  Réponse avec citation
Vieux 13/03/2006, 17h30   #7
benjamin.sebbah@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: redirect all emails from an adress to another server

This solution doesn't work when mailbox_transport = cyrus is in
main.cf
If anybody has an idea, because I can't use Greg's solution as I can't
manually add every user in /etc/postfix/transport or maybe there is a
method to import them automatically?

Thanks

Ben

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h07.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13337 seconds with 15 queries