mirror of
https://github.com/vdukhovni/postfix
synced 2025-09-02 15:15:24 +00:00
postfix-2.5-20071229
This commit is contained in:
committed by
Viktor Dukhovni
parent
3abc0372e2
commit
38fd372a13
@@ -14077,3 +14077,9 @@ Apologies for any names omitted.
|
|||||||
Cleanup: further refinements of the Milter code, allowing
|
Cleanup: further refinements of the Milter code, allowing
|
||||||
for multiple macro overrides. The code is now ready for
|
for multiple macro overrides. The code is now ready for
|
||||||
serious testing. File: milter/milter8.c.
|
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:
|
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
|
In the SMTP client, handle 421 replies in smtp_loop() by
|
||||||
having the input function raise a flag after detecting 421
|
having the input function raise a flag after detecting 421
|
||||||
(kill connection caching and be sure to do the right thing
|
(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
|
* Patches change both the patchlevel and the release date. Snapshots have no
|
||||||
* patchlevel; they change the release date only.
|
* patchlevel; they change the release date only.
|
||||||
*/
|
*/
|
||||||
#define MAIL_RELEASE_DATE "20071227"
|
#define MAIL_RELEASE_DATE "20071229"
|
||||||
#define MAIL_VERSION_NUMBER "2.5"
|
#define MAIL_VERSION_NUMBER "2.5"
|
||||||
|
|
||||||
#ifdef SNAPSHOT
|
#ifdef SNAPSHOT
|
||||||
|
@@ -1773,6 +1773,17 @@ static const char *milter8_conn_event(MILTER *m,
|
|||||||
MILTER8 *milter = (MILTER8 *) m;
|
MILTER8 *milter = (MILTER8 *) m;
|
||||||
int port;
|
int port;
|
||||||
int skip_reply;
|
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
|
* 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;
|
milter->state = MILTER8_STAT_ENVELOPE;
|
||||||
skip_reply = ((milter->ev_mask & SMFIP_NR_CONN) != 0);
|
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) {
|
switch (addr_family) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||||
skip_reply, macros,
|
skip_reply, macros,
|
||||||
MILTER8_DATA_STRING, client_name,
|
MILTER8_DATA_STRING, sm_name,
|
||||||
MILTER8_DATA_OCTET, SMFIA_INET,
|
MILTER8_DATA_OCTET, SMFIA_INET,
|
||||||
MILTER8_DATA_NSHORT, htons(port),
|
MILTER8_DATA_NSHORT, htons(port),
|
||||||
MILTER8_DATA_STRING, client_addr,
|
MILTER8_DATA_STRING, client_addr,
|
||||||
MILTER8_DATA_END));
|
MILTER8_DATA_END);
|
||||||
|
break;
|
||||||
#ifdef HAS_IPV6
|
#ifdef HAS_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||||
skip_reply, macros,
|
skip_reply, macros,
|
||||||
MILTER8_DATA_STRING, client_name,
|
MILTER8_DATA_STRING, sm_name,
|
||||||
MILTER8_DATA_OCTET, SMFIA_INET6,
|
MILTER8_DATA_OCTET, SMFIA_INET6,
|
||||||
MILTER8_DATA_NSHORT, htons(port),
|
MILTER8_DATA_NSHORT, htons(port),
|
||||||
MILTER8_DATA_STRING, client_addr,
|
MILTER8_DATA_STRING, client_addr,
|
||||||
MILTER8_DATA_END));
|
MILTER8_DATA_END);
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
case AF_UNIX:
|
case AF_UNIX:
|
||||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||||
skip_reply, macros,
|
skip_reply, macros,
|
||||||
MILTER8_DATA_STRING, client_name,
|
MILTER8_DATA_STRING, sm_name,
|
||||||
MILTER8_DATA_OCTET, SMFIA_UNIX,
|
MILTER8_DATA_OCTET, SMFIA_UNIX,
|
||||||
MILTER8_DATA_NSHORT, htons(0),
|
MILTER8_DATA_NSHORT, htons(0),
|
||||||
MILTER8_DATA_STRING, client_addr,
|
MILTER8_DATA_STRING, client_addr,
|
||||||
MILTER8_DATA_END));
|
MILTER8_DATA_END);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return (milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
resp = milter8_event(milter, SMFIC_CONNECT, SMFIP_NOCONNECT,
|
||||||
skip_reply, macros,
|
skip_reply, macros,
|
||||||
MILTER8_DATA_STRING, client_name,
|
MILTER8_DATA_STRING, sm_name,
|
||||||
MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
|
MILTER8_DATA_OCTET, SMFIA_UNKNOWN,
|
||||||
MILTER8_DATA_END));
|
MILTER8_DATA_END);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
if (ptr != 0)
|
||||||
|
myfree(ptr);
|
||||||
|
return (resp);
|
||||||
default:
|
default:
|
||||||
msg_panic("%s: milter %s: bad state %d",
|
msg_panic("%s: milter %s: bad state %d",
|
||||||
myname, milter->m.name, milter->state);
|
myname, milter->m.name, milter->state);
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
/*
|
/*
|
||||||
/* Arguments:
|
/* Arguments:
|
||||||
/* .IP fd
|
/* .IP fd
|
||||||
/* File descriptor in the range 0..FD_SETSIZE. Its value is logged
|
/* File descriptor whose value is logged when verbose logging
|
||||||
/* when verbose logging is turned on.
|
/* is turned on.
|
||||||
/* .IP buf
|
/* .IP buf
|
||||||
/* Read buffer pointer. Not used.
|
/* Read buffer pointer. Not used.
|
||||||
/* .IP buf_len
|
/* .IP buf_len
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
/*
|
/*
|
||||||
/* Arguments:
|
/* Arguments:
|
||||||
/* .IP fd
|
/* .IP fd
|
||||||
/* File descriptor in the range 0..FD_SETSIZE. Its value is logged
|
/* File descriptor whose value is logged when verbose logging
|
||||||
/* when verbose logging is turned on.
|
/* is turned on.
|
||||||
/* .IP buf
|
/* .IP buf
|
||||||
/* Write buffer pointer. Not used.
|
/* Write buffer pointer. Not used.
|
||||||
/* .IP buf_len
|
/* .IP buf_len
|
||||||
|
Reference in New Issue
Block a user