Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recurring error... 'Cannot open mail:25'
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
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Mon May 16, 2005 12:36 pm    Post subject: Recurring error... 'Cannot open mail:25' Reply with quote

Whenever I review my syslog output, I see a recurring theme represented by the following example:
Code:
cat  /var/log/messages

May 16 03:00:01 cgmd cron[13160]: (root) CMD (/usr/bin/updatedb^I)
May 16 05:00:01 cgmd cron[13560]: (root) CMD (/usr/bin/emerge --sync)
May 16 05:00:18 cgmd sSMTP[13562]: Unable to locate mail
May 16 05:00:18 cgmd sSMTP[13562]: Cannot open mail:25
May 16 05:05:24 cgmd cron[13559]: (root) MAIL (mailed 151143 bytes of output but got status 0x0001 )


I think this is probably harmless information regarding 'mail', but I'm wondering if there is a way to stop this from occurring?

Does anyone have any thoughts about this??

Thanks...
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
msalerno
Veteran
Veteran


Joined: 17 Dec 2002
Posts: 1336
Location: Sweating in South Florida

PostPosted: Mon May 16, 2005 2:53 pm    Post subject: Reply with quote

Do you have a mail server running ?

When your cron daemon is finished running it's tasks, it is sending an email, usually to root. It's possible that ssmtp cannot open on port 25 because you have another mail server running.
_________________
When harmonious relationships dissolve
Then respect and devotion arise;
When a nation falls to chaos
Then loyalty and patriotism are born.
-Lao Tse
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Mon May 16, 2005 4:34 pm    Post subject: Reply with quote

msalerno...

Thanks for responding...

I had attempted to set up samba as a server, but then didn't require it as such and then downgraded it. I have never set up a separate mail server, though (I don't think Mozila Thunderbird qualifies as such).

Any suggestion as to how I could troubleshoot this further??
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
msalerno
Veteran
Veteran


Joined: 17 Dec 2002
Posts: 1336
Location: Sweating in South Florida

PostPosted: Mon May 16, 2005 5:31 pm    Post subject: Reply with quote

if you:
# telnet localhost 25
or
# telnet <ipofserver> 25

Do you get a response?

You may need net-misc/netkit-telnetd
_________________
When harmonious relationships dissolve
Then respect and devotion arise;
When a nation falls to chaos
Then loyalty and patriotism are born.
-Lao Tse
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Mon May 16, 2005 5:50 pm    Post subject: Reply with quote

msalerno...

I get the following...
Code:
 # telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused


I'm not sure what to try as an 'ipofserver'?
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
msalerno
Veteran
Veteran


Joined: 17 Dec 2002
Posts: 1336
Location: Sweating in South Florida

PostPosted: Mon May 16, 2005 6:07 pm    Post subject: Reply with quote

You would use the inet addr from the output of ifconfig,

I am not 100% sure why this is happening, but I have a few possibilities.

For starters I would look here:
Quote:
Unable to locate mail


A few things to check, either you are missing the mail package (Doubtful) - mail-client/mailx
Or, your system thinks that it's name is mail, and nowhere does that name point back to the system.

Check the output of
hostname
and
hostname --fqdn

You could also try specifying the hostname in the /etc/ssmtp/ssmtpd.conf
with the line that starts with hostname=
_________________
When harmonious relationships dissolve
Then respect and devotion arise;
When a nation falls to chaos
Then loyalty and patriotism are born.
-Lao Tse
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Mon May 16, 2005 6:15 pm    Post subject: Reply with quote

I tried...
Quote:
Check the output of
hostname
and
hostname --fqdn


Both instances returned my correct last name...not 'mail'...
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Mon May 16, 2005 10:24 pm    Post subject: Reply with quote

I'll also try adding my hostname to the hostname line in the /etc/ssmtp/ssmtpd.conf. I'll post the outcome...

Thank you for helping me sort through this!
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Tue May 17, 2005 2:31 pm    Post subject: Reply with quote

msalerno...

Thank you, again, for helping with this...

There was no correction of the 'mail' error by adding my hostname to the hostname line in the /etc/ssmtp/ssmtpd.conf.

It appears that the mail request comes from cron activity during the early morning hours:
Code:
May 17 02:00:01 cgmd cron[12201]: (root) CMD (/usr/sbin/logrotate -s /etc/logrotate.conf)
May 17 02:00:01 cgmd sSMTP[12202]: Unable to locate mail
May 17 02:00:01 cgmd sSMTP[12202]: Cannot open mail:25
May 17 02:00:01 cgmd cron[12200]: (root) MAIL (mailed 296 bytes of output but got status 0x0001 )
May 17 03:00:01 cgmd cron[12400]: (root) CMD (/usr/bin/updatedb^I)
May 17 05:00:01 cgmd cron[12769]: (root) CMD (/usr/bin/emerge --sync)
May 17 05:00:21 cgmd sSMTP[12807]: Unable to locate mail
May 17 05:00:21 cgmd sSMTP[12807]: Cannot open mail:25
May 17 05:05:26 cgmd cron[12768]: (root) MAIL (mailed 140533 bytes of output but got status 0x0001 )


If I could redirect to something other than '(root) MAIL', perhaps the output could be satisfied?

I obviously don't have complete understanding of what's taking place.:(
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
JackBak
n00b
n00b


Joined: 14 Aug 2004
Posts: 49
Location: Boulder, Colorado

PostPosted: Sat May 28, 2005 3:27 pm    Post subject: Reply with quote

I'm in a similar situation with cgmd:

I'm using fcron to do an emerge sync every three days and then it emails the results to
root@my_machine. In the last couple of weeks ( I try to do emerge updates every Saturday
everything stable no ~x86) my fcron emails fail with
Code:
send-mail: RCPT TO:<postmaster@my_machine> (550 <postmaster@my_machine> No such user here)


I have tried all of this threads suggestions with the same results as cgmd. This has worked great since I set
everything up with fcron about 8 months ago. Obviously, there is a root user which is aliased to postmaster.
In the past the fcron emails would end up in root's dead.letter which is just fine - since there is no real
mail to the outside world -- it's all just ssmtp. Any Ideas?

Thanks.
Back to top
View user's profile Send private message
cgmd
Veteran
Veteran


Joined: 17 Feb 2005
Posts: 1585
Location: Louisiana

PostPosted: Thu Jun 09, 2005 4:31 pm    Post subject: Reply with quote

JackBak...

Please let me know if you find the answer! :)

I, too, am starting to use fcron on my laptop, but I'm having trouble figuring out the setup. If your fcron is otherwise working well, any pointers you could share as to how to set it up immediately after emerging it??

Thanks...
_________________
"Primum non nocere" ---Galen
Back to top
View user's profile Send private message
JackBak
n00b
n00b


Joined: 14 Aug 2004
Posts: 49
Location: Boulder, Colorado

PostPosted: Fri Jun 10, 2005 12:40 am    Post subject: Reply with quote

cgmd,

I may have led you astray. My fcron still is working (I followed the install tips at fcron's homeoage) but the
gentoo folks decided through some emerge I did that Logwatch was essential. It is logwatch that thinks
it can't email root. The fcron stuff as well as the logwatch stuff (with the err msg about not being
able to email root) ends up where it always has, root's dead.letter file.

So, bottom line -- it all still works I just get this odd logwatch error msg in my dead.letter file. At this
point I'm just ignoring that error msg.
Back to top
View user's profile Send private message
duden
n00b
n00b


Joined: 02 Jan 2005
Posts: 5
Location: Denmark

PostPosted: Wed Jul 27, 2005 11:46 pm    Post subject: Re: Recurring error... 'Cannot open mail:25' Reply with quote

cgmd wrote:


Code:
cat  /var/log/messages

May 16 03:00:01 cgmd cron[13160]: (root) CMD (/usr/bin/updatedb^I)
May 16 05:00:01 cgmd cron[13560]: (root) CMD (/usr/bin/emerge --sync)
May 16 05:00:18 cgmd sSMTP[13562]: Unable to locate mail
May 16 05:00:18 cgmd sSMTP[13562]: Cannot open mail:25
May 16 05:05:24 cgmd cron[13559]: (root) MAIL (mailed 151143 bytes of output but got status 0x0001 )


I think this is probably harmless information regarding 'mail', but I'm wondering if there is a way to stop this from occurring?

Does anyone have any thoughts about this??


sSMTP tries to send an email through the specified mailhost, in this case host "mail" which is not found. As already mentioned in this thread, you could setup your own local mailserver... but it is easier just to specify the actual mailhost of your domain (usually provided by your ISP). You can define the mailhost in /etc/ssmtp/ssmtp.conf:
Code:

mailhub=mailhost.mydomain.com

Note that "mailhost" will usually suffice. Also remember to specify the email that should receive the cron output. This is also done i ssmtp.conf:
Code:

root=duden@myemail.com
Back to top
View user's profile Send private message
drjimmy42
Guru
Guru


Joined: 03 Feb 2003
Posts: 512
Location: Nashua, NH

PostPosted: Mon Oct 10, 2005 11:59 am    Post subject: Reply with quote

What if I don't want to send the mail anywhere except into my local unix mailspool? I get the same dead.letter files but I just want them to go to /var/spool/root or something. Any ideas? Thanks.
Back to top
View user's profile Send private message
xlulux
n00b
n00b


Joined: 20 Aug 2004
Posts: 63

PostPosted: Fri Dec 30, 2005 8:13 pm    Post subject: Reply with quote

drjimmy42 wrote:
What if I don't want to send the mail anywhere except into my local unix mailspool? I get the same dead.letter files but I just want them to go to /var/spool/root or something. Any ideas? Thanks.


i need this awnsered too...
Back to top
View user's profile Send private message
drjimmy42
Guru
Guru


Joined: 03 Feb 2003
Posts: 512
Location: Nashua, NH

PostPosted: Sat Dec 31, 2005 1:27 am    Post subject: Reply with quote

This is not the answer to your question but what I did to stop the dead.letters was to use the

Code:
!mail(false)


command in fcron. This stops it from sending any mail. I never check my unix spool mail anyway so this is perfect for me. Still haven't figured the mail out.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 16114
Location: Colorado

PostPosted: Sat Dec 31, 2005 9:04 pm    Post subject: Reply with quote

Moved from Other Things Gentoo
_________________
lolgov. 'cause where we're going, you don't have civil liberties.

In Loving Memory
1787 - 2008
Back to top
View user's profile Send private message
arnoldbird
n00b
n00b


Joined: 22 Feb 2013
Posts: 1

PostPosted: Fri Feb 22, 2013 1:56 am    Post subject: Reply with quote

It's a very old thread but this issue is caused by the following line in /etc/ssmtp/ssmtp.conf:

mailhub=mail

There is a comment in the config file about this line.
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