head 1.2; access; symbols RELENG_9_1_0_RELEASE:1.2 RELENG_9_1:1.2.0.6 RELENG_9_1_BP:1.2 RELENG_8_3_0_RELEASE:1.1.1.2.10.1 RELENG_8_3:1.1.1.2.10.1.0.6 RELENG_8_3_BP:1.1.1.2.10.1 RELENG_9_0_0_RELEASE:1.2 RELENG_9_0:1.2.0.4 RELENG_9_0_BP:1.2 RELENG_9:1.2.0.2 RELENG_9_BP:1.2 RELENG_7_4_0_RELEASE:1.1.1.2.2.1 RELENG_8_2_0_RELEASE:1.1.1.2.10.1 RELENG_7_4:1.1.1.2.2.1.0.4 RELENG_7_4_BP:1.1.1.2.2.1 RELENG_8_2:1.1.1.2.10.1.0.4 RELENG_8_2_BP:1.1.1.2.10.1 RELENG_8_1_0_RELEASE:1.1.1.2.10.1 RELENG_8_1:1.1.1.2.10.1.0.2 RELENG_8_1_BP:1.1.1.2.10.1 RELENG_7_3_0_RELEASE:1.1.1.2.2.1 RELENG_7_3:1.1.1.2.2.1.0.2 RELENG_7_3_BP:1.1.1.2.2.1 RELENG_8_0_0_RELEASE:1.1.1.2 RELENG_8_0:1.1.1.2.0.12 RELENG_8_0_BP:1.1.1.2 RELENG_8:1.1.1.2.0.10 RELENG_8_BP:1.1.1.2 RELENG_7_2_0_RELEASE:1.1.1.2 RELENG_7_2:1.1.1.2.0.8 RELENG_7_2_BP:1.1.1.2 RELENG_7_1_0_RELEASE:1.1.1.2 RELENG_6_4_0_RELEASE:1.1.1.1.10.1 RELENG_7_1:1.1.1.2.0.6 RELENG_7_1_BP:1.1.1.2 RELENG_6_4:1.1.1.1.10.1.0.4 RELENG_6_4_BP:1.1.1.1.10.1 RELENG_7_0_0_RELEASE:1.1.1.2 RELENG_6_3_0_RELEASE:1.1.1.1.10.1 RELENG_7_0:1.1.1.2.0.4 RELENG_7_0_BP:1.1.1.2 RELENG_6_3:1.1.1.1.10.1.0.2 RELENG_6_3_BP:1.1.1.1.10.1 v8_14_2:1.1.1.2 RELENG_7:1.1.1.2.0.2 RELENG_7_BP:1.1.1.2 v8_14_1:1.1.1.2 RELENG_6_2_0_RELEASE:1.1.1.1 RELENG_6_2:1.1.1.1.0.18 RELENG_6_2_BP:1.1.1.1 v8_13_8:1.1.1.1 v8_13_7:1.1.1.1 RELENG_5_5_0_RELEASE:1.1.1.1 RELENG_5_5:1.1.1.1.0.16 RELENG_5_5_BP:1.1.1.1 RELENG_6_1_0_RELEASE:1.1.1.1 RELENG_6_1:1.1.1.1.0.14 RELENG_6_1_BP:1.1.1.1 v8_13_6:1.1.1.1 RELENG_6_0_0_RELEASE:1.1.1.1 RELENG_6_0:1.1.1.1.0.12 RELENG_6_0_BP:1.1.1.1 RELENG_6:1.1.1.1.0.10 RELENG_6_BP:1.1.1.1 v8_13_4:1.1.1.1 RELENG_5_4_0_RELEASE:1.1.1.1 RELENG_5_4:1.1.1.1.0.8 RELENG_5_4_BP:1.1.1.1 v8_13_3:1.1.1.1 RELENG_4_11_0_RELEASE:1.1.1.1.2.1 RELENG_4_11:1.1.1.1.2.1.0.2 RELENG_4_11_BP:1.1.1.1.2.1 RELENG_5_3_0_RELEASE:1.1.1.1 RELENG_5_3:1.1.1.1.0.6 RELENG_5_3_BP:1.1.1.1 RELENG_5:1.1.1.1.0.4 RELENG_5_BP:1.1.1.1 RELENG_4:1.1.1.1.0.2 v8_13_1:1.1.1.1 SENDMAIL:1.1.1; locks; strict; comment @# @; 1.2 date 2010.01.26.04.41.15; author gshapiro; state Exp; branches; next 1.1; 1.1 date 2004.08.01.01.04.57; author gshapiro; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2004.08.01.01.04.57; author gshapiro; state Exp; branches 1.1.1.1.2.1 1.1.1.1.4.1 1.1.1.1.10.1; next 1.1.1.2; 1.1.1.2 date 2007.04.09.01.38.51; author gshapiro; state Exp; branches 1.1.1.2.2.1 1.1.1.2.10.1; next ; 1.1.1.1.2.1 date 2004.08.09.00.15.38; author gshapiro; state Exp; branches; next 1.1.1.1.2.2; 1.1.1.1.2.2 date 2007.04.12.03.12.58; author gshapiro; state Exp; branches; next ; 1.1.1.1.4.1 date 2007.04.12.03.12.23; author gshapiro; state Exp; branches; next ; 1.1.1.1.10.1 date 2007.04.12.03.11.37; author gshapiro; state Exp; branches; next 1.1.1.1.10.2; 1.1.1.1.10.2 date 2010.01.31.19.30.47; author gshapiro; state Exp; branches; next ; 1.1.1.2.2.1 date 2010.01.31.19.17.12; author gshapiro; state Exp; branches; next ; 1.1.1.2.10.1 date 2010.01.31.18.59.03; author gshapiro; state Exp; branches; next ; desc @@ 1.2 log @SVN rev 203004 on 2010-01-26 04:41:15Z by gshapiro Merge sendmail 8.14.4 to HEAD MFC after: 4 days @ text @ smfi_insheader

smfi_insheader

SYNOPSIS
#include <libmilter/mfapi.h>
int smfi_insheader(
	SMFICTX *ctx,
	int hdridx,
	char *headerf,
	char *headerv
);
Prepend a header to the current message.
DESCRIPTION
Called When Called only from xxfi_eom.
Effects Prepends a header to the current message.
ARGUMENTS
ArgumentDescription
ctx Opaque context structure.
hdridx The location in the internal header list where this header should be inserted; 0 makes it the topmost header, etc.
headerf The header name, a non-NULL, null-terminated string.
headerv The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
RETURN VALUES smfi_insheader returns MI_FAILURE if:
  • headerf or headerv is NULL.
  • Adding headers in the current connection state is invalid.
  • Memory allocation fails.
  • A network error occurs.
  • SMFIF_ADDHDRS was not set when smfi_register was called.
Otherwise, it returns MI_SUCCESS.
NOTES
  • smfi_insheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader.
  • A filter which calls smfi_insheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register.
  • For smfi_insheader, filter order is important. Later filters will see the header changes made by earlier ones.
  • A filter will receive only headers that have been sent by the SMTP client and those header modifications by earlier filters. It will not receive the headers that are inserted by sendmail itself. This makes the header insertion position highly dependent on the headers that exist in the incoming message and those that are configured to be added by sendmail. For example, sendmail will always add a Received: header to the beginning of the headers. Setting hdridx to 0 will actually insert the header before this Received: header. However, later filters can be easily confused as they receive the added header, but not the Received: header, thus making it hard to insert a header at a fixed position.
  • If hdridx is a number larger than the number of headers in the message, the header will simply be appended.
  • Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multi-line. To make a multi-line header, insert a line feed (ASCII 0x0a, or \n in C) followed by at least one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09, or \t in C). The line feed should NOT be preceded by a carriage return (ASCII 0x0d); the MTA will add this automatically. It is the filter writer's responsibility to ensure that no standards are violated.
  • The MTA adds a leading space to an inserted header value unless the flag SMFIP_HDR_LEADSPC is set, in which case the milter must include any desired leading spaces itself.
EXAMPLE
  int ret;
  SMFICTX *ctx;

  ...

  ret = smfi_insheader(ctx, 0, "First", "See me?");
 

Copyright (c) 2004, 2006, 2009 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.
@ 1.1 log @Initial revision @ text @d1 3 a3 3 smfi_insheader d5 1 a5 1 $Id: smfi_insheader.html,v 1.3 2004/05/04 16:20:34 gshapiro Exp $ d7 1 a7 1

smfi_insheader

d9 1 a9 1 d11 2 a12 2 d25 11 a35 11 d58 2 a59 2 d61 7 a67 7 d73 49 a121 22 d124 2 a125 2 d127 2 a128 2
SYNOPSIS
d20 1
a20 1
d22 1 a22 1
DESCRIPTION
Called When Called only from xxfi_eom.
Effects Prepends a header to the current message.
d38 8 a45 8
ARGUMENTS
ArgumentDescription
ctx Opaque context structure.
hdridx The location in the internal header list where this header should d47 9 a55 9
headerf The header name, a non-NULL, null-terminated string.
headerv The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
RETURN VALUESsmfi_insheader returns MI_FAILURE if:
  • headerf or headerv is NULL.
  • Adding headers in the current connection state is invalid.
  • Memory allocation fails.
  • A network error occurs.
  • SMFIF_ADDHDRS was not set when smfi_register was called.
d69 2 a70 2
NOTES
  • smfi_insheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader.
  • A filter which calls smfi_insheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register.
  • For smfi_insheader, filter order is important. Later filters will see the header changes made by earlier ones.
  • If hdridx is a number larger than the number of headers in the message, the header will simply be appended.
  • Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multi-line. To make a multi-line header, insert a line feed (ASCII 0x0a, or \n in C) followed by at least one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09, or \t in C). The line feed should NOT be preceded by a carriage return (ASCII 0x0d); the MTA will add this automatically. It is the filter writer's responsibility to ensure that no standards are violated.
EXAMPLE
d135 9
a143 9
 

Copyright (c) 2004 Sendmail, Inc. and its suppliers. d145 1 a145 1
d148 3 a150 3
@ 1.1.1.1 log @Import sendmail 8.13.1 @ text @@ 1.1.1.1.4.1 log @MFC: sendmail 8.14.1 @ text @d1 3 a3 3 smfi_insheader d5 1 a5 1 $Id: smfi_insheader.html,v 1.9 2006/12/21 18:30:35 ca Exp $ d7 1 a7 1

smfi_insheader

d9 1 a9 1 d11 2 a12 2 d25 11 a35 11 d58 2 a59 2 d61 7 a67 7 d73 22 a94 44 d97 2 a98 2 d100 2 a101 2
SYNOPSIS
d20 1
a20 1
d22 1 a22 1
DESCRIPTION
Called When Called only from xxfi_eom.
Effects Prepends a header to the current message.
d38 8 a45 8
ARGUMENTS
ArgumentDescription
ctx Opaque context structure.
hdridx The location in the internal header list where this header should d47 9 a55 9
headerf The header name, a non-NULL, null-terminated string.
headerv The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
RETURN VALUESsmfi_insheader returns MI_FAILURE if:
  • headerf or headerv is NULL.
  • Adding headers in the current connection state is invalid.
  • Memory allocation fails.
  • A network error occurs.
  • SMFIF_ADDHDRS was not set when smfi_register was called.
d69 2 a70 2
NOTES
  • smfi_insheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader.
  • A filter which calls smfi_insheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register.
  • For smfi_insheader, filter order is important. Later filters will see the header changes made by earlier ones.
  • A filter will receive only headers that have been sent by the SMTP client and those header modifications by earlier filters. It will not receive the headers that are inserted by sendmail itself. This makes the header insertion position highly dependent on the headers that exist in the incoming message and those that are configured to be added by sendmail. For example, sendmail will always add a Received: header to the beginning of the headers. Setting hdridx to 0 will actually insert the header before this Received: header. However, later filters can be easily confused as they receive the added header, but not the Received: header, thus making it hard to insert a header at a fixed position.
  • If hdridx is a number larger than the number of headers in the message, the header will simply be appended.
  • Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multi-line. To make a multi-line header, insert a line feed (ASCII 0x0a, or \n in C) followed by at least one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09, or \t in C). The line feed should NOT be preceded by a carriage return (ASCII 0x0d); the MTA will add this automatically. It is the filter writer's responsibility to ensure that no standards are violated.
EXAMPLE
d108 9
a116 9
 

Copyright (c) 2004, 2006 Sendmail, Inc. and its suppliers. d118 1 a118 1
d121 3 a123 3
@ 1.1.1.1.10.1 log @MFC: sendmail 8.14.1 @ text @d1 3 a3 3 smfi_insheader d5 1 a5 1 $Id: smfi_insheader.html,v 1.9 2006/12/21 18:30:35 ca Exp $ d7 1 a7 1

smfi_insheader

d9 1 a9 1 d11 2 a12 2 d25 11 a35 11 d58 2 a59 2 d61 7 a67 7 d73 22 a94 44 d97 2 a98 2 d100 2 a101 2
SYNOPSIS
d20 1
a20 1
d22 1 a22 1
DESCRIPTION
Called When Called only from xxfi_eom.
Effects Prepends a header to the current message.
d38 8 a45 8
ARGUMENTS
ArgumentDescription
ctx Opaque context structure.
hdridx The location in the internal header list where this header should d47 9 a55 9
headerf The header name, a non-NULL, null-terminated string.
headerv The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
RETURN VALUESsmfi_insheader returns MI_FAILURE if:
  • headerf or headerv is NULL.
  • Adding headers in the current connection state is invalid.
  • Memory allocation fails.
  • A network error occurs.
  • SMFIF_ADDHDRS was not set when smfi_register was called.
d69 2 a70 2
NOTES
  • smfi_insheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader.
  • A filter which calls smfi_insheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register.
  • For smfi_insheader, filter order is important. Later filters will see the header changes made by earlier ones.
  • A filter will receive only headers that have been sent by the SMTP client and those header modifications by earlier filters. It will not receive the headers that are inserted by sendmail itself. This makes the header insertion position highly dependent on the headers that exist in the incoming message and those that are configured to be added by sendmail. For example, sendmail will always add a Received: header to the beginning of the headers. Setting hdridx to 0 will actually insert the header before this Received: header. However, later filters can be easily confused as they receive the added header, but not the Received: header, thus making it hard to insert a header at a fixed position.
  • If hdridx is a number larger than the number of headers in the message, the header will simply be appended.
  • Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multi-line. To make a multi-line header, insert a line feed (ASCII 0x0a, or \n in C) followed by at least one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09, or \t in C). The line feed should NOT be preceded by a carriage return (ASCII 0x0d); the MTA will add this automatically. It is the filter writer's responsibility to ensure that no standards are violated.
EXAMPLE
d108 9
a116 9
 

Copyright (c) 2004, 2006 Sendmail, Inc. and its suppliers. d118 1 a118 1
d121 3 a123 3
@ 1.1.1.1.10.2 log @SVN rev 203309 on 2010-01-31 19:30:47Z by gshapiro MFC: Merge sendmail 8.14.4 @ text @d5 1 a5 1 $Id: smfi_insheader.html,v 1.10 2009/05/18 23:51:23 ca Exp $ a113 5
  • The MTA adds a leading space to an inserted header value unless the flag SMFIP_HDR_LEADSPC is set, in which case the milter must include any desired leading spaces itself. d138 1 a138 1 Copyright (c) 2004, 2006, 2009 Sendmail, Inc. and its suppliers. @ 1.1.1.2 log @Import sendmail 8.14.1 @ text @d1 3 a3 3 smfi_insheader d5 1 a5 1 $Id: smfi_insheader.html,v 1.9 2006/12/21 18:30:35 ca Exp $ d7 1 a7 1

    smfi_insheader

    d9 1 a9 1 d11 2 a12 2 d25 11 a35 11 d58 2 a59 2 d61 7 a67 7 d73 22 a94 44 d97 2 a98 2 d100 2 a101 2
    SYNOPSIS
    d20 1
    a20 1
    
    d22 1 a22 1
    DESCRIPTION
    Called When Called only from xxfi_eom.
    Effects Prepends a header to the current message.
    d38 8 a45 8
    ARGUMENTS
    ArgumentDescription
    ctx Opaque context structure.
    hdridx The location in the internal header list where this header should d47 9 a55 9
    headerf The header name, a non-NULL, null-terminated string.
    headerv The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
    RETURN VALUESsmfi_insheader returns MI_FAILURE if:
    • headerf or headerv is NULL.
    • Adding headers in the current connection state is invalid.
    • Memory allocation fails.
    • A network error occurs.
    • SMFIF_ADDHDRS was not set when smfi_register was called.
    d69 2 a70 2
    NOTES
    • smfi_insheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader.
    • A filter which calls smfi_insheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register.
    • For smfi_insheader, filter order is important. Later filters will see the header changes made by earlier ones.
    • A filter will receive only headers that have been sent by the SMTP client and those header modifications by earlier filters. It will not receive the headers that are inserted by sendmail itself. This makes the header insertion position highly dependent on the headers that exist in the incoming message and those that are configured to be added by sendmail. For example, sendmail will always add a Received: header to the beginning of the headers. Setting hdridx to 0 will actually insert the header before this Received: header. However, later filters can be easily confused as they receive the added header, but not the Received: header, thus making it hard to insert a header at a fixed position.
    • If hdridx is a number larger than the number of headers in the message, the header will simply be appended.
    • Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multi-line. To make a multi-line header, insert a line feed (ASCII 0x0a, or \n in C) followed by at least one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09, or \t in C). The line feed should NOT be preceded by a carriage return (ASCII 0x0d); the MTA will add this automatically. It is the filter writer's responsibility to ensure that no standards are violated.
    EXAMPLE
    d108 9
    a116 9
     

    Copyright (c) 2004, 2006 Sendmail, Inc. and its suppliers. d118 1 a118 1
    d121 3 a123 3
    @ 1.1.1.2.2.1 log @SVN rev 203305 on 2010-01-31 19:17:12Z by gshapiro MFC: Merge sendmail 8.14.4 Approved by: re (kensmith) @ text @d5 1 a5 1 $Id: smfi_insheader.html,v 1.10 2009/05/18 23:51:23 ca Exp $ a113 5
  • The MTA adds a leading space to an inserted header value unless the flag SMFIP_HDR_LEADSPC is set, in which case the milter must include any desired leading spaces itself. d138 1 a138 1 Copyright (c) 2004, 2006, 2009 Sendmail, Inc. and its suppliers. @ 1.1.1.2.10.1 log @SVN rev 203300 on 2010-01-31 18:59:03Z by gshapiro MFC: Merge sendmail 8.14.4 @ text @d5 1 a5 1 $Id: smfi_insheader.html,v 1.10 2009/05/18 23:51:23 ca Exp $ a113 5
  • The MTA adds a leading space to an inserted header value unless the flag SMFIP_HDR_LEADSPC is set, in which case the milter must include any desired leading spaces itself. d138 1 a138 1 Copyright (c) 2004, 2006, 2009 Sendmail, Inc. and its suppliers. @ 1.1.1.1.2.1 log @MFC: sendmail 8.13.1 import and related changes @ text @@ 1.1.1.1.2.2 log @MFC: sendmail 8.14.1 @ text @d1 3 a3 3 smfi_insheader d5 1 a5 1 $Id: smfi_insheader.html,v 1.9 2006/12/21 18:30:35 ca Exp $ d7 1 a7 1

    smfi_insheader

    d9 1 a9 1 d11 2 a12 2 d25 11 a35 11 d58 2 a59 2 d61 7 a67 7 d73 22 a94 44 d97 2 a98 2 d100 2 a101 2
    SYNOPSIS
    d20 1
    a20 1
    
    d22 1 a22 1
    DESCRIPTION
    Called When Called only from xxfi_eom.
    Effects Prepends a header to the current message.
    d38 8 a45 8
    ARGUMENTS
    ArgumentDescription
    ctx Opaque context structure.
    hdridx The location in the internal header list where this header should d47 9 a55 9
    headerf The header name, a non-NULL, null-terminated string.
    headerv The header value to be added, a non-NULL, null-terminated string. This may be the empty string.
    RETURN VALUESsmfi_insheader returns MI_FAILURE if:
    • headerf or headerv is NULL.
    • Adding headers in the current connection state is invalid.
    • Memory allocation fails.
    • A network error occurs.
    • SMFIF_ADDHDRS was not set when smfi_register was called.
    d69 2 a70 2
    NOTES
    • smfi_insheader does not change a message's existing headers. To change a header's current value, use smfi_chgheader.
    • A filter which calls smfi_insheader must have set the SMFIF_ADDHDRS flag in the smfiDesc_str passed to smfi_register.
    • For smfi_insheader, filter order is important. Later filters will see the header changes made by earlier ones.
    • A filter will receive only headers that have been sent by the SMTP client and those header modifications by earlier filters. It will not receive the headers that are inserted by sendmail itself. This makes the header insertion position highly dependent on the headers that exist in the incoming message and those that are configured to be added by sendmail. For example, sendmail will always add a Received: header to the beginning of the headers. Setting hdridx to 0 will actually insert the header before this Received: header. However, later filters can be easily confused as they receive the added header, but not the Received: header, thus making it hard to insert a header at a fixed position.
    • If hdridx is a number larger than the number of headers in the message, the header will simply be appended.
    • Neither the name nor the value of the header is checked for standards compliance. However, each line of the header must be under 2048 characters and should be under 998 characters. If longer headers are needed, make them multi-line. To make a multi-line header, insert a line feed (ASCII 0x0a, or \n in C) followed by at least one whitespace character such as a space (ASCII 0x20) or tab (ASCII 0x09, or \t in C). The line feed should NOT be preceded by a carriage return (ASCII 0x0d); the MTA will add this automatically. It is the filter writer's responsibility to ensure that no standards are violated.
    EXAMPLE
    d108 9
    a116 9
     

    Copyright (c) 2004, 2006 Sendmail, Inc. and its suppliers. d118 1 a118 1
    d121 3 a123 3
    @