I need ezmlm subscribe (sub-ok) and unsubscribe (unsub-ok) emails to have
dynamic subject depending on mailing list.
Details of the implementation below. I am inviting critisisms :) so I can
improve on it. What do you think?
Thanks
Luke
1) I added a function "getSubjectFrom1stLine()" to ezmlm-manage.c which
basically reads the above mentioned file and extract to first line, upto 50
chars.
==========================================
char *getSubjectFrom1stLine( char *dir, char *fname ) {
static char subj[61] = "Subject: GoodOrient.com";
char fn[255];
FILE *fp;
strcpy( fn, dir );
strcat( fn, "/" );
strcat( fn, fname );
if( fd = fopen( fn, "r" ) )
if( fgets( fn, 50, fd ) )
strcpy( ( subj+9), fn ); // to overwrite text after "Subject: "
fclose( fd );
return subj;
}
==========================================
2) Next, I replace line "qmail_puts( &qq, TXT )" in geton() and getoff()
with...
"qmail_puts( &qq, getSubjectFrom1stLine( workdir, "text/sub-ok" ) );" for
geton()
"qmail_puts( &qq, getSubjectFrom1stLine( workdir, "text/ubsub-ok" ) );" for
getoff()