Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sendmail can't open the SMPT port
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Sat Nov 09, 2002 5:40 am    Post subject: sendmail can't open the SMPT port Reply with quote

I just got my gentoo running and after a few stumbles I have most things running OK. One nagging thing I haven't been able to figure out is why I keep getting the following message:
/usr/sbin/sendmail: can't open the SMPT port (25) on mail.

My installation was from a K6-2 stage 3 tarball, and I chose to install metalog and vcron. After that I emerged X and KDE. The thing is I never installed sendmail nor do I want to. I looked at the various scripts in the /etc directory but I just can't figure out what is causing this message. Not that it's
causing any harm, it is kinda annoying.
Back to top
View user's profile Send private message
prberens
n00b
n00b


Joined: 22 Aug 2002
Posts: 27
Location: 34° N 118° W

PostPosted: Sat Nov 09, 2002 5:51 am    Post subject: Reply with quote

It is cron. To disable cron trying to send an email after each run (hourly), put MAILTO="" at the top of your crontab.
_________________
- P -
Make it right before you make it faster.
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Sat Nov 09, 2002 12:24 pm    Post subject: Reply with quote

With fcron I use !mail(false) at the top of my crontab file, but I don't know the option for vcron.

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sat Nov 09, 2002 8:24 pm    Post subject: Reply with quote

Moving from Installing to Networking.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Mon Nov 11, 2002 10:22 pm    Post subject: Reply with quote

prberens wrote:
It is cron. To disable cron trying to send an email after each run (hourly), put MAILTO="" at the top of your crontab.


Tried what you suggested but I still keep getting the message
Back to top
View user's profile Send private message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Mon Nov 11, 2002 10:24 pm    Post subject: Reply with quote

lx wrote:
With fcron I use !mail(false) at the top of my crontab file, but I don't know the option for vcron.

Cya lX.


Tried your suggestion as well and I still get the message
Back to top
View user's profile Send private message
col
l33t
l33t


Joined: 08 May 2002
Posts: 820
Location: Melbourne - Australia

PostPosted: Mon Nov 11, 2002 10:32 pm    Post subject: Reply with quote

find the command in cron.hourly or wherever it is and pipe it to /dev/null like:

/usr/bin/webalizer 1> /dev/null 2> /dev/null
Back to top
View user's profile Send private message
fyerk
Apprentice
Apprentice


Joined: 17 Sep 2002
Posts: 212
Location: Atlanta, GA

PostPosted: Tue Nov 12, 2002 3:04 am    Post subject: Reply with quote

col wrote:
find the command in cron.hourly or wherever it is and pipe it to /dev/null like:

/usr/bin/webalizer 1> /dev/null 2> /dev/null


The easier way to do this is to just send stdout to /dev/null and redirect stderr to stdout
Code:

/usr/bin/webalizer > /dev/null 2>&1

_________________
-David
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Tue Nov 12, 2002 12:35 pm    Post subject: Reply with quote

Well maybe the first question should be, is this problem related to the cron service. Have you determined already what proces is causing the message? (recurring event, when / starting stoping services, etc).

Maybe we're blaiming cron (although it's a good candidate), but it might be something else,

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Thu Nov 14, 2002 7:23 am    Post subject: Reply with quote

lx wrote:
Well maybe the first question should be, is this problem related to the cron service. Have you determined already what proces is causing the message? (recurring event, when / starting stoping services, etc).

Maybe we're blaiming cron (although it's a good candidate), but it might be something else,

Cya lX.


Looking at the various crons (hourly,daily,weekly,monthly) they are all empty, as I haven't put anything in there, nor am I too fluent on the needs of what one should have in there.
I do not see the command " /usr/bin/webalizer " in any of the crons.
The message recurrs about every 15 to 20 minutes, so it doesn't look like it would be caused by the hourly cron. As far as seeing whether it coincides with any action or event, it doesn't seem to, it seems to happen all by itself. One thing I should add, is that it only happens in the initial command line terminal window, so I notice it only if I don't start X or after I do a shutdown, which is when I see how many times the message occured.
Over all, my system is a fairly basic setup like I described in my original message, I do not have sendmail installed, and I didn't do any weird tweeking.
I am suprised that I didn't find any reference to this quirk in any of the forums.
Back to top
View user's profile Send private message
Jeff In Motion
n00b
n00b


Joined: 06 Jun 2002
Posts: 8

PostPosted: Thu Nov 14, 2002 1:31 pm    Post subject: Reply with quote

I'm having the same exact problem. I just did a fresh 1.4_rc1 install, and about every 20 minutes or so I get this message.

Code:
/usr/sbin/sendmail: can't open the smtp port (25) on mail.


I too am using vcron.

I've done some searches around the board on this issue, and it remains ultimately unsolved (for me at least). The two possible solutions seem to be either a) correctly configure /etc/ssmtp/ssmtp.conf -- or b) install postfix

Well unfortunately, I never use sendmail, and the only thing I could ever see myself using sendmail for, on this machine, is to send local mail only -- thus, I have no clue at all how to correctly configure ssmtp to not get this ridiculous error message. Could someone possibly post a sample configuration to fix/disable the issue?

I also thought about installing postfix, but smtp seems to be in conflict with it, and I'm worried about breaking something (I'm pretty new to Gentoo). So if someone couldn't help me with solution a, what steps would I have to take to install postfix without breaking other things?
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Thu Nov 14, 2002 9:32 pm    Post subject: Reply with quote

Jeff In Motion wrote:
I also thought about installing postfix, but smtp seems to be in conflict with it, and I'm worried about breaking something (I'm pretty new to Gentoo). So if someone couldn't help me with solution a, what steps would I have to take to install postfix without breaking other things?


Just unmerge ssmtp and install postfix, well that's what I've done, but if you don't have a need for postfix it seems like a very very very crude work around.

Maybe you can find out something using a dummy file /usr/sbin/sendmail containing something like
Code:
#!/bin/bash
echo ${*} > /tmp/sendmail.log
exit 0

ps. don't forget chmod +x /usr/bin/sendmail

Have you checked the var/log/everything or similar, normally errors are reported with the process causing them, well if you're lucky anyway.

Hope you'll fix it, seeing 2 people already have the same problem, so more to come,...

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
really
Guru
Guru


Joined: 27 Aug 2002
Posts: 430
Location: nowhere

PostPosted: Fri Nov 15, 2002 5:42 pm    Post subject: Reply with quote

i too have started to get the same error.
just after Telia (my isp) turned there port 25 off.
i dont actually care about the error message, all works fine :D
but i do get this when iploging all traffic.
UDP: dgram to port 1035 from mail1.telia.com:53 (116 bytees) sometimes 113 and varies.
which is said to be the outgoing POP3 server.

i dont think thats a install problem sence i never saw that error for 4 mothns, but after they closed port 25 to stop the spammers or something it started coming up.
_________________
NoManNoProblem

Get lost before you get shot.
Back to top
View user's profile Send private message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Sat Nov 16, 2002 3:47 am    Post subject: Reply with quote

lx wrote:

Maybe you can find out something using a dummy file /usr/sbin/sendmail containing something like
Code:
#!/bin/bash
echo ${*} > /tmp/sendmail.log
exit 0

ps. don't forget chmod +x /usr/bin/sendmail

Have you checked the var/log/everything or similar, normally errors are reported with the process causing them, well if you're lucky anyway.



I should have checked before, but it in fact I do have /usr/sbin/sendmail executable on my system, and it is actually a link to /usr/sbin/ssmtp , which when I check, is in fact installed on my system.
My question now is, if I didn't emerge the "ssmtp" individually, will I break some dependancy if I do an unmerge of it, and will unmerging get rid of the problem.

Another observation I have, that after checking /var/log/everything , I do see that cron is causing this activity, and at an exact 15 min interval. I didn't know there was a 15 minute cron. Does anybody have an explanation?
here are the log entries that get repeated every 15 minutes:

Nov 13 22:45:00 [CRON] (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Nov 13 22:45:00 [CRON] (root) CMD (root^Itest -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Nov 13 22:45:00 [sSMTP mail] unable to connect to "mail" port 25.
Nov 13 22:45:00 [sSMTP mail] can't open the smtp port (25) on mail.
Nov 13 22:45:00 [CRON] (root) MAIL (mailed 33 bytes of output but got status 0x0001 )
Back to top
View user's profile Send private message
ronmon
Veteran
Veteran


Joined: 15 Apr 2002
Posts: 1043
Location: Key West, FL

PostPosted: Sat Nov 16, 2002 1:37 pm    Post subject: Reply with quote

So far so good, though I will give it a while before claiming success. Doing an 'emerge -C ssmtp' and 'emerge postfix' seems to have fixed it. /usr/sbin/sendmail is now a real executable instead of a link and no more nags in the log.

Nothing seems to have broken so it might be worth a shot.
Back to top
View user's profile Send private message
darktux
Veteran
Veteran


Joined: 16 Nov 2002
Posts: 1086
Location: Coimbra, Portugal

PostPosted: Sat Nov 16, 2002 5:07 pm    Post subject: Reply with quote

Doing a
Code:
fuser 25/tcp

wouldn't have been a bad idea.. I just read the first post, sorry if I'm off topic right now :-)
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Mon Nov 18, 2002 1:26 pm    Post subject: Reply with quote

glober wrote:
Another observation I have, that after checking /var/log/everything , I do see that cron is causing this activity, and at an exact 15 min interval. I didn't know there was a 15 minute cron. Does anybody have an explanation?
here are the log entries that get repeated every 15 minutes:

Nov 13 22:45:00 [CRON] (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Nov 13 22:45:00 [CRON] (root) CMD (root^Itest -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Nov 13 22:45:00 [sSMTP mail] unable to connect to "mail" port 25.
Nov 13 22:45:00 [sSMTP mail] can't open the smtp port (25) on mail.
Nov 13 22:45:00 [CRON] (root) MAIL (mailed 33 bytes of output but got status 0x0001 )


the exact line is in /etc/crontab, and it's executed at an 15 min. interval. It's the hart of the cron.hourly etc, the hourly, daily etc are workarounds to simplify cron jobs. question is why it wants to mail, have you deleted /usr/sbin/run-crons or something, well I haven't added the file /etc/crontab cause I don't need it, it I want to do something hourly c.q. daily I can easily implement it using fcron, without the need of a script. I think you can run "crontab -e" (well at least with fcron) to see the users crontab,

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Tue Nov 19, 2002 3:31 am    Post subject: Reply with quote

lx wrote:

the exact line is in /etc/crontab, and it's executed at an 15 min. interval. It's the hart of the cron.hourly etc, the hourly, daily etc are workarounds to simplify cron jobs. question is why it wants to mail, have you deleted /usr/sbin/run-crons or something, well I haven't added the file /etc/crontab cause I don't need it, it I want to do something hourly c.q. daily I can easily implement it using fcron, without the need of a script. I think you can run "crontab -e" (well at least with fcron) to see the users crontab,

Cya lX.


You are right, /etc/crontab does have what looks like what is being executed every 15 minutes. Here is my crontab in full:


# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
# for vixie cron
# remember to give cron a sighup when updating this file
#
# $Header: /home/cvsroot/gentoo-x86/sys-apps/vcron/files/crontab,v 1.2 2002/04/27 21:46:45 bangert Exp $
#
#
*/15 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons
0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
0 0 * * * root rm -f /var/spool/cron/lastrun/cron.daily
0 0 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
0 0 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly



Why its running SSMTP, Idon't know. I do have the /usr/sbin/run-crons script on my system, and it also doesn't have any reference to SSMTP. As far as crontab itself, no I didn't add it myself, and I am not really sure what the syntax means, how I should edit, delete, or whatever. Obviously " */15 " means it executes every 15 minutes. BTW running "crontab -e" just shows me the contents of crontab.
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Tue Nov 19, 2002 10:14 am    Post subject: Reply with quote

glober wrote:
Why its running SSMTP, Idon't know. I do have the /usr/sbin/run-crons script on my system, and it also doesn't have any reference to SSMTP. As far as crontab itself, no I didn't add it myself, and I am not really sure what the syntax means, how I should edit, delete, or whatever. Obviously " */15 " means it executes every 15 minutes. BTW running "crontab -e" just shows me the contents of crontab.


it default behaviour is to run /usr/bin/sendmail and send the output of the executed task or just a notificating that the task is executed.

Well except for vcron you have to manually install crontab using crontab /etc/crontab (it's in the install instruction of gentoo). This overrides the current crontab with the one in the file /etc/crontab. Running crontab -e, you can change the current crontab, so the one cron is actually using (well for dcron and fcron).

Have you tried adding MAILTO="" (dcron, i think) ((or !MAIL=false (fcron))) as suggested earlier to the top of the crontab using crontab -e; maybe this needs a restart of cron, but I don't think so.

If this doesn't work you could make an empty script instead of the /usr/bin/sendmail link, but I don't know if this has consequences for other packages,

Quote:
ssmtp: A minimal mail-transfer agent which forwards mail to an SMTP server
, I don't think you have it configured and therefor it gives an error.

Do you have crontabs in cron.h.... etc, (/etc/cron.daily/whatis.... needs to be edited for it to work), else just remove the startup script from the boot level rc-update del dcron boot.

Hope you'll fix it,

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
glober
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2002
Posts: 77
Location: Vancouver, Canada

PostPosted: Fri Nov 22, 2002 10:17 pm    Post subject: Reply with quote

lx wrote:

Have you tried adding MAILTO="" (dcron, i think) ((or !MAIL=false (fcron))) as suggested earlier to the top of the crontab using crontab -e; maybe this needs a restart of cron, but I don't think so.

If this doesn't work you could make an empty script instead of the /usr/bin/sendmail link, but I don't know if this has consequences for other packages



I tried putting MAILTO="" and !MAIL=false into crontab with no results, but I did decide to try and disable the /usr/sbin/sendmail link, which I did by renaming it to something else, and presto, the nagging message is gone. Not that this gives me an automated mail system, but then on a home system I don't think I need one. So far I haven't seen any bad after effects.

Thanks for your assistance, glober.
Back to top
View user's profile Send private message
mag
n00b
n00b


Joined: 27 Aug 2002
Posts: 41

PostPosted: Thu Nov 28, 2002 9:30 pm    Post subject: Reply with quote

There are a few ways to fix the mail problem - either install a proper MTA or correct the configuration for SSMTP.

Edit /etc/ssmtp/sstmp.conf and put in a valid address for the mailhub variable.

You could also always disable cron, but that's generally not recommended.
Back to top
View user's profile Send private message
keratos68
Guru
Guru


Joined: 27 Dec 2002
Posts: 561
Location: Blackpool, Lancashire, UK.

PostPosted: Sun Dec 29, 2002 9:36 pm    Post subject: Reply with quote

MAILTO needs to be set to null string (i.e. export MAILTO="") in your global profile (i.e. /etc/profile.env)

The vixie-cron (VCRON) binaries are set to mail the person identified in the shell variable LOGNAME if MAILTO is not defined at all, wierd - but just set MAILTO to ""
Back to top
View user's profile Send private message
Reformist
Guru
Guru


Joined: 06 Oct 2002
Posts: 323

PostPosted: Wed Apr 09, 2003 8:21 pm    Post subject: Reply with quote

Running stderr to /dev/null in the /etc/crontab did the trick, because I had a job that was executing every minute (I meant it to be every hour, so I fixed that), and it was printing an error message because I wasn't online.

BTW, suggesting to fix /etc/ssmtp/sstmp.conf is not a good idea some of the time, because I had this message appearing every minute, which means if the mail forwarding option is actually set up correct, I'd be getting 60 emails an hour from cron =)
_________________
-Phil Crosby
Back to top
View user's profile Send private message
carrett
Apprentice
Apprentice


Joined: 22 Mar 2003
Posts: 273

PostPosted: Fri Apr 18, 2003 8:27 am    Post subject: Reply with quote

lx wrote:
Jeff In Motion wrote:
I also thought about installing postfix, but smtp seems to be in conflict with it, and I'm worried about breaking something (I'm pretty new to Gentoo). So if someone couldn't help me with solution a, what steps would I have to take to install postfix without breaking other things?


Just unmerge ssmtp and install postfix, well that's what I've done, but if you don't have a need for postfix it seems like a very very very crude work around.

Maybe you can find out something using a dummy file /usr/sbin/sendmail containing something like
Code:
#!/bin/bash
echo ${*} > /tmp/sendmail.log
exit 0

ps. don't forget chmod +x /usr/bin/sendmail

Have you checked the var/log/everything or similar, normally errors are reported with the process causing them, well if you're lucky anyway.

Hope you'll fix it, seeing 2 people already have the same problem, so more to come,...

Cya lX.


the only trouble with the dummy is that if you have a cron job that sends out email every 15 mins. or something, /tmp/sendmail.log will get huge after a couple of weeks. i would do:
Code:
#!/bin/bash
echo ${*} > /dev/null
exit 0


unless of course you're using sendmail for anything...
_________________
I'm against picketing, but I don't know how to show it.
Back to top
View user's profile Send private message
BServiss
n00b
n00b


Joined: 24 Nov 2002
Posts: 62

PostPosted: Tue Feb 17, 2004 2:38 am    Post subject: Reply with quote

I had a problem with vixie-cron as it seemed to require sSMTP from the emerge --pretend. But after looking at the problems others have had with ssmtp due to improper setup(can't send mail:25), I looked at the ebuild for vixie-cron:

RDEPEND="!virtual/cron
sys-apps/cronbase
virtual/mta
selinux? ( sys-libs/libselinux )"

Instead of a specific program, a generic application class is given and I would guess that ssmtp is first on the list. Also, since ssmtp is also virtual/mta it conflicts postfix.

I think vixie-cron should require postfix for regular handling of local mail. Should this be posted as a bug?

Brian
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum