LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-21-2006, 01:46 AM   #1
anamericanjoe
Member
 
Registered: May 2006
Posts: 69

Rep: Reputation: 16
Slackware, Sendmail, SMTP, SSH Tunnels


I am running Slackware 10.2 with Sendmail 8.13.4. My school has configured it's network in a way that prevents anyone from using port 25, and therefore disabling smtp. I would like to be able to forward the mail from my machine to my school's smtp server, smtp.school.edu .
Does anyone have advice on how to accomplish this?

I am a little confused as to how to go about it. My first thoughts were that maybe all I need to do is configure /usr/share/sendmail/cf/cf/sendmail-slackware.mc so that I have a line that looks like this:

define('SMART_HOST','smtp.school.edu')

However, I am not sure if that would work, since port 25 is completely blocked. Does sendmail forward it's mail to the smart host via port 25? If that's the case, then I was thinking that I could set up an ssh tunnel between my machine and a machine that has access to smtp.school.edu and define my smart host like this:

define('SMART_HOST','localhost')

Similar to how it was done at http://www.underlinux.com.br/content/view/4549/58/

If I take this approach, though, I would need to establish the ssh tunnel when I boot up my machine, before the sendmail daemon initializes. So, if I need to take this route, could anyone offer some advice on which rc script I should look at to set up this tunnel?
 
Old 05-21-2006, 03:15 AM   #2
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Quote:
Originally Posted by anamericanjoe
I am running Slackware 10.2 with Sendmail 8.13.4. My school has configured it's network in a way that prevents anyone from using port 25, and therefore disabling smtp.
You can always run the mail server on a different port. But I doubt that you will need to.

Quote:
Originally Posted by anamericanjoe
I would like to be able to forward the mail from my machine to my school's smtp server, smtp.school.edu .
Does anyone have advice on how to accomplish this?

I am a little confused as to how to go about it. My first thoughts were that maybe all I need to do is configure /usr/share/sendmail/cf/cf/sendmail-slackware.mc so that I have a line that looks like this:

define('SMART_HOST','smtp.school.edu')
If you are going to generate a config all proper like, that would be a solid first step. If you want to do it quick & dirty, just edit /etc/mail/sendmail.cf directly to define the smart host. Restart sendmail and see if it works.

Quote:
Originally Posted by anamericanjoe
However, I am not sure if that would work, since port 25 is completely blocked.
YOUR port 25 may be blocked, but I would wager that the school's port 25 is working just fine.

Quote:
Originally Posted by anamericanjoe
Does sendmail forward it's mail to the smart host via port 25? If that's the case, then I was thinking that I could set up an ssh tunnel between my machine and a machine that has access to smtp.school.edu and define my smart host like this:

define('SMART_HOST','localhost')

Similar to how it was done at http://www.underlinux.com.br/content/view/4549/58/

If I take this approach, though, I would need to establish the ssh tunnel when I boot up my machine, before the sendmail daemon initializes. So, if I need to take this route, could anyone offer some advice on which rc script I should look at to set up this tunnel?
Sounds like a lot of work. Try the easy way first and see what isssues you have. You may want to ask how the schools mail server is set up, though, so you will know if you need SMTP AUTH or anything else to get things working for you.
 
Old 05-21-2006, 07:15 PM   #3
anamericanjoe
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by shilo
Try the easy way first and see what isssues you have.
OK, so I have tried the easy way, but when I send mail from my machine it is not getting through to its destination. Any advice on where to go from here?
 
Old 05-21-2006, 08:19 PM   #4
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Quote:
Originally Posted by anamericanjoe
OK, so I have tried the easy way, but when I send mail from my machine it is not getting through to its destination. Any advice on where to go from here?
Check your mail log and see what it says the problem was. /var/log/maillog
 
Old 05-21-2006, 10:45 PM   #5
anamericanjoe
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 16
OK, so these are the past five lines of my /var/log/maillog:

(Note that I have changed the name of the smtp server for posting purposes.)

Code:
May 21 22:31:06 yankee sm-mta[4732]: gethostbyaddr(192.168.1.103) failed: 1
May 21 22:31:06 yankee sm-mta[4732]: gethostbyaddr(192.168.1.102) failed: 1
May 21 22:31:07 yankee sm-mta[4733]: starting daemon (8.13.4): SMTP+queueing@00:25:00
May 21 22:31:07 yankee sm-msp-queue[4736]: starting daemon (8.13.4): queueing@00:25:00
May 21 22:34:50 yankee sendmail[4849]: k4M2Yoxs004849: from=user, size=217, class=0, nrcpts=1, msgid=<200605220234.k4M2Yoxs004849@yankee.localdomain>, relay=user@localhost
May 21 22:34:50 yankee sm-mta[4850]: k4M2Yo7b004850: from=<user@yankee.localdomain>, size=486, class=0, nrcpts=1, msgid=<200605220234.k4M2Yoxs004849@yankee.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
May 21 22:34:50 yankee sendmail[4849]: k4M2Yoxs004849: to=user@foo.bar.edu, ctladdr=user (1000/100), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30217, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (k4M2Yo7b004850 Message accepted for delivery)
May 21 22:34:51 yankee sm-mta[4852]: k4M2Yo7b004850: to=<user@foo.bar.edu>, ctladdr=<user@yankee.localdomain> (1000/100), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120486, relay=smtp.school.edu. [128.205.6.73], dsn=2.0.0, stat=Sent (ok 1148265385 qp 19289)
I ran
Code:
tail -f /var/log/maillog
as I tried sending an email from my machine, which resulted in the very last line.

I noticed many lines that read
Code:
gethostbyaddr(192.168.1.103) failed: 1
in the log file, but I don't know what that means...

Last edited by anamericanjoe; 05-21-2006 at 11:05 PM.
 
Old 05-24-2006, 11:29 PM   #6
anamericanjoe
Member
 
Registered: May 2006
Posts: 69

Original Poster
Rep: Reputation: 16
Maybe I tried to bite off more than I can chew with my initial question...

Let me quickly outline my problem with a more focused goal this time.

I am running sendmail on my machine, but my school's network blocks traffic that comes from port 25. I tried to configure sendmail to use the SMART_HOST macro and point the smart host to my school's smtp port, but mail from my machine never makes it to it's destination.

I am thinking that if I can get sendmail to send smtp traffic on some port other than 25, maybe I will be able to send messages from my machine. Does anyone know how I can do this?

Also, is this sort of a question ok for this forum? (I'm still learning the rules of the road for LQ, so I'm not sure.)

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Interesting routing via ssh tunnels. alunduil Linux - Networking 2 12-26-2005 02:47 PM
Server Defined SSH Tunnels dlublink Linux - Software 1 09-29-2005 09:11 PM
Creating a router out of SSH Tunnels. Technoslave Linux - Networking 1 10-04-2004 07:07 PM
SSH tunnels and VNC, yet again. Edaph Linux - Security 7 05-23-2004 10:55 AM
Automatic SSH Tunnels fearofcarpet Linux - Software 1 12-05-2003 12:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:35 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