Cleanup: smtpd now replies with 555 when the client sends
unrecognized RCPT TO parameters, as required by RFC 1869
(problem report by Robert Norris @ its.monash.edu.au).
+
+20000822
+
+ Logging: the SMTP server's SASL code logs the authentication
+ method along with an authentication failure. Suggested by
+ Ronald F. Guilmette @ monkeys.com.
+
+ Workaround: some systems have file size resource limits
+ that cannot be represented with the off_t type that is used
+ by standard functions such as lseek(2). Problem reported
+ by Blaz Zupan @ amis.net.
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-20000821"
+#define DEF_MAIL_VERSION "Snapshot-20000822"
extern char *var_mail_version;
/* LICENSE
initial_response = (argc == 3 ? argv[2].strval : 0);
err = smtpd_sasl_authenticate(state, auth_mechanism, initial_response);
if (err != 0) {
- msg_warn("%s[%s]: SASL authentication failed",
- state->name, state->addr);
+ msg_warn("%s[%s]: SASL %s authentication failed",
+ state->name, state->addr, auth_mechanism);
smtpd_chat_reply(state, "%s", err);
return (-1);
}
#include <sys/resource.h>
#include <signal.h>
#endif
+#include <limits.h>
/* Utility library. */
off_t get_file_limit(void)
{
-#ifdef USE_ULIMIT
off_t limit;
+#ifdef USE_ULIMIT
if ((limit = ulimit(UL_GETFSIZE, 0)) < 0)
msg_fatal("ulimit: %m");
+ if (limit > INT_MAX / ULIMIT_BLOCK_SIZE)
+ limit = INT_MAX / ULIMIT_BLOCK_SIZE;
return (limit * ULIMIT_BLOCK_SIZE);
#else
struct rlimit rlim;
if (getrlimit(RLIMIT_FSIZE, &rlim) < 0)
msg_fatal("getrlimit: %m");
- return (rlim.rlim_cur);
+ limit = rlim.rlim_cur;
+ return (limit < 0 ? INT_MAX : rlim.rlim_cur);
#endif /* USE_ULIMIT */
}