X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserv_smtp.c;h=99504c5842276e3a5866bad4ad115bf4b0d33627;hb=ed49e08b4184495f51ed74013bfff126d4cbec1a;hp=b9457afe171e61c83f769afd60186c4f0b996e85;hpb=8447484ef37a8c604c25564029d714daf7af59b4;p=citadel.git diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index b9457afe1..99504c584 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -44,6 +44,7 @@ struct citsmtp { /* Information about the current session */ char from[256]; int number_of_recipients; int delivery_mode; + int message_originated_locally; }; enum { /* Command states for login authentication */ @@ -325,6 +326,9 @@ void smtp_mail(char *argbuf) { strcpy(SMTP->from, ""); return; } + else { + SMTP->message_originated_locally = 1; + } } /* Otherwise, make sure outsiders aren't trying to forge mail from @@ -341,7 +345,7 @@ void smtp_mail(char *argbuf) { } } - cprintf("250 Sender ok. Groovy.\r\n"); + cprintf("250 Sender ok\r\n"); } @@ -354,10 +358,9 @@ void smtp_rcpt(char *argbuf) { char user[256]; char node[256]; char recp[256]; - int is_spam = 0; /* FIXME implement anti-spamming */ if (strlen(SMTP->from) == 0) { - cprintf("503 MAIL first, then RCPT. Duh.\r\n"); + cprintf("503 Need MAIL before RCPT\r\n"); return; } @@ -412,8 +415,8 @@ void smtp_rcpt(char *argbuf) { return; case rfc822_address_nonlocal: - if (is_spam) { - cprintf("551 Away with thee, spammer!\r\n"); + if (SMTP->message_originated_locally == 0) { + cprintf("551 Relaying denied\r\n"); } else { cprintf("250 Remote recipient %s ok\r\n", recp);