3/23 What's the easiest way to find all files on a unix box that contain
both the words 'imap' and 'pop' on different lines. I'm trying to
find a courier authd config file that I swear had lines for turning
on and off different protocols (pop3 and imapd) but I can't find it
anywhere. and I can't find any references to it. -brett
\_ hrm.
egrep -ri '(imap|pop)' / | grep -iv 'imap.*pop' | grep -iv 'pop.*imap'
--scotsman
\_ your grep only matches if they are on the same line.
for speed, i recomend using file to *not* check binaries.
\_ Picky picky. use egrep -I, then. and no, it doesn't match
"only if they are on the same line". man egrep. And no, it
doesn't guarantee that both are in the file, but i've set you
on the road to recovery. For the task at hand, this should
be sufficient.. --scotsman
\_ find / -type f -print0 | xargs -0 fgrep -iIl imap \
| perl -pe 's/\n/\0/' | xargs -0 fgrep -iH pop | fgrep -iv imap \
| cut -d: -f1 | sort -u --dbushong
(this doesn't work for files w/ : in the name; i'll think about
it.)
\_ I think I must by smoking crack, be cause the file that I'm
searching for doesn't appear to exist. I thought there was a
\_ I think I must by smoking crack, cause the file that I'm searching
for doesn't appear to exist. I thought it was a courier authd
file, but maybe I'm confusing it with something I only half remember.
\_ this is a terrible approach. strace/truss the daemon and see what
files it tries to read. -tom
\_ Unfirtunateley courier has a bunch of different daemons and
I don't know which one reads the said file.
courier config that controlled what serviced either
authdaemon or couriertcp would allow connections from. Maybe
I'm confusing it with something I only half remember. -brett
I'm confusing it with something other file that I only half
remember. Is anybody here familiar with the courier-ssl
pop/imap auth daemon? -brett
\_ Nevermind, I'm totally on crack. The file doesn't exist,
Thanks for helping me determine that. I got it to work,
I had the wrong userdb name: "poppw" instead of "pop3pw".
\_ This is a terrible approach; strace/truss the daemon and see what
files it accesses. -tom |