LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Sendmail and changing it's default listening port... (https://www.linuxquestions.org/questions/slackware-14/sendmail-and-changing-its-default-listening-port-279866/)

darkarcon2015 01-19-2005 04:43 PM

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.

ronferns 01-19-2005 09:14 PM

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')

darkarcon2015 01-20-2005 12:23 PM

Do I have to add those lines to my "sendmail-slackware.mc" file or should they already be there?

DaHammer 01-20-2005 01:12 PM

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

-O DaemonPortOptions=Port=26

darkarcon2015 01-20-2005 02:55 PM

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

ronferns 01-20-2005 09:41 PM

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.

darkarcon2015 01-20-2005 10:54 PM

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.

DaHammer 01-20-2005 11:17 PM

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.


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