LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to restrict users to send mail to outside domains (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-restrict-users-to-send-mail-to-outside-domains-883147/)

amartlk 05-28-2011 12:31 AM

How to restrict users to send mail to outside domains
 
hi
How to restrict users to send mail to outside domains in qmail server, i have centos and qmail installed


Amar

divyashree 05-28-2011 04:10 AM

Quote:

Originally Posted by amartlk (Post 4369217)
hi
How to restrict users to send mail to outside domains in qmail server, i have centos and qmail installed


Amar

Mention all your domains in /var/qmail/control/rcpthosts to which user can send mail.

amartlk 05-30-2011 04:07 AM

hi

i already mention doamins in rcphost still it send mail outside


Regards
Amar

nidhinmd 05-30-2011 07:27 AM

Add domains names to /var/qmail/control/locals and /var/qmail/control/virtualdomains then restart qmail and check.

amartlk 06-02-2011 05:53 AM

thanks for reply
but still mail are going outside

bathory 06-02-2011 07:15 AM

Hi,

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)

Regards

amartlk 06-03-2011 03:58 AM

i add abc in smtproute file and restart qmail but still mail go outside

Regards
Amar

bathory 06-03-2011 05:06 AM

Quote:

Originally Posted by amartlk (Post 4374873)
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

amartlk 06-03-2011 05:38 AM

Thanks very much

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


Amar

bathory 06-03-2011 06:32 AM

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.

amartlk 06-11-2011 12:44 AM

Hi

i entered 200 in /var/qmail/control/queuelifetime, and when i send message to outside mail i get delivery fail message after 1 week pls help

Regards
Amar

bathory 06-11-2011 03:40 AM

Hi,

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

Regards

amartlk 06-11-2011 08:00 AM

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??


Regards
Amar

bathory 06-11-2011 01:15 PM

No, it's queuelifetime that specifies the time a mail stays in queue
What gives:
Code:

/var/qmail/bin/qmail-showctl |grep queuelifetime
Maybe you're doing something wrong. You may try:
Code:

echo 200 > /var/qmail/control/queuelifetime

amartlk 06-13-2011 02:38 AM

Hi
/var/qmail/bin/qmail-showctl |grep queuelifetime

shows output as
queuelifetime: Message lifetime in the queue is 200 seconds.

queuelifetime~: I have no idea what this file does.


and

echo 200 > /var/qmail/control/queuelifetime

shows nothing output

Regards
Amar


All times are GMT -5. The time now is 01:12 PM.