0

My mailserver was set so that all the mails to info@domain were going to the root Maildir. Now, I'm wondering how could I "filter" these mails out so that I can see which mails were tried to be sent to info@domain.

I am using postfix + dovecot and my email for root is stored in /root/Maildir.

adaptr
  • 16,576
  • 23
  • 34
Nikola
  • 847
  • 4
  • 13
  • 22

1 Answers1

0

You can grep info@domain.com /var/log/mail.log (or wherever postfix logs in your installation) and then refine the output and see how many messages were actually addressed to info@domain.

adamo
  • 6,925
  • 3
  • 30
  • 58
  • yes, and I get them with this command. But now, I would like to read them. So, since I know for a fact they are located in /root/Maildir/cur folder and I can read these mails by using cat, I'm wondering how to skim through those mails and find the ones that I need? Ultimatelly how could I delete ones that are not sent to info? Thx! – Nikola Apr 24 '12 at 12:45
  • You need a mail reader capable of reading from maildir files like [mutt](http://www.mutt.org). Depending the MUA there is always a way to filter messages based on the recipient's address. Since you run dovecot, any IMAP client (like Thunderbird for example) can do that. – adamo Apr 24 '12 at 15:11
  • unfortunately this is not an option as this file has grown big (>1GB!) and that's why I'm trying to come up with the script which will skim through all the files, test if the info@domain is in it and if not - delete that file, where as a result I would be left with only files that have mails to info@domain – Nikola Apr 24 '12 at 15:33
  • You can use alpine with dovecot. 1GB should not be a problem – adamo Apr 24 '12 at 19:54
  • i've been googlin about alpine with dovecot but to no luck, can you suggest something? – Nikola Apr 24 '12 at 21:07
  • Dovecot is an IMAP server. All you need to do is to connect alpine to the IMAP server (in your case the machine that runs dovecot). – adamo Apr 24 '12 at 21:27