On Mon, Mar 08, 2010 at 02:33:37PM +0100, postfix-us...@tja-server.de wrote: > /dev/rob0 wrote: > >>But as far as i can tell, this is already quite late in > >>processing the mails! > > > >Why do you think so? > > I seem to remember, that the recipient code technically is > called later - after all headers and maybe even data has been > read by the server. > > I would like to reject those mails as soon as possible and > thought, this requires a different place.
Headers *are* DATA, in SMTP terminology. Some headers are added by your Postfix, but most of them should have been received from the client. smtpd_mumble_restrictions happen at the SMTP command indicated by "mumble", with exceptions: smtpd_client_restrictions at the initial TCP connection smtpd_helo_restrictions at the EHLO/HELO command smtpd_etrn_restrictions at the (rarely used) ETRN command smtpd_sender_restrictions at the MAIL FROM: command smtpd_recipient_restrictions at the RCPT TO: command smtpd_data_restrictions at the DATA command smtpd_end_of_data_restrictions at the ".<cr><lf>" at end of DATA Exceptions: smtpd_delay_reject (default "yes") causes "mumble" == client, helo and sender restrictions to be evaluated at RCPT TO:. (There are reasons for this default setting, see http://www.postfix.org/postconf.5.html#smtpd_delay_reject for that, and search list archives if interested.) Only smtpd_end_of_data_restrictions would have access to headers, except as previously mentioned, those headers are irrelevant in normal routing and access control decisions. See these: http://www.postfix.org/BUILTIN_FILTER_README.html http://www.postfix.org/header_checks.5.html if you're interested in access decisions based on headers, but be forewarned, it's weak and usually not a good idea (most people who think header_checks(5) are the answer have been asking the wrong question.) Also note that these header_checks are implemented by the cleanup(8) daemon, not by smtpd(8). > Thanx for your hint! You're welcome. -- Offlist mail to this address is discarded unless "/dev/rob0" or "not-spam" is in Subject: header