-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aleksander Kamenik Sent: Monday, June 18, 2007 1:31 PM To: DBMail mailinglist Subject: Re: [Dbmail] Spamfilter for postfix lmtp.
Jon Duggan wrote: > Out of interest, is dspam delivering directly to dbmail-lmtpd via lmtp > or as you passing back to an MTA to deliver to dbmail-lmtpd? Directly. > I only ask because when we were running 2.0.x version we had terrible > problems getting dspam to deliver straight into dbmail-lmtpd, it was > chopping off the last two bytes of each line IIRC (been quite a few > months since i played with this), IIRC dbmail-lmtpd was expecting \r\n > or so, which dspam wasn't sending. Yes, that was a problem with 2.0.x dbmail, this is not an issue with 2.2.x series. But dspam still had a bug in 3.6.8 where it would loose the \r\n and only output \n in the body part. This created the situation, where any line beginning with a dot would be mangled so that you get two dots. For example if you send a message like: --- hello ./some/path bye --- You would receive: --- hello ../some/path bye --- It's correct behaviour on dbmail's part, but dspam is doing the wrong thing here anyway. The worst part of this was that PDF files got mangled be cause Outlook is stupid and determines that a file is a binary or text by only several first bytes of the file. And PDF's start with chars. So Outlook sends PDFs as Quoted Printable. Anyway, we discovered that after the setup went into production, fortunately there was a patch available from the community. Here's the thread about it with the patch (the patch is a workaround, not a true fix which should change the way the message is handled internally by dspam): http://archive.netbsd.se/?ml=dspam-dev&a=2006-11&m=2536805 And there's a second bug, which depending on your setup might affect you, the thread is here: http://mailing-list.nuclearelephant.com/index.html#3722 I'll attach both patches, they apply to 3.6.8. Now I haven't tried dspam 3.8.0, but I didn't see these issues mentioned in the changelog either. So maybe it's all OK now, although there are still some issues with dspam as one can see from the posts on the mailinglists. Sorry for the offtopic. HTH, -- Aleksander Kamenik system administrator +372 6659 649 [EMAIL PROTECTED] Krediidiinfo AS http://www.krediidiinfo.ee/
848a849,853 > > /* strip trailing @domain, if present: */ > arg=index(args, '@'); > if (arg) *arg = '\0'; > 852a858,862 > > /* append trailing @domain again, if it was present: */ > arg=index(ATX->recipient, '@'); > if (arg) strlcat (args, arg, sizeof(args)); >
diff -ur dspam-3.6.8/src/client.c dspam-3.6.8-eol/src/client.c --- dspam-3.6.8/src/client.c 2006-05-30 10:03:51.000000000 -0500 +++ dspam-3.6.8-eol/src/client.c 2006-11-08 12:11:44.000000000 -0600 @@ -678,6 +678,7 @@ char *ident = _ds_read_attribute(agent_config, "DeliveryIdent"); int exitcode = EFAILURE; int msglen, code; + int buflen; char *inp; int i; @@ -791,13 +792,34 @@ i = 0; msglen = strlen(msg); while(i<msglen) { - int r = send(TTX.sockfd, msg+i, msglen - i, 0); - if (r <= 0) { - LOG(LOG_ERR, ERR_CLIENT_SEND_FAILED); - STATUS(ERR_CLIENT_SEND_FAILED); - goto BAIL; + int r; + int t; + + /* fill buf with partial msg, replacing \n with \r\n */ + buflen = 0; + while (buflen < (sizeof(buf) - 1) && i < msglen) { + /* only replace \n and not \r\n */ + if (i > 0 && msg[i] == '\n' && msg[i - 1] != '\r') { + buf[buflen] = '\r'; + buflen++; + } + + buf[buflen] = msg[i]; + buflen++; + i++; + } + + /* send buf */ + t = 0; + while (t < buflen) { + r = send(TTX.sockfd, buf+t, buflen - t, 0); + if (r <= 0) { + LOG(LOG_ERR, ERR_CLIENT_SEND_FAILED); + STATUS(ERR_CLIENT_SEND_FAILED); + goto BAIL; + } + t += r; } - i += r; } if (msg[strlen(msg)-1]!= '\n') {