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.
|
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') |
Do I have to add those lines to my "sendmail-slackware.mc" file or should they already be there?
|
You can add the options to startup script, which is /etc/rc.d/rc.sendmail on Slackware, using DaemonPortOptions.
-O DaemonPortOptions=Port=26 |
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 |
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. |
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. |
Open up the boot script, you'll see:
Code:
sendmail_start() { Code:
sendmail_start() { /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. |