LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-11-2010, 05:50 AM   #1
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Rep: Reputation: 32
bouncesaying


Hello All,

I only allow my users receive email from mydomain1.com & mydomain2.com..

I put the following into .qmail-default file ..

|bouncesaying "This address is no longer accept email" sh -c '822fields from | grep -iqv @mydomain1.com && @mydomain2.com'

| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox


but it doesnot work.. could any body please help?

thanks & regards
Winanjaya
 
Old 01-11-2010, 06:25 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I'm not sure what you're trying to do with this bit:

'822fields from | grep -iqv @mydomain1.com && @mydomain2.com'

... could you please explain it ?

thanks
 
Old 01-11-2010, 06:49 PM   #3
Winanjaya
Member
 
Registered: Sep 2003
Posts: 239

Original Poster
Rep: Reputation: 32
it meant .. if sender 's domain is not from mydomain1.com or mydomain2.com .. then the mail should be rejected with bouncesaying

any idea? or did I miss something?
 
Old 01-11-2010, 10:47 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
The problem with an inverse grep is that at least one line of every message will match... is every message getting bounced?

You would need a longer script that would set a flag if the correct sender domain was found and set the relevant return code accordingly.

As a side note, the From: field can be easily forged so this solution may not be that effective, it may be worth investigating other methods of restricting inbound mail.

cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration