- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Sending Emails on the box
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2007 04:14 AM
тАО08-19-2007 04:14 AM
Sending Emails on the box
I have a problem, i am trying to write a cron job to send mail to some mail account when an alert is detected. I try sending mail out using command:
echo "testing"|mail -s test test@gmail.com
but it doesnt work. I guess it is being blocked. Is there anyway i can go around this?
Best regards
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2007 04:47 AM
тАО08-19-2007 04:47 AM
Re: Sending Emails on the box
Check the status of your messages using:
mailq -v
And post the results, that will give us a clue about what is going on.
Also, the last lines of the /var/log/maillog file.
Cheers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2007 03:24 PM
тАО08-19-2007 03:24 PM
Re: Sending Emails on the box
Thanks for the response :) as per your request:
$ echo "test lalalala12345"|mail -s "testing" chua_ka@yahoo.com
$ mailq -v
/var/spool/clientmqueue (5 requests)
-----Q-ID----- --Size-- -Priority- ---Q-Time--- --------Sender/Recipient--------
l7K3UNiH023454 19 30059 Aug 20 11:30 henry
(Deferred: Connection refused by [127.0.0.1])
(---:chua_ka@yahoo.com---)
chua_ka@yahoo.com
(Deferred: Connection refused by [127.0.0.1])
l7K0TUDi021767 7065 307005 Aug 20 08:29 MAILER-DAEMON
(Deferred: Connection refused by [127.0.0.1])
(---:root---)
root
(Deferred: Connection refused by [127.0.0.1])
l7JK26kn018851 5651 755691+Aug 20 04:02 root
(Deferred: Connection refused by [127.0.0.1])
(---:root---)
root
(Deferred: Connection refused by [127.0.0.1])
l7J6TUDi011212 1461 1921400 Aug 19 14:29 MAILER-DAEMON
(Deferred: Connection refused by [127.0.0.1])
(---:henry---)
henry
(Deferred: Connection refused by [127.0.0.1])
l7J1Y5RD008511 19 2370059+Aug 19 09:34 henry
(Deferred: Connection refused by [127.0.0.1])
(---:chua_ka@yahoo.com---)
chua_ka@yahoo.com
(Deferred: Connection refused by [127.0.0.1])
Total requests: 5
$tail -50 /var/log/maillog
Aug 20 09:29:30 tenessee sm-msp-queue[22333]: l7J1Y5RD008511: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=23:55:25, xdelay=00:00:00, mailer=relay, pri=2190059, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 10:29:30 tenessee sm-msp-queue[22900]: l7K0TUDi021767: to=root, delay=02:00:00, xdelay=00:00:00, mailer=relay, pri=217005, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 10:29:30 tenessee sm-msp-queue[22900]: l7JK26kn018851: to=root, ctladdr=root (0/0), delay=06:27:24, xdelay=00:00:00, mailer=relay, pri=665691, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 10:29:30 tenessee sm-msp-queue[22900]: l7J6TUDi011212: to=henry, delay=20:00:00, xdelay=00:00:00, mailer=relay, pri=1831400, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 10:29:32 tenessee sm-msp-queue[22900]: l7J1Y5RD008511: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=1+00:55:27, xdelay=00:00:00, mailer=relay, pri=2280059, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 11:29:30 tenessee sm-msp-queue[23439]: l7K0TUDi021767: to=root, delay=03:00:00, xdelay=00:00:00, mailer=relay, pri=307005, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 11:29:30 tenessee sm-msp-queue[23439]: l7JK26kn018851: to=root, ctladdr=root (0/0), delay=07:27:24, xdelay=00:00:00, mailer=relay, pri=755691, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 11:29:30 tenessee sm-msp-queue[23439]: l7J6TUDi011212: to=henry, delay=21:00:00, xdelay=00:00:00, mailer=relay, pri=1921400, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 11:29:36 tenessee sm-msp-queue[23439]: l7J1Y5RD008511: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=1+01:55:31, xdelay=00:00:00, mailer=relay, pri=2370059, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug 20 11:30:25 tenessee sendmail[23454]: l7K3UNiH023454: from=henry, size=59, class=0, nrcpts=1, msgid=<200708200330.l7K3UNiH023454@mountuu.dnsalias.org>, relay=henry@localhost
Aug 20 11:30:25 tenessee sendmail[23454]: l7K3UNiH023454: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30059, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Please let me know if u need more info.
Thanks.
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2007 06:51 PM
тАО08-19-2007 06:51 PM
Re: Sending Emails on the box
This means that there's no program running to
receive e-mail. Or, in other words:
> For that to work, your MTA must be correctly configured.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2007 11:33 PM
тАО08-19-2007 11:33 PM
Re: Sending Emails on the box
Later releases of sendmail require that the sendmail daemon be running, even to accept local mail on localhost as is happening on your machine now.
Assuming no modification to default setup the procedure to get mail started is simple.
chkconfig sendmail on
# this sets up the daemon to run at startup.
service sendmail start
This is a Red Hat procedure.
The normal data center way of getting mail actually off the box involves using a mail relay server. What server this is is provided normally by your networking group.
In sendmail.cf you use DShostnamerelayserver
restart sendmail and your system will automaticallly relay using the relay server. That server must be explicitly configured to accept mail from your linux box or all the mail will be rejected.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2007 02:40 AM
тАО08-20-2007 02:40 AM
Re: Sending Emails on the box
I have tried sending the mail after restarting the service. But the mail still was not able to reach the recipient
$echo "test lalalala12345"|mail -s "testing" chua_ka@yahoo.com
# mailq -v
/var/spool/mqueue is empty
Total requests: 0
[root@mountuu ~]#
maillog:
Aug 20 22:32:24 tenessee sendmail[30274]: l7KEWOmM030264: to=
ocal, pri=32259, dsn=2.0.0, stat=Sent
Aug 20 22:32:24 tenessee sendmail[30264]: l7KEWOmO030264: from=
708190134.l7J1Y5RD008511@mountuu.dnsalias.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug 20 22:32:24 tenessee sm-msp-queue[30263]: l7J1Y5RD008511: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=1+12:58:19, xdela
y=00:00:00, mailer=relay, pri=3450059, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (l7KEWOmO030264 Message accepted for deli
very)
Aug 20 22:32:27 tenessee sendmail[30277]: l7KEWOmO030264: to=
lay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120361, relay=b.mx.mail.yahoo.com. [66.196.97.250], dsn=2.0.0, stat=Sent (ok dirdel
)
Aug 20 22:32:32 tenessee sendmail[30269]: l7KEWOmG030264: to=
lay=00:00:08, xdelay=00:00:08, mailer=esmtp, pri=120361, relay=e.mx.mail.yahoo.com. [216.39.53.1], dsn=2.0.0, stat=Sent (ok dirdel)
Aug 20 22:33:16 tenessee sendmail[30289]: l7KEXGN0030289: from=henry, size=59, class=0, nrcpts=1, msgid=<200708201433.l7KEXGN0030289
@mountuu.dnsalias.org>, relay=henry@localhost
Aug 20 22:33:20 tenessee sendmail[30293]: NOQUEUE: SYSERR(henry): can not chdir(/var/spool/mqueue/): Permission denied
Aug 20 22:33:21 tenessee sendmail[30290]: l7KEXGpR030290: from=
708201433.l7KEXGN0030289@mountuu.dnsalias.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug 20 22:33:21 tenessee sendmail[30289]: l7KEXGN0030289: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=00:00:05, xdelay=00:0
0:05, mailer=relay, pri=30059, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (l7KEXGpR030290 Message accepted for delivery)
Aug 20 22:33:24 tenessee sendmail[30295]: l7KEXGpR030290: to=
lay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120361, relay=c.mx.mail.yahoo.com. [216.39.53.3], dsn=2.0.0, stat=Sent (ok dirdel)
Aug 20 22:36:16 tenessee sendmail[30427]: l7KEaG0m030427: from=henry, size=59, class=0, nrcpts=1, msgid=<200708201436.l7KEaG0m030427
@mountuu.dnsalias.org>, relay=henry@localhost
Aug 20 22:36:16 tenessee sendmail[30428]: l7KEaGqT030428: from=
708201436.l7KEaG0m030427@mountuu.dnsalias.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Aug 20 22:36:16 tenessee sendmail[30427]: l7KEaG0m030427: to=chua_ka@yahoo.com, ctladdr=henry (500/500), delay=00:00:00, xdelay=00:0
0:00, mailer=relay, pri=30059, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (l7KEaGqT030428 Message accepted for delivery)
Aug 20 22:36:19 tenessee sendmail[30430]: l7KEaGqT030428: to=
lay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120361, relay=e.mx.mail.yahoo.com. [216.39.53.1], dsn=2.0.0, stat=Sent (ok dirdel)
Please let know if u have any ideas. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2007 03:13 AM
тАО09-13-2007 03:13 AM
Re: Sending Emails on the box
Sep 10 20:30:30 3250 sm-msp-queue[20596]: l86Cqjgn003943: to=cjozwiak@wesco.com,
ctladdr=cheryl (3062/200), delay=4+11:37:45, xdelay=00:00:01, mailer=relay, pri
=297281, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (l8B0UTVG020835 Mes
sage accepted for delivery)
Thanks.
Matt