Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
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. 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.