Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Add custom header

1,162 views
Skip to first unread message

Markus Sonnenberg

unread,
Nov 10, 2011, 3:51:44 AM11/10/11
to
Hi,

i'm looking for an easy solution to add custom header within sendmail. i
know that mimedefang is an option but i don't want to include mimedefang
only to add a custom header.

is there any way for main.mc/sendmail.cf doing this? some kind of macro?

regards
markus

ct,
--
Das Abspringen einer Begrenzungsmauer dient nicht dem direkten
Zurücklegen des Arbeitsweges.
http://rz-amper.homeunix.net

Andrzej Adam Filip

unread,
Nov 10, 2011, 4:06:49 AM11/10/11
to
Markus Sonnenberg <lassmic...@rz-amper.homeunix.net> wrote:
> i'm looking for an easy solution to add custom header within
> sendmail. i know that mimedefang is an option but i don't want to
> include mimedefang only to add a custom header.
>
> is there any way for main.mc/sendmail.cf doing this? some kind of
> macro?

sendmail.cf can add headers to emails (see H lines in sendmail.cf) but
it may be incapable to pass specific information you want to the header.
Could you be more specific?

--
[pl>en Andrew] Andrzej A. Filip : an...@onet.eu : Andrze...@gmail.com
If one studies too zealously, one easily loses his pants.
-- A. Einstein.

Markus Sonnenberg

unread,
Nov 10, 2011, 4:58:45 AM11/10/11
to
On 11/10/2011 10:06 AM, Andrzej Adam Filip wrote:
> Markus Sonnenberg<lassmic...@rz-amper.homeunix.net> wrote:
>> i'm looking for an easy solution to add custom header within
>> sendmail. i know that mimedefang is an option but i don't want to
>> include mimedefang only to add a custom header.
>>
>> is there any way for main.mc/sendmail.cf doing this? some kind of
>> macro?
>
> sendmail.cf can add headers to emails (see H lines in sendmail.cf) but
> it may be incapable to pass specific information you want to the header.
> Could you be more specific?
>

in first place i need to add a "X-EDICODE:blablabla" header. one of our
vendors wants to process our automatically generated mails. i know that
it might be smarter to get the generating process to add this header to
the mail. but the mainframe folks told me that this is not as easy as it
sounds. they barely managed to write a process to generate mails.

the second header would be some kind of disclaimer or "X-Company"
header. sounds stupid, i know.

Markus Sonnenberg

unread,
Nov 10, 2011, 5:04:28 AM11/10/11
to
On 11/10/2011 10:06 AM, Andrzej Adam Filip wrote:
> sendmail.cf can add headers to emails (see H lines in sendmail.cf) but

ah, i see. something like ...

HX-EDICODE: BlaBlub Bla

... would do the trick. am i right? but how to add this to main.mc. i
don't want to edit sendmail.cf everytime after creating it through m4.

Andrzej Adam Filip

unread,
Nov 10, 2011, 5:56:12 AM11/10/11
to
Markus Sonnenberg <lassmic...@rz-amper.homeunix.net> wrote:
> On 11/10/2011 10:06 AM, Andrzej Adam Filip wrote:
>> [...] sendmail.cf can add headers to emails (see H lines in
>> sendmail.cf) but [...]
>
> ah, i see. something like ...
>
> HX-EDICODE: BlaBlub Bla
>
> ... would do the trick. am i right? but how to add this to main.mc. i
> don't want to edit sendmail.cf everytime after creating it through m4.
>
> ct,

I would dare to suggest:

LOCAL_CONFIG
HX-Header1: BlaBlub Bla
HX-Header2: usia siusia
divert(0)dnl

0) Wait a day or two for critique of the above :-)
1) LOCAL_CONFIG will not put your H lines together with sendmail.org H
lines but it seems to be the closest/best place currently _available_
via m4 files
2) The last line [divert(0)] is not necessary if you put the lines at
the very end of *.mc file

--
[pl>en Andrew] Andrzej A. Filip : an...@onet.eu : Andrze...@gmail.com
He who despises himself nevertheless esteems himself as a self-despiser.
-- Friedrich Nietzsche

Markus Sonnenberg

unread,
Nov 10, 2011, 7:13:29 AM11/10/11
to
On 11/10/2011 11:56 AM, Andrzej Adam Filip wrote:
> Markus Sonnenberg<lassmic...@rz-amper.homeunix.net> wrote:
>> On 11/10/2011 10:06 AM, Andrzej Adam Filip wrote:
>>> [...] sendmail.cf can add headers to emails (see H lines in
>>> sendmail.cf) but [...]
>>
>> ah, i see. something like ...
>>
>> HX-EDICODE: BlaBlub Bla
>>
>> ... would do the trick. am i right? but how to add this to main.mc. i
>> don't want to edit sendmail.cf everytime after creating it through m4.
>>
>> ct,
>
> I would dare to suggest:
>
> LOCAL_CONFIG
> HX-Header1: BlaBlub Bla
> HX-Header2: usia siusia
> divert(0)dnl
>
> 0) Wait a day or two for critique of the above :-)
> 1) LOCAL_CONFIG will not put your H lines together with sendmail.org H
> lines but it seems to be the closest/best place currently _available_
> via m4 files
> 2) The last line [divert(0)] is not necessary if you put the lines at
> the very end of *.mc file
>

works great. as long i have this setting in my main.mc i'm happy. thanks
a lot.

tr...@fury.scancode.ru

unread,
Jul 29, 2012, 6:01:57 PM7/29/12
to
On Thursday, November 10, 2011 12:56:12 PM UTC+2, Andrzej Adam Filip wrote:
> LOCAL_CONFIG
> HX-Header1: BlaBlub Bla
> HX-Header2: usia siusia
> divert(0)dnl

Andrzej,

Can you please point me how to add custom header only if user has authenticated? ${auth_type} somehow?

tr...@fury.scancode.ru

unread,
Jul 29, 2012, 6:23:55 PM7/29/12
to
On Monday, July 30, 2012 1:01:57 AM UTC+3, tr...@fury.scancode.ru wrote:
> Can you please point me how to add custom header only if user has authenticated? ${auth_type} somehow?

Answer myself:

LOCAL_CONFIG
H?auth_type?X-Auth: authenticated as ${auth_authen} with ${auth_type}

Asle Skage

unread,
Aug 28, 2012, 5:06:48 AM8/28/12
to
Hi,

I an also trying to do this.
It has been tested, but it does always add the X-header regardless ig
the user is authenticated or not. The difference is that the fields are
empty
when not authenticated.

While using Google I also found this:
Do not declare rulesets in the LOCAL_CONFIG section. It can be used to
declare local database maps or whatever.(from this
page:http://www.sendmail.com/sm/open_source/docs/m4/tweaking_rulesets.html)

I have problems finding complete and useful iformation about this.








<tr...@fury.scancode.ru> wrote in message
news:805a4bfa-0f79-4cf4...@googlegroups.com...
0 new messages