masqmail-0.2

diff src/smtp_in.c @ 128:f9d5469cb648

moved the SIZE check to a better location
author meillo@marmaro.de
date Tue, 06 Jul 2010 08:18:46 +0200
parents 05fe7500149d
children b072426cc6bb
line diff
     1.1 --- a/src/smtp_in.c	Tue Jul 06 08:18:10 2010 +0200
     1.2 +++ b/src/smtp_in.c	Tue Jul 06 08:18:46 2010 +0200
     1.3 @@ -198,15 +198,6 @@
     1.4  			break;
     1.5  
     1.6  		case SMTP_MAIL_FROM:
     1.7 -			if (get_size(buffer, &msize)) {
     1.8 -				DEBUG(5) debugf("smtp_in(): get_size: msize=%ld, conf.mms=%d\n",
     1.9 -				                msize, conf.max_msg_size);
    1.10 -				if (conf.max_msg_size && (msize > conf.max_msg_size)) {
    1.11 -					smtp_printf(out, "552 Message size exceeds fixed limit.\r\n");
    1.12 -					break;
    1.13 -				}
    1.14 -			}
    1.15 -
    1.16  			{
    1.17  				gchar buf[MAX_ADDRESS];
    1.18  				address *addr;
    1.19 @@ -220,6 +211,15 @@
    1.20  					break;
    1.21  				}
    1.22  
    1.23 +				if (get_size(buffer, &msize)) {
    1.24 +					DEBUG(5) debugf("smtp_in(): get_size: msize=%ld, conf.mms=%d\n",
    1.25 +							msize, conf.max_msg_size);
    1.26 +					if (conf.max_msg_size && (msize > conf.max_msg_size)) {
    1.27 +						smtp_printf(out, "552 Message size exceeds fixed limit.\r\n");
    1.28 +						break;
    1.29 +					}
    1.30 +				}
    1.31 +
    1.32  				msg = create_message();
    1.33  				msg->received_host = remote_host ? g_strdup(remote_host) : NULL;
    1.34  				msg->received_prot = psc->prot;