I belive the header can better be handled with standard filters since it is already implimented there anyway. Plus, that is asking the server to fire a separate thread to handle the filter, while still receiving DATA (which in most cases will finish long before any script fully loads and has a chance to react, and it is inaapropriate for the receiving MTA to end the DATA stream), then just send an error at the end of the DATA, saved nothing except a rejection to the other MTA. I do like the AFTER_MAIL_FROM and AFTER_RCPT_TO though, an AFTER_EHLO would be great too for EHLO/HELO checks. Something to turn all checks off for proper SMTP_Auth responses, would also be nice, or even simpler, a variable to pass to filters @@SMTP_AUTH, with auth info (user is authed, null if not, or something like that) so filters can be bypassed selectively.
Just my thoughts, Chuck Frolick ArgoLink.net -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Harald Schneider Sent: Tuesday, February 03, 2004 7:55 AM To: [EMAIL PROTECTED] Subject: [xmail] AW: Re: AW: Re: AW: Re: SMTP Dialog Filter Hooks DATA terminates the envelope. AFTER_HEADER should be fired after the blank line, which terminates the header: MAIL FROM: ... --> AFTER_MAIL_FROM RCPT TO: ... --> AFTER_RCPT_TO DATA From: ... To: ... Subject: ... --> AFTER_HEADER [blank line] Mail body ... [dot] Each event hook should submit its preceeding data to the script: AFTER_MAIL_FROM submits the MAIL FROM line AFTER_RCPT_TO submits the RCPT TO line. AFTER_HEADER submits all lines between DATA and [blank line] There is one special thing:=20 Since there can be multiple RCPT TO lines, the event should fire with the last RCPT TO, submitting all lines before. --Harald > -----Urspr=FCngliche Nachricht----- > Von: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Im Auftrag von Rob Arends > Gesendet: Dienstag, 3. Februar 2004 14:28 > An: [EMAIL PROTECTED] > Betreff: [xmail] Re: AW: Re: AW: Re: SMTP Dialog Filter Hooks =20 >=20 > Harald, > How would you propose that AFTER_HEADER be pre-emted.=20 > I can follow how the other hooks would work, but the after=20 > header one would have to be called when DATA command is=20 > issued. Otherwise how would you know when ALL the header=20 > commands were sent. You would not be able to=20 > terminate/reject/et before DATA, only an abrupt termination=20 > of the session. Comments??? >=20 > Rob :) >=20 > > -----Original Message----- > > From: [EMAIL PROTECTED] > >[mailto:[EMAIL PROTECTED] On Behalf Of Harald Schneider > > Sent: Tuesday, February 03, 2004 6:41 PM > > To: [EMAIL PROTECTED] > > Subject: [xmail] AW: Re: AW: Re: SMTP Dialog Filter Hooks =20 > > AFTER_MAIL_FROM, AFTER_RCPT_TO, AFTER_HEADER (=3D3Dbefore data) > > would be =3D > > cool. > >=20 > > --Harald > >=20 > > > -----Urspr=3DFCngliche Nachricht----- > > > Von: [EMAIL PROTECTED] =20 > > >[mailto:[EMAIL PROTECTED] Im Auftrag von Rob Arends > > > Gesendet: Dienstag, 3. Februar 2004 01:41 > > > An: [EMAIL PROTECTED] > > > Betreff: [xmail] Re: AW: Re: SMTP Dialog Filter Hooks =3D20 > > >=3D20 > > > I agree, you should only implement these sort of hooks on the=3D20 = =20 > > >header. But would you call the filter at the end of the=3D20=20 > header,=20 > > >or after each line? =3D20 > > > Rob :-)=3D20 > > >=3D20 > > > > -----Original Message----- > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED] On Behalf Of Harald > > Schneider > > > > Sent: Monday, February 02, 2004 11:16 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: [xmail] AW: Re: SMTP Dialog Filter Hooks > > > >=3D20 > > > > OK .. this is true for checking the data part. Under the=3D20 > > > aspect of =3D3D=3D20 > > > > decoding mime mails, it isn't a trivial thing at all. =3D20 > > > > But Hooks for the envelope lines and the start of data > > would be=3D3D20 =3D > >=20 > > > > comparable easy to implement and very valuable for future > > script =3D3D =3D > >=20 > > > > extensions. > > > >=3D20 > > > > --Harald > > > >=3D20 > > > >=3D20 > > > > > -----Urspr=3D3DFCngliche Nachricht----- > > > > > Von: [EMAIL PROTECTED] =3D20=20 > > > > >[mailto:[EMAIL PROTECTED] Im Auftrag von T. > > Mike Howeth > > > > > Gesendet: Montag, 2. Februar 2004 07:39 > > > > > An: [EMAIL PROTECTED] > > > > > Betreff: [xmail] Re: SMTP Dialog Filter Hooks > > > > >=3D3D20 > > > > >=3D3D20 > > > > > I add this functionality to xmail myself and it does > > not=3D3D20 =3D20 > > > > >inordinately =3D3D3D impair performance if 1) other = changes=3D20 > > > are=3D3D20 made=3D20 > > > > >to xmail to improve its =3D3D3D intrinsic performance, 2)=3D20 > > > the=3D3D20 checks=3D20 > > > > >are aborted on messages that are long and 3) binary=3D3D20 = =3D20 > > > messages are=3D20 > > > > >correctly identified and not handled by the=3D3D20 = filter.=3D20 > > > However, it=3D20 > > > > >is not as simple as looking at each line=3D3D20 presented=3D20 > > > after the DATA=3D20 > > > > >command: to correctly interpret=3D3D20 input, the code=20 > must deal =3D > > with=3D20 > > > > >=3D3D3D message decoding on the fly=3D3D20 > > (quoted-printable, base64 =3D > > are=3D20 > > > > >trivial, but MIME must =3D3D3D be=3D3D20 dealt with too)=20 > and, at=3D20 > > > a minimum,=3D20 > > > > >support a scrolling-window=3D3D20 type of =3D3D3D buffer = (DATA=3D20 > > > lines do not=3D20 > > > > >correspond to actual=3D3D20 message lines). Although I = am=3D20 > > > =3D3D3D glad that=3D20 > > > > >I can reject=3D3D20 messages as they come in now, the = amount=3D20 > > > of work =3D3D3D=3D20 > > > > >involved=3D3D20 was substantial and unless Davide is a=20 > complete=3D20=20 > > > > >masochist,=3D3D20 there are probably features that would = be=3D20 > > > better uses=3D20 > > > > >of=3D3D20 development time. (And, naturally, about a > > month after I=3D20 > > > > >got=3D3D20 it basically-where-i-wanted-it, I =3D3D3D=20 > moved and no =3D > > longer=3D20 > > > > >have=3D3D20 adequate connectivity to host my own MTA box. = Ha.)=20 > > > > >=3D3D20 (and BTW, if you stop accepting a message during=20 > > > > >receipt,=3D3D20 you're telling =3D3D3D the other end exactly = what=20 > > > > >they > > did that=3D3D20 > > > > > tripped the wire. It's best to =3D3D3D accept the rest = -=3D3D20=20 > > > > > discarding it as you go - even after the decision is > > made to=3D3D20 > > > > > reject the message). > > > > >=3D3D20 > > > > >=3D3D20 > > > > > -----Original Message----- > > > > > From: [EMAIL PROTECTED] =20 > > > > >[mailto:[EMAIL PROTECTED] =3D3D3D On > Behalf > > Of Harald =3D > > =3D3D > > > > Schneider > > > > > Sent: Sunday, 1 February 2004 8:07 AM > > > > > To: [EMAIL PROTECTED] > > > > > Subject: [xmail] SMTP Dialog Filter Hooks > > > > >=3D3D20 > > > > >=3D3D20 > > > > > Hi Davide, > > > > >=3D3D20 > > > > > is there a chance to see SMTP dialog filter hooks in > > the next=3D3D20 =3D > > =3D20 > > > > >release? =3D3D3D This would make the filtering engine more=3D20 > > > flexible: =3D3D20 > > > > > You could check the RCPT_TO and act before the=20 > message is=3D3D20=20 > > > > > accepted. E.g. checking a forwarding target server,=20 > if the=3D3D20=20 > > > > > user exists there, before accepting and forwarding=20 > the whole =3D3D > > > > mail.=3D3D3D20 > > > > >=3D3D20 > > > > > Hooks after each SMTP command and after each data line=3D20 > > > would=3D3D20 be=3D20 > > > > >a nice=3D3D3D20 thing, e.g.: =3D3D20 > > > > > HOOK_HELO > > > > > HOOK_MAIL_FROM > > > > > HOOK_RCPT_TO > > > > > HOOK_DATALINE > > > > >=3D3D20 > > > > > So a script could also do anti spam and anti virus=20 > checking=3D3D20 =20 > > > > >on the fly,=3D3D3D20 aborting conversation without accepting = =3D > > the=3D3D20 > > > > > whole message.=3D3D3D20 > > > > >=3D3D20 > > > > > What do you think? > > > > >=3D3D20 > > > > > All the best, > > > > > Harald > > > > >=3D3D20 > > > > >=3D3D20 > > > > >=3D3D20 > > > > >=3D3D20 > > > > > - > > > > > To unsubscribe from this list: send the line=20 > "unsubscribe=3D3D20 =20 > > > > >xmail" in the =3D3D3D body of a message to =3D > > [EMAIL PROTECTED] > > > > > For general help: send the line "help" in the body of a=3D3D20 = =20 > > > > >message to [EMAIL PROTECTED] =3D3D20 > > > > >=3D3D20 > > > > >=3D3D20 > > > > >=3D3D20 > > > > > - > > > > > To unsubscribe from this list: send the line = "unsubscribe=3D3D20 > > > > > xmail" in the body of a message to=20 > [EMAIL PROTECTED] > > > > > For general help: send the line "help" in the body of a=3D3D20 > > > > > message to [EMAIL PROTECTED] > > > > >=3D3D20 > > > >=3D20 > > > > - > > > > To unsubscribe from this list: send the line "unsubscribe > > xmail" in=3D20 > > > > the body of a message to [EMAIL PROTECTED] For > > general help:=3D20 > > > > send the line "help" in the body of a message to=3D20 =20 > > > >[EMAIL PROTECTED] =3D20 > > >=3D20 > > > - > > > To unsubscribe from this list: send the line=20 > "unsubscribe=3D20 xmail"=20 > > >in the body of a message to [EMAIL PROTECTED] =20 > For general=20 > > >help: send the line "help" in the body of a=3D20 message to=20 > > >[EMAIL PROTECTED] =3D20 > >=20 > > - > > To unsubscribe from this list: send the line "unsubscribe xmail" in=20 > > the body of a message to [EMAIL PROTECTED] For general help:=20 > > send the line "help" in the body of a message to=20 > > [EMAIL PROTECTED] > >=20 >=20 > - > To unsubscribe from this list: send the line "unsubscribe=20 > xmail" in the body of a message to [EMAIL PROTECTED] > For general help: send the line "help" in the body of a=20 > message to [EMAIL PROTECTED] >=20 - To unsubscribe from this list: send the line "unsubscribe xmail" in the body of a message to [EMAIL PROTECTED] For general help: send the line "help" in the body of a message to [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe xmail" in the body of a message to [EMAIL PROTECTED] For general help: send the line "help" in the body of a message to [EMAIL PROTECTED]
