On Mon, Dec 20, 1999 at 09:59:18PM -0700, Philip Gabbert wrote:
> 
> I was looking over the Qmail homepage and I found that you can create a
> rcpthosts file with the following shell command:
> 
>     sed 's/:.*//' <virtualdomains | cat - locals | sort >rcpthosts
> 
> by Russ Nelson. This is pretty kewl, incase you all didn't know, but one
> thing was wrong. 
> One: I'm ordered and sorted my virtualdomains file in a matter I like.
> Two: It picked up my address: [EMAIL PROTECTED] - Not needed in rcpthosts.
> 
> So, I did a little change to it:
> 
>    sed 's/^[^@]*@//' <virtualdomains | sed 's/:.*//' \
>         | cat - locals >rcpthosts
>   (line wrapped due to email max line length)
> 
> This will filter out everything in front of and including the @. The only
> bug I see in this one liner is that if you have multiple [EMAIL PROTECTED]
> addresses, it will place multiple myhost.com lines.
> It's a bug I won't mind hearing how to fix, but it won't affect how qmail
> runs.

Without having tested your line: replacing the second line with
' | cat - locals | sort -u > rcpthosts'

should do the job.

Greetz, Peter.
-- 
Peter van Dijk - student/sysadmin/ircoper/womanizer/pretending coder 
|  
| 'C makes it easy to shoot yourself in the foot;
|  C++ makes it harder, but when you do it blows your whole leg off.'
|                             Bjarne Stroustrup, Inventor of C++

Reply via email to