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.

I'm looking to delete all mail addressed from "root@", where the address could originate from any domain. Am I right in thinking the line below would achieve this? [using sendmail]

:0 * ^From.root*

/dev/null

Or if I wanted to move to a folder, will this work and automatically create the folder (imap syncable)

:0 * ^From.root*

ExampleFolder

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Will delete the mail :

:0
* ^From:.*root@.*
/dev/null

Will create the folder and move the mail to it (you still need to subscribe to the folder over IMAP)

:0
* ^From:.*root@.*
ExampleFolder
share|improve this answer
    
The trailing .* is superfluous, albeit mostly harmless. Do you really intend to allow exactly one arbitrary character between From: and root@? –  tripleee May 14 '13 at 19:10
add comment

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.