On Fri, Apr 21, 2006 at 01:57:38PM +0800, Mark van Proctor wrote: > Excuse my ignorance (I'm new to this...), but what is the difference between > filter_helo and filter_relay? > > My assumption is that helo is used when a client directly logs in through > SMTP to send an email (generally a local user, so most likely going to be > OUTBOUND or INTERNAL emails) whereas relay is used when a remote mail server > connects to relay an email destined for a local email address (most likely > going to be an INBOUND email). > > In my assumption, only one of those filters would ever get called... Is this > correct?
No, that's not correct. These calls are modelled after the phases of the SMTP (or ESMTP) protocol. It might be useful to briefly read RFC 2821 (eg via ftp://ftp.rfc-editor.org/in-notes/rfc2821.txt ) Especially the examples in appendix D might be useful. In brief, all mail clients (whether internal or external) will: - connect to your mail server -> filter_relay is called, allowing you to refuse the connection based on remote IP address - identify themselves using HELO name or EHLO name -> filter_helo is called - transmit one or more emails by sending: - MAIL From:<sender> -> filter_sender is called - RCPT To:<recipient> -> filter_recipient is called There may be more than one recipient, in which case "RCPT To:" is sent again, and filter_recipient is called again. - DATA headers, including From:, To:, Subject:, Date:, Message-ID: etc . -> filter_begin, filter, filter_multipart and filter_end are called as appropriate. > If so, is $Helo still set in filter_begin / filter / filter_end if it was a > RELAYed email / is $RelayAddr still set in filter_begin / filter / > filter_end if it was a HELOed email? There is no difference, so both are always set. A mail server doesn't really care about inbound or outbound. What would you call a mail that a local user sends from the internal network to another local user? -- Jan-Pieter Cornet <[EMAIL PROTECTED]> !! Disc lamer: The addressee of this email is not the intended recipient. !! !! This is only a test of the echelon and data retention systems. Please !! !! archive this message indefinately to allow verification of the logs. !! _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

