Forward/Filter email by sender

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Forward/Filter email by sender

Matteo Cazzador-2
Hi, i 've a question, i need to forward all email received with a
specified sender (external domain) to local domain address (suppose
local postfix domain is "example.com").

For examples:

all email with sender [hidden email]   need to be forwarded to a
[hidden email].

Is It possible to do it please?

Thanks a lot.

--
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail.

Le informazioni contenute in questa e-mail e nei files eventualmente allegati sono destinate unicamente ai destinatari della stessa e
sono da considerarsi strettamente riservate. E' proibito copiare, salvare, utilizzare,  inoltrare a terzi e diffondere il contenuto della presente
senza il preventivo consenso, ai sensi dell'articolo 616 c.p. e della Legge n. 196/2003. Se avete ricevuto questo messaggio per errore siete
pregati di comunicarlo immediatamente all'indirizzo mittente, nonché di cancellarne il contenuto senza procedere ad ulteriore o differente trattamento.


******************************************
Ing. Matteo Cazzador
NetLite snc di Cazzador Gagliardi
Corso Vittorio Emanuele II, 188 37069
Villafranca di Verona VR
Tel 0454856656
Fax 0454856655
Email: [hidden email]
Web: http://www.netlite.it
******************************************

Reply | Threaded
Open this post in threaded view
|

Re: Forward/Filter email by sender

Wietse Venema
Matteo Cazzador:
[ Charset ISO-8859-15 converted... ]

> Hi, i 've a question, i need to forward all email received with a
> specified sender (external domain) to local domain address (suppose
> local postfix domain is "example.com").
>
> For examples:
>
> all email with sender [hidden email]?? need to be forwarded to a
> [hidden email].
>
> Is It possible to do it please?

Configuration:

/etc/postfix/main.cf:
    virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual:
    [hidden email] [hidden email]

Commands:

# postmap hash:/etc/postfix/virtual
# postfix reload

Alternative:

/etc/postfix/main.cf:
    virtual_alias_maps = inline:{[hidden email]=[hidden email]}

# postfix reload

Requires Postfix 3.0 or later.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Forward/Filter email by sender

Viktor Dukhovni
On Tue, Jan 21, 2020 at 01:02:11PM -0500, Wietse Venema wrote:

> > Hi, i 've a question, i need to forward all email received with a
> > specified sender (external domain) to local domain address (suppose
> > local postfix domain is "example.com").

Note, the OP said "sender" (address).

> > all email with sender [hidden email]?? need to be forwarded to a
> > [hidden email].
> >
> > Is It possible to do it please?
>
> Configuration:
>
> /etc/postfix/main.cf:
>     virtual_alias_maps = hash:/etc/postfix/virtual
>
> /etc/postfix/virtual:
>     [hidden email] [hidden email]

This rewrites a recipient.  Bcc'ing based on sender can be done with
"sender_bcc_maps".  Redirecting all mail from a sender can be done with
a "REDIRECT" action in an access(5) table used with
"check_sender_access".

--
    Viktor.
Reply | Threaded
Open this post in threaded view
|

Re: Forward/Filter email by sender

Wietse Venema
Viktor Dukhovni:
> On Tue, Jan 21, 2020 at 01:02:11PM -0500, Wietse Venema wrote:
>
> > > Hi, i 've a question, i need to forward all email received with a
> > > specified sender (external domain) to local domain address (suppose
> > > local postfix domain is "example.com").
>
> Note, the OP said "sender" (address).

Aargh.

> This rewrites a recipient.  Bcc'ing based on sender can be done with
> "sender_bcc_maps".  Redirecting all mail from a sender can be done with
> a "REDIRECT" action in an access(5) table used with
> "check_sender_access".

Agreed, redirect or sender_bcc_maps, depending on the purpose.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Forward/Filter email by sender

Matteo Cazzador-2
In reply to this post by Wietse Venema
Thanks a lot.

Best regards

Il 21/01/2020 19:02, Wietse Venema ha scritto:

> Matteo Cazzador:
> [ Charset ISO-8859-15 converted... ]
>> Hi, i 've a question, i need to forward all email received with a
>> specified sender (external domain) to local domain address (suppose
>> local postfix domain is "example.com").
>>
>> For examples:
>>
>> all email with sender [hidden email]?? need to be forwarded to a
>> [hidden email].
>>
>> Is It possible to do it please?
> Configuration:
>
> /etc/postfix/main.cf:
>      virtual_alias_maps = hash:/etc/postfix/virtual
>
> /etc/postfix/virtual:
>      [hidden email] [hidden email]
>
> Commands:
>
> # postmap hash:/etc/postfix/virtual
> # postfix reload
>
> Alternative:
>
> /etc/postfix/main.cf:
>      virtual_alias_maps = inline:{[hidden email]=[hidden email]}
>
> # postfix reload
>
> Requires Postfix 3.0 or later.
>
> Wietse
>
--
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail.

Le informazioni contenute in questa e-mail e nei files eventualmente allegati sono destinate unicamente ai destinatari della stessa e
sono da considerarsi strettamente riservate. E' proibito copiare, salvare, utilizzare,  inoltrare a terzi e diffondere il contenuto della presente
senza il preventivo consenso, ai sensi dell'articolo 616 c.p. e della Legge n. 196/2003. Se avete ricevuto questo messaggio per errore siete
pregati di comunicarlo immediatamente all'indirizzo mittente, nonché di cancellarne il contenuto senza procedere ad ulteriore o differente trattamento.


******************************************
Ing. Matteo Cazzador
NetLite snc di Cazzador Gagliardi
Corso Vittorio Emanuele II, 188 37069
Villafranca di Verona VR
Tel 0454856656
Fax 0454856655
Email: [hidden email]
Web: http://www.netlite.it
******************************************

Reply | Threaded
Open this post in threaded view
|

Re: Forward/Filter email by sender

Matteo Cazzador-2
In reply to this post by Wietse Venema
Hi, Excuse me, i try with REDIRECT that seems to me the best solution, but i 've  some problems.

The scenario is more complex perhaps than I thought excuse me.

I've an alias address [hidden email], this alias is composed by 5 real mail address @example.com.

What i want is that, when the sender address  is [hidden email] and the receiver address is [hidden email],  i  REDIRECT mail received to another receiver address  like [hidden email] (this is a  real mail address with 2 forward).

I edit  check_sender_access file and i insert

[hidden email] REDIRECT [hidden email]

Where [hidden email] is a  real mail address with 2 forward.

But when i send an email from [hidden email] to [hidden email] i obtain thie error:

"[hidden email] (expanded from [hidden email]): User unknown in virtual alias table"

I dont' understand where the problem is.

Some one can help me please.

Thank's a lot.

Il 21/01/2020 20:02, Wietse Venema ha scritto:
Viktor Dukhovni:
On Tue, Jan 21, 2020 at 01:02:11PM -0500, Wietse Venema wrote:

Hi, i 've a question, i need to forward all email received with a 
specified sender (external domain) to local domain address (suppose 
local postfix domain is "example.com").
Note, the OP said "sender" (address).
Aargh.

This rewrites a recipient.  Bcc'ing based on sender can be done with
"sender_bcc_maps".  Redirecting all mail from a sender can be done with
a "REDIRECT" action in an access(5) table used with
"check_sender_access".
Agreed, redirect or sender_bcc_maps, depending on the purpose.

	Wietse

-- 
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail.

Le informazioni contenute in questa e-mail e nei files eventualmente allegati sono destinate unicamente ai destinatari della stessa e 
sono da considerarsi strettamente riservate. E' proibito copiare, salvare, utilizzare,  inoltrare a terzi e diffondere il contenuto della presente 
senza il preventivo consenso, ai sensi dell'articolo 616 c.p. e della Legge n. 196/2003. Se avete ricevuto questo messaggio per errore siete 
pregati di comunicarlo immediatamente all'indirizzo mittente, nonché di cancellarne il contenuto senza procedere ad ulteriore o differente trattamento.


******************************************
Ing. Matteo Cazzador
NetLite snc di Cazzador Gagliardi
Corso Vittorio Emanuele II, 188 37069
Villafranca di Verona VR
Tel 0454856656
Fax 0454856655
Email: [hidden email]
Web: http://www.netlite.it
******************************************
Reply | Threaded
Open this post in threaded view
|

Re: Forward/Filter email by sender

Matteo Cazzador-2
Hi, i solved using infotest[unixusername]@hostname
and not

[hidden email]

in target address

Example check_sender_access:

[hidden email] REDIRECT unixusername@hostname (i'm using virtualmin, the postifx virtual domain users are present in unix passwd)

Thank's everybody


Il 23/01/2020 12:26, Matteo Cazzador ha scritto:
Hi, Excuse me, i try with REDIRECT that seems to me the best solution, but i 've  some problems.

The scenario is more complex perhaps than I thought excuse me.

I've an alias address [hidden email], this alias is composed by 5 real mail address @example.com.

What i want is that, when the sender address  is [hidden email] and the receiver address is [hidden email],  i  REDIRECT mail received to another receiver address  like [hidden email] (this is a  real mail address with 2 forward).

I edit  check_sender_access file and i insert

[hidden email] REDIRECT [hidden email]

Where [hidden email] is a  real mail address with 2 forward.

But when i send an email from [hidden email] to [hidden email] i obtain thie error:

"[hidden email] (expanded from [hidden email]): User unknown in virtual alias table"

I dont' understand where the problem is.

Some one can help me please.

Thank's a lot.

Il 21/01/2020 20:02, Wietse Venema ha scritto:
Viktor Dukhovni:
On Tue, Jan 21, 2020 at 01:02:11PM -0500, Wietse Venema wrote:

Hi, i 've a question, i need to forward all email received with a 
specified sender (external domain) to local domain address (suppose 
local postfix domain is "example.com").
Note, the OP said "sender" (address).
Aargh.

This rewrites a recipient.  Bcc'ing based on sender can be done with
"sender_bcc_maps".  Redirecting all mail from a sender can be done with
a "REDIRECT" action in an access(5) table used with
"check_sender_access".
Agreed, redirect or sender_bcc_maps, depending on the purpose.

	Wietse

-- 
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail.

Le informazioni contenute in questa e-mail e nei files eventualmente allegati sono destinate unicamente ai destinatari della stessa e 
sono da considerarsi strettamente riservate. E' proibito copiare, salvare, utilizzare,  inoltrare a terzi e diffondere il contenuto della presente 
senza il preventivo consenso, ai sensi dell'articolo 616 c.p. e della Legge n. 196/2003. Se avete ricevuto questo messaggio per errore siete 
pregati di comunicarlo immediatamente all'indirizzo mittente, nonché di cancellarne il contenuto senza procedere ad ulteriore o differente trattamento.


******************************************
Ing. Matteo Cazzador
NetLite snc di Cazzador Gagliardi
Corso Vittorio Emanuele II, 188 37069
Villafranca di Verona VR
Tel 0454856656
Fax 0454856655
Email: [hidden email]
Web: http://www.netlite.it
******************************************
-- 
Rispetta l'ambiente: se non ti è necessario, non stampare questa mail.

Le informazioni contenute in questa e-mail e nei files eventualmente allegati sono destinate unicamente ai destinatari della stessa e 
sono da considerarsi strettamente riservate. E' proibito copiare, salvare, utilizzare,  inoltrare a terzi e diffondere il contenuto della presente 
senza il preventivo consenso, ai sensi dell'articolo 616 c.p. e della Legge n. 196/2003. Se avete ricevuto questo messaggio per errore siete 
pregati di comunicarlo immediatamente all'indirizzo mittente, nonché di cancellarne il contenuto senza procedere ad ulteriore o differente trattamento.


******************************************
Ing. Matteo Cazzador
NetLite snc di Cazzador Gagliardi
Corso Vittorio Emanuele II, 188 37069
Villafranca di Verona VR
Tel 0454856656
Fax 0454856655
Email: [hidden email]
Web: http://www.netlite.it
******************************************