[SOLVED] How to restrict users to send mail to outside domains
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You can put a non-existent host in the smtproutes file, so when qmail tries to deliver a message that is not local it fails with a "permanent error"
You may also use queuelifetime to specify the time (e.g. 600) that the message stays in queue before it bounces back (default is 1 week)
i add abc in smtproute file and restart qmail but still mail go outside
Regards
Amar
What abc and what smtproute file?
You need sometrhing like:
Code:
:x.x.x.x
where x.x.x.x is the IP of a non existent host, or at least a host that does not run a mail server.
The filename is smtproutes and it's located in /var/qmail/control/smtproutes
solved , but it does not give any error when i send to external id it just send but not receive on external id and any thing to do to get returned back error
You don't pay much attention to replies.
I've already told you, that you need to specify a small amount time in /var/qmail/control/queuelifetime, so yo don't have to wait a week to get the bounce back message.
I don't know what you did, but I've just tested with a queuelifetime of 60sec and it worked, as you can see:
Quote:
2011-06-11 11:10:26.242030500 new msg 4793211
2011-06-11 11:10:26.242033500 info msg 4793211: bytes 510 from <foo@bar.com> qp 2867 uid 1000
2011-06-11 11:10:26.294100500 starting delivery 32: msg 4793211 to remote XXXXX@gmail.com
2011-06-11 11:10:26.294102500 status: local 0/10 remote 1/20
2011-06-11 11:10:29.301976500 delivery 32: deferral: Sorry,_I_wasn't_able_to_establish_an_SMTP_connection._(#4.4.1)/
2011-06-11 11:10:29.301979500 status: local 0/10 remote 0/20
2011-06-11 11:17:07.348944500 starting delivery 33: msg 4793211 to remote XXXXX@gmail.com
2011-06-11 11:17:07.348947500 status: local 0/10 remote 1/20
2011-06-11 11:17:10.358305500 delivery 33: failure: Sorry,_I_wasn't_able_to_establish_an_SMTP_connection._(#4.4.1)/I'm_not_going_to_try_again;_this_message_has_been_in_the_queue_too_long./
2011-06-11 11:17:10.358309500 status: local 0/10 remote 0/20
2011-06-11 11:17:10.473097500 bounce msg 4793211 qp 2911
2011-06-11 11:17:10.473100500 end msg 4793211
2011-06-11 11:17:10.473648500 new msg 4793225
2011-06-11 11:17:10.473650500 info msg 4793225: bytes 1146 from <> qp 2911 uid 1008
2011-06-11 11:17:10.540737500 starting delivery 34: msg 4793225 to local foo@bar.com
2011-06-11 11:17:10.540740500 status: local 1/10 remote 0/20
2011-06-11 11:17:21.034665500 delivery 34: success: did_1+0+1/
2011-06-11 11:17:21.034668500 status: local 0/10 remote 0/20
2011-06-11 11:17:21.035031500 end msg 4793225
AFAIK qmail tries for the first time to send the message and then retries (every 5mins?) until the queuelifetime expires. Then tries for a last time and bounces back the mail.
Even though there is no need to restart qmail, try to restart it and test to see what happens
i kept 200 in /var/qmail/control/queuelifetime, and restart but still not get bounce back i will baunce back after 1 week which is default values i think qmail not take value from queuelifetime need to edit any other files??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.