#include <ctype.h>
#include <string.h>
#include <limits.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include "citadel.h"
#include "server.h"
#include "sysdep_decls.h"
#include "genstamp.h"
#include "domain.h"
#include "clientsocket.h"
+#include "locate_host.h"
#ifndef HAVE_SNPRINTF
*/
void smtp_rcpt(char *argbuf) {
char recp[SIZ];
- struct recptypes *valid;
+ char message_to_spammer[SIZ];
+ struct recptypes *valid = NULL;
if (strlen(SMTP->from) == 0) {
cprintf("503 Need MAIL before RCPT\r\n");
return;
}
+ /* RBL check */
+ if ( (!CC->logged_in) && (!CC->is_local_socket) ) {
+ if (rbl_check(message_to_spammer)) {
+ cprintf("552 %s\r\n", message_to_spammer);
+ /* no need to phree(valid), it's not allocated yet */
+ return;
+ }
+ }
+
valid = validate_recipients(recp);
if (valid->num_error > 0) {
cprintf("599 Error: %s\r\n", valid->errormsg);