[Avcheck] Can avcheck report the IP address of the client?
Michael Tokarev
mjt@tls.msk.ru
Thu, 02 May 2002 17:07:49 +0400
Michael Tokarev wrote:
>
> [Note the Cc set to postfix-users]
May we remove automatic [Avcheck] prefix from subject line?
[]
> [Return-Path or some other header(s) may be here]
> Received: from mail.corpit.ru (mail.corpit.ru [217.23.134.198])
> by mail.tls.msk.ru (Postfix) with ESMTP id 86E878C2D
> for <mjt@paltus.tls.msk.ru>; Thu, 2 May 2002 12:05:26 +0400 (MSD)
> (envelope-from avcheck-admin@list.corpit.ru)
>
> Double bounce:
>
> Received: by mail.corpit.ru (Postfix)
> id 2B6AA380E; Thu, 2 May 2002 16:40:42 +0400 (MSD)
>
> Locally-submitted mail (/usr/sbin/sendmail interface, Received
> by pickup):
>
> Received: by mail.tls.msk.ru (Postfix, from userid 101)
> id DB2DB8C2D; Thu, 2 May 2002 16:45:09 +0400 (MSD)
>
> The following comand may work:
But it *may* (untested!) work with Postfix only. Other MTAs
uses different format of Received line.
> FROM=`sed -n \
> -e 's/^Received: from.* \[\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)\])$/ from IP \1/p' \
> -e 's/^Received: by.* (Postfix)$/ from internal/p' \
> -e 's/^Received: by.* (Postfix,\( from userid [0-9]*\))$/\1/p' \
> -e '/^Received: /q' \
> $MAIL`
Regards,
Michael.