mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-29 05:07:58 +00:00
postfix-2.5-20071229
This commit is contained in:
parent
3abc0372e2
commit
38fd372a13
@ -14077,3 +14077,9 @@ Apologies for any names omitted.
|
||||
Cleanup: further refinements of the Milter code, allowing
|
||||
for multiple macro overrides. The code is now ready for
|
||||
serious testing. File: milter/milter8.c.
|
||||
|
||||
20071229
|
||||
|
||||
Bugfix: the Milter client did not replace the Postfix-specific
|
||||
form for unknown host names by the Sendmail-specific form.
|
||||
File: milter/milter8.c.
|
||||
|
@ -1,5 +1,10 @@
|
||||
Wish list:
|
||||
|
||||
Milter client: send [ipaddress] instead of "unknown".
|
||||
|
||||
The cleanup server should report "file too large" milter
|
||||
errors as permanent errors.
|
||||
|
||||
In the SMTP client, handle 421 replies in smtp_loop() by
|
||||
having the input function raise a flag after detecting 421
|
||||
(kill connection caching and be sure to do the right thing
|
||||
|
@ -20,7 +20,7 @@
|
||||
* Patches change both the patchlevel and the release date. Snapshots have no
|
||||
* patchlevel; they change the release date only.
|
||||
*/
|
||||
#define MAIL_RELEASE_DATE "20071227"
|
||||
#define MAIL_RELEASE_DATE "20071229"
|
||||
#define MAIL_VERSION_NUMBER "2.5"
|
||||
|
||||
#ifdef SNAPSHOT
|
||||
|
@ -1773,6 +1773,17 @@ static const char *milter8_conn_event(MILTER *m,
|
||||
MILTER8 *milter = (MILTER8 *) m;
|
||||
int port;
|
||||
int skip_reply;
|
||||
const char *sm_name;
|
||||
char *ptr = 0;
|
||||
const char *resp;
|
||||
|
||||
/*
|
||||
* Need a global definition for "unknown" host name or address that is
|
||||
* shared by smtpd, cleanup and libmilter.
|
||||
*/
|
||||
#define XXX_UNKNOWN "unknown"
|
||||
#define STR_EQ(x,y) (strcmp((x), (y)) == 0)
|
||||
#define STR_NE(x,y) (strcmp((x), (y)) != 0)
|
||||
|
||||
/*
|
||||
* XXX Sendmail 8 libmilter closes the MTA-to-filter socket when it finds
|
||||
@ -1805,40 +1816,51 @@ static const char *milter8_conn_event(MILTER *m,
|
||||
}
|
||||
milter->state = MILTER8_STAT_ENVELOPE;
|
||||
skip_reply = ((milter->ev_mask & SMFIP_NR_CONN) != 0);
|
||||
/* Transform unknown hostname from Postfix to Sendmail form. */
|
||||
sm_name = (STR_NE(client_name, XXX_UNKNOWN) ? client_name :
|
||||
STR_EQ(client_addr, XXX_UNKNOWN) ? client_name :
|
||||
(ptr = concatenate("[", client_addr, "]", (char *) 0)));
|
||||
switch (addr_family) {
|
||||
case AF_INET:
|
||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, client_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_INET,
|
||||
MILTER8_DATA_NSHORT, htons(port),
|
||||
MILTER8_DATA_STRING, client_addr,
|
||||
MILTER8_DATA_END));
|
||||
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, sm_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_INET,
|
||||
MILTER8_DATA_NSHORT, htons(port),
|
||||
MILTER8_DATA_STRING, client_addr,
|
||||
MILTER8_DATA_END);
|
||||
break;
|
||||
#ifdef HAS_IPV6
|
||||
case AF_INET6:
|
||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, client_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_INET6,
|
||||
MILTER8_DATA_NSHORT, htons(port),
|
||||
MILTER8_DATA_STRING, client_addr,
|
||||
MILTER8_DATA_END));
|
||||
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, sm_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_INET6,
|
||||
MILTER8_DATA_NSHORT, htons(port),
|
||||
MILTER8_DATA_STRING, client_addr,
|
||||
MILTER8_DATA_END);
|
||||
break;
|
||||
#endif
|
||||
case AF_UNIX:
|
||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, client_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_UNIX,
|
||||
MILTER8_DATA_NSHORT, htons(0),
|
||||
MILTER8_DATA_STRING, client_addr,
|
||||
MILTER8_DATA_END));
|
||||
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, sm_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_UNIX,
|
||||
MILTER8_DATA_NSHORT, htons(0),
|
||||
MILTER8_DATA_STRING, client_addr,
|
||||
MILTER8_DATA_END);
|
||||
break;
|
||||
default:
|
||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, client_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
|
||||
MILTER8_DATA_END));
|
||||
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||
skip_reply, macros,
|
||||
MILTER8_DATA_STRING, sm_name,
|
||||
MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
|
||||
MILTER8_DATA_END);
|
||||
break;
|
||||
}
|
||||
if (ptr != 0)
|
||||
myfree(ptr);
|
||||
return (resp);
|
||||
default:
|
||||
msg_panic("%s: milter %s: bad state %d",
|
||||
myname, milter->m.name, milter->state);
|
||||
|
@ -17,8 +17,8 @@
|
||||
/*
|
||||
/* Arguments:
|
||||
/* .IP fd
|
||||
/* File descriptor in the range 0..FD_SETSIZE. Its value is logged
|
||||
/* when verbose logging is turned on.
|
||||
/* File descriptor whose value is logged when verbose logging
|
||||
/* is turned on.
|
||||
/* .IP buf
|
||||
/* Read buffer pointer. Not used.
|
||||
/* .IP buf_len
|
||||
|
@ -17,8 +17,8 @@
|
||||
/*
|
||||
/* Arguments:
|
||||
/* .IP fd
|
||||
/* File descriptor in the range 0..FD_SETSIZE. Its value is logged
|
||||
/* when verbose logging is turned on.
|
||||
/* File descriptor whose value is logged when verbose logging
|
||||
/* is turned on.
|
||||
/* .IP buf
|
||||
/* Write buffer pointer. Not used.
|
||||
/* .IP buf_len
|
||||
|
Loading…
x
Reference in New Issue
Block a user