| Linode Forum https://forum.linode.com/ |
|
| Print all the email address where postfix send emails. https://forum.linode.com/viewtopic.php?f=11&t=10518 |
Page 1 of 1 |
| Author: | sblantipodi [ Tue Oct 15, 2013 11:52 am ] |
| Post subject: | Print all the email address where postfix send emails. |
Hi, I have a script that checks my maillog and prints useful information. Code: #!/bin/bash I want to add to this wonderful script a section that prints all the email address of the emails sent by postfix. Can you help in writing this section? |
|
| Author: | sblantipodi [ Tue Oct 15, 2013 12:06 pm ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
It seems that I founded a good way to do it. grep -o 'to=<[^@]*@.[^>]*' /var/log/maillog |
|
| Author: | sblantipodi [ Tue Oct 15, 2013 12:30 pm ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
not an excellent solution since it prints also my mail dir, this is better: grep -o 'to=<[^@]*@.[^>]*' maillog-20131003 | grep -v "myemailadddress@domain.org" this one removes the email I received. |
|
| Author: | obs [ Tue Oct 15, 2013 1:24 pm ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
Use Code: pflogsumm /var/log/mail.logno need to reinvent the wheel. |
|
| Author: | sblantipodi [ Tue Oct 15, 2013 2:21 pm ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
obs wrote: Use Code: pflogsumm /var/log/mail.logno need to reinvent the wheel. thanks obs, great tool. is there a way to remove the sections "by message size" in the pflogsumm output? |
|
| Author: | Stever [ Tue Oct 15, 2013 5:16 pm ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
"-u 0" will remove both the "by message size" and "by message count" sections, but I'm not sure you can control them separately. |
|
| Author: | sblantipodi [ Wed Oct 16, 2013 6:10 am ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
Stever wrote: "-u 0" will remove both the "by message size" and "by message count" sections, but I'm not sure you can control them separately. I don't want to remove both sections but I don't want unuseful duplicated section. "by count" is enough for me, no need for an additional "by size" section. need to find a solution if I want to use pflogsumm... mmmm... |
|
| Author: | sblantipodi [ Wed Oct 16, 2013 7:56 am ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
Sincerely I don't understand the output of the pflogsumm. Quote: Grand Totals ------------ messages 14 received 18 delivered 0 forwarded 0 deferred 0 bounced 3 rejected (14%) 0 reject warnings 0 held 0 discarded (0%) I have sent only 4 email after the maillog has been rotated, there is only four "sent" lines in the maillog. Why pflogsumm says that 18 delivered ???? It seems that the delivered value contains both the sent and received, why? The senders sections contains the hosts of the people who sent me emails from external domain. Strange. Any idea? |
|
| Author: | sblantipodi [ Wed Oct 16, 2013 9:43 am ] |
| Post subject: | Re: Print all the email address where postfix send emails. |
pflogsumm is unsable in a normal email environment. its results are broken if using an antivirus/antispam/dovecot lmtp. personally I don't use any antivirus/antispam except from some RBL but I use dovecot lmtp for sieve. The pflogsumm results in this case is wrong. Why it is wrong? When I receive an email the email is filetered by lmtp and than sent to my mailbox, this makes pflogsumm counts 2 email, one received and one sent. quite an unuseful command, I return to my script I think that this is the reason why I need to reivent the wheel |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|