LinuxQuestions.org
Register a domain and help support LQ
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 01-19-2005, 05:43 PM   #1
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Rep: Reputation: 30
Sendmail and changing it's default listening port...


How can I change which port sendmail listens on? I tried to find some entry in my "sendmail-slackware.mc" file but there wasn't anything there. Where can I change this? Thanks.

Last edited by darkarcon2015; 01-19-2005 at 05:49 PM.
 
Old 01-19-2005, 10:14 PM   #2
ronferns
LQ Newbie
 
Registered: Nov 2004
Location: Goa, India
Distribution: Fedora Core 1
Posts: 22

Rep: Reputation: 15
to set te port in the mc file use the following

to make sendmail listen to all interfaces on port 26 use the following
DAEMON_OPTIONS(`Port=26')

to make sendma to listen only to localloop on port 27 use the following
DAEMON_OPTIONS(`Port=26, Addr=127.0.0.1')
 
Old 01-20-2005, 01:23 PM   #3
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Original Poster
Rep: Reputation: 30
Do I have to add those lines to my "sendmail-slackware.mc" file or should they already be there?
 
Old 01-20-2005, 02:12 PM   #4
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
You can add the options to startup script, which is /etc/rc.d/rc.sendmail on Slackware, using DaemonPortOptions.

-O DaemonPortOptions=Port=26
 
Old 01-20-2005, 03:55 PM   #5
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Original Poster
Rep: Reputation: 30
Is there any specific place that I need to add that line in the file? Or is at the bottom okay? Here is a link to what mine looks like:

http://chaos24.net/darkarcon2015/Files/sendmail.txt
 
Old 01-20-2005, 10:41 PM   #6
ronferns
LQ Newbie
 
Registered: Nov 2004
Location: Goa, India
Distribution: Fedora Core 1
Posts: 22

Rep: Reputation: 15
You could add it is any of the three following places:

1. To your sendmail-slackware.mc file and then generate the sendmail.cf configuration file using the folowing command
#cd <your mail directory typically /etc/mail>
#m4 sendmail-slackware.mc > sendmail.cf

2. You could add the entry to the sendmail.cf file directly as
O DaemonPortOptions=Port=26

note that there is no "-" at the begining. Put the entries somehere near the other O entries in the sendmail.cf file.

3. As DaHammer mentioned you could use it as a command line option to sendmail in your startup script


/usr/sbin/sendmail -L sm-mta -bd -q25m -O DaemonPortOptions=Port=26

note the "-" before the O.

then restart the sendmail service.
 
Old 01-20-2005, 11:54 PM   #7
darkarcon2015
Member
 
Registered: Jun 2004
Location: Potsdam, NY
Distribution: Fedora Core 6
Posts: 201

Original Poster
Rep: Reputation: 30
Okay, if sendmail is already running (i.e. it starts at boot) can I still run that command (/usr/sbin/sendmail -L sm-mta -bd -q25m -O DaemonPortOptions=Port=26) through konsole and will it change the listening port the second I run that? Also, I would like to know what I would have to edit my re.sendmail file to in order to run that command at initialization. Thanks.

EDIT: Nice, this got it to work but I really would like to know how to get this to run at boot with that command.

Last edited by darkarcon2015; 01-21-2005 at 12:02 AM.
 
Old 01-21-2005, 12:17 AM   #8
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Open up the boot script, you'll see:
Code:
sendmail_start() {
  if [ -x /usr/sbin/sendmail ]; then
    echo "Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m"
    /usr/sbin/sendmail -L sm-mta -bd -q25m
    echo "Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m"
    /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
  fi
}
Change it to this:
Code:
sendmail_start() {
  if [ -x /usr/sbin/sendmail ]; then
    echo "Starting sendmail MTA daemon:  /usr/sbin/sendmail -L sm-mta -bd -q25m"
    /usr/sbin/sendmail -L sm-mta -bd -q25m -O DaemonPortOptions=Port=26
    echo "Starting sendmail MSP queue runner:  /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m"
    /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
  fi
}
Simple as that. Restart it...
/etc/rc.d/rc.sendmail restart

From now on, it will use port 26.
 
  


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
changing default dir of sendmail----- pal Linux - Newbie 0 09-20-2005 12:38 AM
2 servers listening on port 80 possible? scrawl Linux - Software 1 03-13-2005 06:06 PM
Sendmail not listening eggoz Linux - Software 6 09-06-2004 05:08 AM
Apache listening on port.. well it isn't Newman_SCO Linux - Newbie 10 08-15-2003 01:32 PM
sendmail listening on port 25 dskny Linux - Software 14 08-12-2003 07:52 PM


All times are GMT -5. The time now is 12:20 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration