?
Solved

qmail

Posted on 2007-08-09
21
Medium Priority
?
399 Views
Last Modified: 2010-05-18
ok, this machine is an out of the box linux install - typical sendmail except for one thing
1. qmail was installed over the top and it has its own version of sendmail
2. We only need mail to go outbound from that machine.
3. We need to fix it so that all outbound mail from sendmail use an external SMTP "address" to send mail.

How do we do this?
0
Comment
Question by:southerndiversity
  • 11
  • 10
21 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 19663397
/var/qmail/control/smtproutes or wherever qmail has it's control files, put following content
:some.mail.server.tld

It will use qmail not to check where is MX for given recipient, but send it to specified host.
Is that what You wanted?
0
 

Author Comment

by:southerndiversity
ID: 19663722
Where would I find the control files? I've gone to the patch structure up to: /var/qmail/control
and this is what I got:


total 32
-rw-r--r--    1 root     root            3 Mar  8  2002 concurrencyincoming
-rw-r--r--    1 root     root           11 Mar  8  2002 defaultdelivery
-rw-r--r--    1 root     root           14 Mar  8  2002 defaultdomain
-rw-r--r--    1 root     root           74 Mar  9  2002 locals
-rw-------    1 root     root            0 Mar  9  2002 locals.lock
-rw-r--r--    1 root     root           23 Mar  8  2002 me
-rw-r--r--    1 root     root           14 Mar  8  2002 plusdomain
-rw-r--r--    1 root     root          125 Sep 17  2002 rcpthosts
-rw-------    1 root     root            0 Sep 17  2002 rcpthosts.lock
-rw-r--r--    1 root     root            0 Mar  8  2002 smtproutes
-rw-r--r--    1 root     root          102 Sep 17  2002 virtualdomains
-rw-------    1 root     root            0 Sep 17  2002 virtualdomains.lock
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19663762
And as You see there's empty
-rw-r--r--    1 root     root            0 Mar  8  2002 smtproutes
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 

Author Comment

by:southerndiversity
ID: 19664021
so what should I do from here? I'm not very technical so please use baby steps and assume I know nothing :)
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19664078
First of all, You want all mails go through some another smtp server

echo ":remote.smtp.server.tld" >> /var/qmail/control/smtproutes

And You done. Of course replace remote.smtp.server.tld with Your real server name.
0
 

Author Comment

by:southerndiversity
ID: 19664119
I just enter: echo ":ip address" >> /var/qmail/control/smtproutes

from the command line in /var/qmail/control?

I'm sorry....not a linux/unix person
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19664146
Never used IP, but should work.
0
 

Author Comment

by:southerndiversity
ID: 19664279
enter that command from /var/qmail/control??

0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19664295
Does not matter, as we issuing full path to the smtproutes.
0
 

Author Comment

by:southerndiversity
ID: 19664578
so once I do that...it's perm, right?  We won't have to do anything else? Our IT guy said this:

Have all emails sent through 192.xxx.xx.x (it will allow relay from 192.xxx.xx.xx)
0
 

Author Comment

by:southerndiversity
ID: 19664830
After I did that I'm getting this:

[root@webstorm root]# cd /var/qmail/control/
[root@webstorm control]# echo ":192.161.20.1 >> /var/qmail/control/smtproutes
>

It looks like it's prompting me enter something else....
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19664901
^C
echo ":192.161.20.1" >> /var/qmail/control/smtproutes
Note the second "; And Yes, it will be permanent. No qmail restart required.
0
 

Author Comment

by:southerndiversity
ID: 19665007
I'm sorry...I don't see the seond ";

I'm entering exactly like this:

echo ":192.161.20.1" >> /var/qmail/control/smtproutes
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 2000 total points
ID: 19665103
The above is OK, the previous was not (only one double-quote)
0
 

Author Comment

by:southerndiversity
ID: 19665265
It looks like it worked that time:
-rw-r--r--    1 root     root           14 Aug  9 15:59 smtproutes

Now the IT guy told me to issue the following command to test it: /sendmail email address

and this is what I got:

[root@webstorm control]# /sendmail my.name@mycompany.com
bash: /sendmail: No such file or directory
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19665279
/var/qmail/bin/sendmail my.name@mycompany.com
0
 

Author Comment

by:southerndiversity
ID: 19665303
Okay...I'm trying that....how long should it take? After I entered that it looks like its trying to do something but it's not showing anything. When it's done should it come back to the prompt?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19665347
Yes, it's waiting for email headers and body

/var/qmail/bin/sendmail my.name@mycompany.com << EOF
From: Me <my.name@mycompany.com>
To: You <my.name@mycompany.com>
Subject: Test

Body of message
EOF
0
 

Author Comment

by:southerndiversity
ID: 19665411
I entered the following and it worked:

echo hello|mail -s test "hi" my.name@mycompany.com
0
 

Author Comment

by:southerndiversity
ID: 19665481
It's working pefectly but how would I enter something in the subject line?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19667935
echo "Mail body" | mail -s "subject of the mail" my.name@mycompany.com
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month16 days, 4 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question