Re: attachment stripped

Eric Broch <[email protected]> Fri, 2 Jul 2021 06:13:49 -0600
Newsgroups gmane.mail.spam.dspam.user
Message-ID <[email protected]>
Yes, Dspam works well...still. It clobbers all my spam. It catches 3 to =

4 times the spam that spamassassin catches...not sure why it's not more =

popular.

Anyway, I had to change my stuff dot patch because of I may have been =

misusing=A0 buffer_cat and buffer_ncat. Below is the updated patch:

--- ./src/dspam.c=A0=A0=A0=A0=A0=A0 2021-05-20 15:07:38.717943662 -0600
+++ ./src/dspam.new.c=A0=A0 2021-05-20 15:00:16.854513189 -0600
@@ -103,6 +103,54 @@
 =A0#define USE_SMTP=A0=A0=A0=A0=A0=A0=A0 (_ds_read_attribute(agent_config, =

"DeliveryProto") && !strcmp(_ds_read_attribute(agent_config, =

"DeliveryProto"), "SMTP"))
 =A0#define LOOKUP(A, B)=A0=A0 ((_ds_pref_val(A, "localStore")[0]) ? =

_ds_pref_val(A, "localStore") : B)

+const char * stuff_dot(const char * message);
+/*
+** const char * stuff_dot(char * message);
+**
+** DESCRIPTION
+**=A0=A0 Stuff '.' where necessary for SMTP Protocol
+**
+** INPUT ARGUMENTS
+**=A0=A0=A0=A0 const char * message
+**
+** RETURN VALUES
+**=A0=A0 Returns const char * msg
+**
+** Author
+**=A0=A0 Eric C. Broch
+**
+*/
+const char * stuff_dot(const char * message) {
+
+=A0 char * msg;
+=A0 int lmessage =3D strlen(message);
+=A0 if (!lmessage) {
+=A0=A0=A0=A0 LOGDEBUG("stuff_dot: Message 0 length");
+=A0=A0=A0=A0 return NULL;
+=A0 }
+=A0 msg =3D (char *) malloc(lmessage);
+=A0 if ( msg =3D=3D NULL ) {
+=A0=A0=A0=A0 LOGDEBUG("stuff_dot: Unable to allocate memory, size: %d",lme=
ssage);
+=A0=A0=A0=A0 return NULL;
+=A0 }
+=A0 int i =3D 0, j =3D 0,k =3D 0;
+=A0 while(i<lmessage) {
+=A0=A0=A0 msg[j] =3D message[i];
+=A0=A0=A0 if ((message[i] =3D=3D '\n') && (message[i + 1] && message[i + 1=
] =3D=3D =

'.')) {
+=A0=A0=A0=A0=A0 k++;
+=A0=A0=A0=A0=A0 msg =3D (char *) realloc(msg,lmessage+k);
+=A0=A0=A0=A0=A0 if ( msg =3D=3D NULL ) {
+=A0=A0=A0=A0=A0=A0=A0=A0 free(msg);
+=A0=A0=A0=A0=A0=A0=A0=A0 LOGDEBUG("stuff_dot: Unable to reallocate memory,=
 size: %d", =

lmessage+k);
+=A0=A0=A0=A0=A0=A0=A0=A0 return NULL;
+=A0=A0=A0=A0=A0 }
+=A0=A0=A0=A0=A0 msg[++j] =3D '.';
+=A0=A0=A0 }
+=A0=A0=A0 i++;
+=A0=A0=A0 j++;
+=A0 }
+=A0 k++;msg =3D (char *) realloc(msg,lmessage+k); if ( msg =3D=3D NULL ) { =

free(msg);LOGDEBUG("stuff_dot: Unable to NULL msg, size: %d", =

lmessage+k);return NULL;} msg[lmessage+k-1]=3D0;return msg;
+}

 =A0int
 =A0main (int argc, char *argv[])
@@ -977,7 +1025,18 @@
 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (result =
=3D=3D DSR_ISSPAM) ? "SPAM" : "INNOCENT");

 =A0=A0 if (mailer_args =3D=3D NULL) {
-=A0=A0=A0 fputs (message, stream);
+=A0=A0=A0 /* calling program: dspamc */
+=A0=A0=A0 if (stream =3D=3D ATX->sockfd) {
+=A0=A0=A0=A0=A0 /* stuff dots before sending back to dspam client */
+=A0=A0=A0=A0=A0 /* otherwise trunction of email can occur, Eric Broch 04-1=
2-2021 */
+=A0=A0=A0=A0=A0 char * msg =3D stuff_dot(message);
+=A0=A0=A0=A0=A0 fputs(msg,stream);
+=A0=A0=A0=A0=A0 free(msg);
+=A0=A0=A0 }
+=A0=A0=A0 /* calling program: dspam */
+=A0=A0=A0 else {
+=A0=A0=A0=A0=A0 fputs(message,stream);
+=A0=A0=A0 }
 =A0=A0=A0=A0 return 0;
 =A0=A0 }

--- ./src/client.c=A0=A0=A0=A0=A0 2012-04-11 12:48:33.000000000 -0600
+++ ./src/client.new.c=A0 2021-05-19 16:51:42.793261161 -0600
@@ -228,6 +228,14 @@
 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 exitcode =3D 99;
 =A0=A0=A0=A0=A0=A0=A0=A0 }
 =A0=A0=A0=A0=A0=A0 } else {
+=A0=A0=A0=A0=A0=A0=A0 /* de-stuff dots from server, 04-12-2021, Eric C. Br=
och, 7 lines */
+=A0=A0=A0=A0=A0=A0=A0 if((line[0] && line[0]=3D=3D'.') && (line[1] && line=
[1]=3D=3D'.')) {
+=A0=A0=A0=A0=A0=A0=A0=A0=A0 size_t i, len =3D strlen(line);
+=A0=A0=A0=A0=A0=A0=A0=A0=A0 for(i=3D0;i<len;i++){
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 line[i]=3Dline[i+1];
+=A0=A0=A0=A0=A0=A0=A0=A0=A0 }
+=A0=A0=A0=A0=A0=A0=A0=A0=A0 line[len-1]=3D0;
+=A0=A0=A0=A0=A0=A0=A0 }
 =A0=A0=A0=A0=A0=A0=A0=A0 printf("%s\n", line);
 =A0=A0=A0=A0=A0=A0 }
 =A0=A0=A0=A0=A0=A0 free(line);


On 7/2/2021 5:19 AM, Marco wrote:
> Il 12/04/2021 21:44, Eric Broch has written:
>> dspam-users,
>>
>> I'm not sure if anyone cares (anymore), but I still use dspam and it =

>> works great.
>>
>> I found one solution to the truncation of emails when dspamc (dspam =

>> --client)=A0 is called (patch below).
>
> Hello,
>
> =A0thank you. We can hope a day for a new Dspam life. Its working =

> principles are very valuable.
>
> Regards
> Marco
>
>
> _______________________________________________
> Dspam-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspam-user