Hi,
I extract (in different file) several informations from Postfix logs.
more /var/log/maillog | grep NOQUEUE > /tmp/estract.txt
this extract looks like this:
PHP Code:
Jun 21 00:37:16 PUMA postfix/smtpd[29244]: NOQUEUE: reject: RCPT from unknown[200.141.33.198]: 504 5.5.2 <62.123.142.124>: Helo command rejected: need fully-qualified hostname; from=<bey@brainpod.com> to=<52366@0email.it> proto=SMTP helo=<62.123.142.124>
Jun 21 00:39:51 PUMA postfix/smtpd[29303]: NOQUEUE: reject: RCPT from unknown[92.47.96.48]: 504 5.5.2 <62.123.142.124>: Helo command rejected: need fully-qualified hostname; from=<impeller@lissamail.com> to=<52366@0email.it> proto=SMTP helo=<62.123.142.124>
Jun 21 00:50:26 PUMA postfix/smtpd[29449]: NOQUEUE: reject: RCPT from unknown[190.244.138.229]: 450 4.1.2 <52366@0email.it>: Recipient address rejected: Domain not found; from=<Sascha.Taddeusz@evisibility.com> to=<52366@0email.it> proto=ESMTP helo=<229-138-244-190.fibertel.com.ar>
Jun 21 00:51:27 PUMA postfix/smtpd[29449]: NOQUEUE: reject: RCPT from unknown[190.244.138.229]: 450 4.1.2 <52366@0email.it>: Recipient address rejected: Domain not found; from=<Sascha.Taddeusz@evisibility.com> to=<52366@0email.it> proto=ESMTP helo=<229-138-244-190.fibertel.com.ar>
I would like to extract the IPs. For example from:
PHP Code:
Jun 21 00:51:27 PUMA postfix/smtpd[29449]: NOQUEUE: reject: RCPT from unknown[190.244.138.229]: 450 4.1.2 <52366@0email.it>: Recipient address rejected: Domain not found; from=<Sascha.Taddeusz@evisibility.com> to=<52366@0email.it> proto=ESMTP helo=<229-138-244-190.fibertel.com.ar>
I want 190.244.138.229 for furthere handling.
Started to handle it with a PHP script but this is not solved and is becoming a time-consuming job. Though that maybe there is something ready-to-use or a good advice could help.