Хочу выдернуть адреса из лога Postfix:
Код: Выделить всё
Aug 14 11:02:36 core postfix/pipe[80953]: BCF69F7408: to=<info@domen.com.ua>, relay=dovecot, delay=0.07, delays=0.06/0/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Aug 14 11:02:36 core postfix/pipe[80953]: BCF69F7408: to=<reklama@domen.com.ua>, relay=dovecot, delay=0.07, delays=0.06/0/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Aug 14 11:03:01 core postfix/pipe[80897]: 5066CF741C: to=<office@domen.com.ua>, relay=dovecot, delay=0.03, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered via dovecot service)
Код: Выделить всё
#!/bin/sh
tail -f /var/log/maillog | grep --line-buffered 'status=sent' |
while read line
do
i=$(echo $line | awk -FS '{print $1}')
echo $i
done