Add extra headers when forwarding

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Add extra headers when forwarding

Shameem Ahamed-2
Hi All,

I have one postfix mail server, and a forward server. The mail server accepts all the mails, and forwards mails to the forward server if the mail is a forward.

Currently, when the postfix forwards the mails to the forward server it is not adding any headers for the e-mail for which it forwards.
 
I want to add extra headers to mail header when there is a mail forward. Precisely, I want to add the e-mail id for which the forward happens.

Is there any way to add those details to the e-mail headers.

Regards,
Shameem




     
Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Bas Mevissen-4
On Mon, 2010-02-22 at 22:28 +0530, Shameem Ahamed wrote:
> Hi All,
>
> I have one postfix mail server, and a forward server. The mail server accepts all the mails, and forwards mails to the forward server if the mail is a forward.
>
> Currently, when the postfix forwards the mails to the forward server it is not adding any headers for the e-mail for which it forwards.
>  
> I want to add extra headers to mail header when there is a mail forward. Precisely, I want to add the e-mail id for which the forward happens.
>
> Is there any way to add those details to the e-mail headers.

You could use a procmail rule to add an extra header with formail:

:0 fw:
| formail -A "X-Mail-Tracking: $LOGNAME@$HOST forwarded"

Bas.


Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Magnus Bäck
In reply to this post by Shameem Ahamed-2
On Monday, February 22, 2010 at 17:58 CET,
     Shameem Ahamed <[hidden email]> wrote:

> I have one postfix mail server, and a forward server. The mail server
> accepts all the mails, and forwards mails to the forward server if the
> mail is a forward.
>
> Currently, when the postfix forwards the mails to the forward server
> it is not adding any headers for the e-mail for which it forwards.
>
> I want to add extra headers to mail header when there is a mail
> forward. Precisely, I want to add the e-mail id for which the forward
> happens.

What is "e-mail id"? The Message-Id header is already present,
and Postfix always adds its own queue id in a Received header.

What problem are you trying to solve?

--
Magnus Bäck
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Wietse Venema
In reply to this post by Shameem Ahamed-2
Shameem Ahamed:
> Currently, when the postfix forwards the mails to the forward
> server it is not adding any headers for the e-mail for which it
> forwards.

As required by the SMTP protocol, Postfix prepends a Received:
message header with the local queue ID, a date stamp, and other
trace information.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Shameem Ahamed-2
Yes it adds received header. But it doesn't add the user details.

Below is the header details.

Received: from mx1 (INBOUNDSERVER [IPADDRESS])
by FORWARDSERVER (Postfix) with ESMTP id BA40E4940D6
for ; Thu, 18 Feb 2010 02:19:28 +0000 (GMT)
Received: from snt0-omc4-s3.snt0.hotmail.com (snt0-omc4-s3.snt0.hotmail.com [65.55.90.206])
by MX1 SERVER (Postfix) with ESMTP id B0B74618036
for ; Thu, 18 Feb 2010 02:19:27 +0000 (GMT)
Received: from SNT111-W21 ([65.55.90.200]) by snt0-omc4-s3.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);
Wed, 17 Feb 2010 18:19:26 -0800

Regards,
Shameem

--- On Mon, 2/22/10, Wietse Venema <[hidden email]> wrote:

> From: Wietse Venema <[hidden email]>
> Subject: Re: Add extra headers when forwarding
> To: "Shameem Ahamed" <[hidden email]>
> Cc: [hidden email]
> Date: Monday, February 22, 2010, 11:42 PM
> Shameem Ahamed:
> > Currently, when the postfix forwards the mails to the
> forward
> > server it is not adding any headers for the e-mail for
> which it
> > forwards.
>
> As required by the SMTP protocol, Postfix prepends a
> Received:
> message header with the local queue ID, a date stamp, and
> other
> trace information.
>
>     Wietse
>



Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Shameem Ahamed-2
In reply to this post by Bas Mevissen-4
Can i add this in main.cf?

I want to add the extra details only for the forward maps.

Can you give me some more info on ow to add this ?.

Regards,
Shameem

--- On Mon, 2/22/10, Bas Mevissen <[hidden email]> wrote:

> From: Bas Mevissen <[hidden email]>
> Subject: Re: Add extra headers when forwarding
> To: "Shameem Ahamed" <[hidden email]>
> Cc: [hidden email]
> Date: Monday, February 22, 2010, 10:43 PM
> On Mon, 2010-02-22 at 22:28 +0530,
> Shameem Ahamed wrote:
> > Hi All,
> >
> > I have one postfix mail server, and a forward server.
> The mail server accepts all the mails, and forwards mails to
> the forward server if the mail is a forward.
> >
> > Currently, when the postfix forwards the mails to the
> forward server it is not adding any headers for the e-mail
> for which it forwards.
> > 
> > I want to add extra headers to mail header when there
> is a mail forward. Precisely, I want to add the e-mail id
> for which the forward happens.
> >
> > Is there any way to add those details to the e-mail
> headers.
>
> You could use a procmail rule to add an extra header with
> formail:
>
> :0 fw:
> | formail -A "X-Mail-Tracking: $LOGNAME@$HOST forwarded"
>
> Bas.
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Shameem Ahamed-2
In reply to this post by Magnus Bäck
Ok, i will explain you the scenario.

suppose i have an e-mail account, [hidden email], and i have setup e-mail forwarding for this id, to [hidden email].


If somebody ([hidden email]) sends me a mail to [hidden email], it gets delivered to my yahoo id. In this cases, in headers i am able to see [hidden email] and [hidden email]. But the actual e-mail address [hidden email] is missing from the headers.

Regards,
Shameem

--- On Mon, 2/22/10, Magnus Bäck <[hidden email]> wrote:

> From: Magnus Bäck <[hidden email]>
> Subject: Re: Add extra headers when forwarding
> To: [hidden email]
> Date: Monday, February 22, 2010, 11:37 PM
> On Monday, February 22, 2010 at 17:58
> CET,
>      Shameem Ahamed <[hidden email]>
> wrote:
>
> > I have one postfix mail server, and a forward server.
> The mail server
> > accepts all the mails, and forwards mails to the
> forward server if the
> > mail is a forward.
> >
> > Currently, when the postfix forwards the mails to the
> forward server
> > it is not adding any headers for the e-mail for which
> it forwards.
> >
> > I want to add extra headers to mail header when there
> is a mail
> > forward. Precisely, I want to add the e-mail id for
> which the forward
> > happens.
>
> What is "e-mail id"? The Message-Id header is already
> present,
> and Postfix always adds its own queue id in a Received
> header.
>
> What problem are you trying to solve?
>
> --
> Magnus Bäck
> [hidden email]
>



Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Wietse Venema
In reply to this post by Shameem Ahamed-2
Shameem Ahamed:
> Yes it adds received header. But it doesn't add the user details.
>
> Below is the header details.
>
> Received: from mx1 (INBOUNDSERVER [IPADDRESS])
> by FORWARDSERVER (Postfix) with ESMTP id BA40E4940D6
      ||||||||||||
      vvvvvvvvvvvv
> for <RECIPIENT>; Thu, 18 Feb 2010 02:19:28 +0000 (GMT)
      ^^^^^^^^^^^^
      ||||||||||||
The recipient is HERE.

If you don't see the recipient, then you use a BROKEN MAIL READER.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Ansgar Wiechers
In reply to this post by Shameem Ahamed-2
On 2010-02-23 Shameem Ahamed wrote:
> Can i add this in main.cf?

No.

> I want to add the extra details only for the forward maps.
>
> Can you give me some more info on ow to add this ?.

man procmail
man procmailrc
man procmailex

Regards
Ansgar Wiechers
--
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky
Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Shameem Ahamed-2
In reply to this post by Wietse Venema
I am seeing just ';' in that place.

Am i doing anything wrong ?.


Shameem

--- On Tue, 2/23/10, Wietse Venema <[hidden email]> wrote:

> From: Wietse Venema <[hidden email]>
> Subject: Re: Add extra headers when forwarding
> To: "Postfix users" <[hidden email]>
> Date: Tuesday, February 23, 2010, 12:48 AM
> Shameem Ahamed:
> > Yes it adds received header. But it doesn't add the
> user details.
> >
> > Below is the header details.
> >
> > Received: from mx1 (INBOUNDSERVER [IPADDRESS])
> > by FORWARDSERVER (Postfix) with ESMTP id BA40E4940D6
>       ||||||||||||
>       vvvvvvvvvvvv
> > for <RECIPIENT>; Thu, 18 Feb 2010 02:19:28 +0000
> (GMT)
>       ^^^^^^^^^^^^
>       ||||||||||||
> The recipient is HERE.
>
> If you don't see the recipient, then you use a BROKEN MAIL
> READER.
>
>     Wietse
>



Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Wietse Venema
Shameem Ahamed:

> Yes it adds received header. But it doesn't add the
> user details.
>
> > Received: from mx1 (INBOUNDSERVER [IPADDRESS])
> > by FORWARDSERVER (Postfix) with ESMTP id BA40E4940D6
>       ||||||||||||
>       vvvvvvvvvvvv
> > for <RECIPIENT>; Thu, 18 Feb 2010 02:19:28 +0000 (GMT)
>       ^^^^^^^^^^^^
>       ||||||||||||
> The recipient is HERE.
>
> If you don't see the recipient, then you use a BROKEN MAIL READER.

Shameem Ahamed:
> I am seeing just ';' in that place.
>
> Am i doing anything wrong ?.

Yes. You are using a BROKEN MAIL READER.

Namely, a mail reader that processes plain text email as if it is
HTML, and that removes all text that looks like an HTML tag (such
as the recipient address in a Postfix Received: header.

If you examine this thread via one of the on-line websites that
archive this mailing list, then you will understand what I mean.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Add extra headers when forwarding

Shameem Ahamed-2
Hi Wietse,


Yes you are correct. My browser was not showing those headers.

Thanks for the prompt reply.


Regards,
Shameem

--- On Tue, 23/2/10, Wietse Venema <[hidden email]> wrote:

> From: Wietse Venema <[hidden email]>
> Subject: Re: Add extra headers when forwarding
> To: "Postfix users" <[hidden email]>
> Date: Tuesday, 23 February, 2010, 1:18 AM
> Shameem Ahamed:
> > Yes it adds received header. But it doesn't add the
> > user details.
> >
> > > Received: from mx1 (INBOUNDSERVER [IPADDRESS])
> > > by FORWARDSERVER (Postfix) with ESMTP id
> BA40E4940D6
> >       ||||||||||||
> >       vvvvvvvvvvvv
> > > for <RECIPIENT>; Thu, 18 Feb 2010 02:19:28
> +0000 (GMT)
> >       ^^^^^^^^^^^^
> >       ||||||||||||
> > The recipient is HERE.
> >
> > If you don't see the recipient, then you use a BROKEN
> MAIL READER.
>
> Shameem Ahamed:
> > I am seeing just ';' in that place.
> >
> > Am i doing anything wrong ?.
>
> Yes. You are using a BROKEN MAIL READER.
>
> Namely, a mail reader that processes plain text email as if
> it is
> HTML, and that removes all text that looks like an HTML tag
> (such
> as the recipient address in a Postfix Received: header.
>
> If you examine this thread via one of the on-line websites
> that
> archive this mailing list, then you will understand what I
> mean.
>
>     Wietse
>


      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/