<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<p>I had a fierce fight with sendmail a few weeks ago to get my NAT'ed
NetSaint box to work with ICQ. As suggested here, it is possible to get
pages through ICQ by sending an email to <icqnumber>@pager.icq.com.
However, if this email does not come from a hostname that has a DNS name
that can be resolved on the net, the ICQ service just throws it away. As
far as I can see, the same problem exists here.
<p>As my box was sending emails from netsaint@netsaint.mycompaniessubdomain.mycompaniesdomain.com,
it did not work. The hostname from the netsaint box in the DNS name was
added by sendmail, and prevented it from being resolved on the net. Only
mycompaniessubdomain.mycompaniesdomain.com can be resolved on the net in
my case.
<p>I first started to play with a patched version of Pine (as Pine -unlike
mutt, mail, ...- allows you to specify an SMTP server which normally is
resolvable on the net) so it could be used command line. I worked OK, but
for some reason ICQ was not happy with the mail format Pine was using.
The result was that only one line was shown in the ICQ message.
<p>I then started the combat with Sendmail. Being an absolute Sendmail
nitwit, it did cost me some time, but I finally got it working. First off
all: do NOT edit your /etc/sendmail.cf file like suggested here before.
Edit the sendmail.mc file, and run m4 to create the /etc/sendmail.cf file
(see manual on how to do this if not sure). OK, I also edited the /etc/sendmail
first, but this is NOT the way to go. These are the lines in the sendmail.mc
file that I changed/added:
<p>define(`SMART_HOST',`smtp:[yoursmtpserver.yourcompany.com]')
<br>MASQUERADE_AS(yourcompany.com)
<br>FEATURE(`always_add_domain')
<br>FEATURE(`masquerade_envelope')
<br>FEATURE(`genericstable', `hash -o /etc/mail/genericstable')
<br>FEATURE(masquerade_envelope)dnl
<br>FEATURE(allmasquerade)dnl
<br>FEATURE(`genericstable')dnl
<br>GENERICS_DOMAIN(`yournetsaintboxdnsnameonthelan.com')dnl
<p>Where yourcompany.com MUST be resolvable on the net. Afterwards run
m4 to create your sendmail.cf. Then create a file /etc/mail/genericstable.
In that file add one line:
<p>"theusernamenetsaintsendsemailsfrom theusernameyouwanttoappear@yourcompany.com"
<p>Finally run the following command:
<p>"makemap -r hash /etc/mail/genericstable.db < /etc/mail/genericstable"
<p>Again without quotes. You can test your genericstable with:
<p>"echo '/map generics theusernamenetsaintsendsemailsfrom' | sendmail
-bt"
<p>I then send my emails using mutt. Add this line to the .muttrc file
in the netsaint user home dir:
<p>"set hostname=yourcompany.com"
<p>Without quotes. And this is what my commands look like:
<p>command[notify-by-email]=/bin/echo -e '***** NetSaint 0.0.7 *****\n\nNotification
Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$
<br>\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
$DATETIME$\n\nAdditional Info:\n\n$OUTPUT$' | /usr/bin/mutt -s '** $NOTIFICATIONTYPE$
alert - $HOSTALIAS$: $SERVICEDESC$ is $SERVICESTATE$ **' $CONTACTEMAIL$
<p>So, I know it looks bad, and some Sendmail/Linux expert might laugh
his ass off, but it worked for me. You might need to tinker a bit with
the example I gave, but it should work.
<p>Good luck!
<br>Tom
<p>Subhendu Ghosh wrote:
<blockquote TYPE=CITE>Write a perl script that talks directly to your ISP's
smtp server rather
<br>than relying on the local MTA/MUA interface.
<p>Should be simple with Net::SMTP module. See the sample app in
pod.
<p>-sg
<p>On Thu, 22 Aug 2002 todd.jones@weirslurry.com wrote:
<p>> I'm not sure I understand how sending my Email to my Internet gateway
would
<br>> be of any help. My Internet gateway is not a device which can
relay mail
<br>> to the Internet. Please let me know if I have misunderstood.
<br>>
<br>> My plan is to use the nagios box as an smtp server. If this
box was on the
<br>> Internet, I believe this would be moot. However, it is not
and cannot be
<br>> on the Internet.
<br>>
<br>> I'm trying to have the Email notifications going from the nagios
box go out
<br>> as being from 'nagios@tds.net'. I know this will work out fine,
if I can
<br>> figure out how to do it as I've sent Email from an smtp client in
this
<br>> manner successfully.
<br>>
<br>> Regards,
<br>>
<br>> Todd Jones
<br>> Network Administrator
<br>> Weir Slurry
<br>> 608.221.5805 phone
<br>> ----- Forwarded by Todd E Jones/US/WAR/Weir on 08/22/2002 01:14 PM
-----
<br>>
<br>>
Memo From:
<br>>
Aleksey
>From loehmanns.com
<br>>
Domorad
To: "'todd.jones@weirslurry.com'" <todd.jones@weirslurry.com>
<br>>
<Aleksey@loehm cc:
<br>>
anns.com>
Subject: RE: [Nagios-users] mail notifications
<br>>
<br>>
Sent:
<br>>
08/22/2002
<br>>
01:01 PM
<br>>
<br>>
<br>>
<br>>
<br>>
<br>>
<br>> Does your corporate network has a Firewall or similar gateway to
the
<br>> internet. If you do have a FireWall then just route your Email to
that
<br>> Firewall and use your Nagios box as SMTP server
<br>>
<br>> This is what I do at my place
<br>>
<br>> -----Original Message-----
<br>> From: todd.jones@weirslurry.com [<a href="mailto:todd.jones@weirslurry.com">mailto:todd.jones@weirslurry.com</a>]
<br>> Sent: Thursday, August 22, 2002 10:45 AM
<br>> To: nagios-users@lists.sourceforge.net
<br>> Subject: Re: [Nagios-users] mail notifications
<br>>
<br>>
<br>> This is not really a possibility due to my scenario. The nagios
box is not
<br>> on the Internet, and therefore, does not have an Internet DNS MX
record. I
<br>> cannot relay off my corporate Email. This is also not desirable,
as I
<br>> would
<br>> like to be able to monitor the corporate Email server and cannot
receive
<br>> notifications via my cell phone Email account to which I am sending
if the
<br>> Email server would be down.
<br>>
<br>> What I can do is send an Email from a client on the nagios box to
my isp's
<br>> smtp server as nagios@tds.net (my isp is tds). This Email is
properly
<br>> routed to my cell phone Email address. I'm not sure of a better
way to
<br>> handle this at this point.
<br>>
<br>> Regards,
<br>>
<br>> Todd Jones
<br>> Network Administrator
<br>> Weir Slurry
<br>> 608.221.5805 phone
<br>> ----- Forwarded by Todd E Jones/US/WAR/Weir on 08/22/2002 09:41 AM
-----
<br>>
<br>>
<br>>
Memo From:
<br>>
<br>>
Terry Simons
>From mac.com
<br>>
<br>>
<galimore@mac. To:
Demetri Mouratis
<br>> <dmourati@cm.math.uiuc.edu>
<br>>
com>
cc: todd.jones@weirslurry.com,
<br>> nagios-users@lists.sourceforge.net
<br>>
Subject: Re: [Nagios-users]
<br>> mail notifications
<br>>
Sent:
<br>>
<br>>
08/20/2002
<br>>
<br>>
08:31 PM
<br>>
<br>>
<br>>
<br>>
<br>>
<br>>
<br>>
<br>>
<br>>
<br>> Uh...
<br>>
<br>> Try forcing your SMTP to send as "nagios@address" Where address
is your
<br>> server's *real* IP address, or your server's DNS.
<br>>
<br>> nagios@localhost is probably not a good idea.
<br>>
<br>> localhost means "this computer" so maybe your ISP's mail server is
thinking
<br>> "This didn't come from me!!" and throwing it away.
<br>>
<br>> Just an idea.
<br>>
<br>> - Terry
<br>>
<br>> On Tuesday, August 20, 2002, at 06:28 PM, Demetri Mouratis
wrote:
<br>>
<br>> > What's the hostname on your Nagios box? Is it in DNS?
Do you have a
<br>> > smarthost setup or are you trying to send internet mail directly
from
<br>> > your Nagios box?
<br>> >
<br>> > I have a setup like this:
<br>> >
<br>> > Nagios box
<br>> > Private IP
<br>> > In Internal DNS
<br>> > Smarhosts to corporate mail relay
<br>> >
<br>> > Corporate mail relay in external DNS
<br>> > public IP
<br>> >
<br>> > Works just fine.
<br>> >
<br>> > On Tue, 20 Aug 2002 todd.jones@weirslurry.com wrote:
<br>> >
<br>> >> I am running nagios 1.05b on Redhat7.3. I am having some
issues
<br>> >> getting nagios to send Email messages to an outside Email account.
<br>> >>
<br>> >> I've been working on the problem for some time and it has to do
with
<br>> >> the from field. The from field shows up as nagios@localhost,
and my
<br>> >> isp's smtp
<br>> >> server rejects this. I've been working with Sendmail's masquerading
<br>> >> feature to try to get it to work, but nothing seems to make it
change.
<br>> >>
<br>> >> I do have a valid Email account of nagios with my isp. Any
<br>> >> experiences or help with this issue would be appreciated.
<br>> >>
<br>> >> Regards,
<br>> >>
<br>> >> Todd Jones
<br>> >> Network Administrator
<br>> >> Weir Slurry
<br>> >> 608.221.5805 phone
<br>> >>
<br>> >>
<br>> >>
<br>> >> -------------------------------------------------------
<br>> >> This sf.net email is sponsored by: OSDN - Tired of that same old
cell
<br>> >> phone? Get a new here for FREE!
<br>> >> <a href="https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390">https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390</a>
<br>> >> _______________________________________________
<br>> >> Nagios-users mailing list
<br>> >> Nagios-users@lists.sourceforge.net
<br>> >> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
<br>> >>
<br>> >
<br>> > ---------------------------------------------------------------------
<br>> > Demetri Mouratis
<br>> > dmourati@linfactory.com
<br>> >
<br>> >
<br>> >
<br>> > -------------------------------------------------------
<br>> > This sf.net email is sponsored by: OSDN - Tired of that same old
cell
<br>> > phone? Get a new here for FREE!
<br>> > <a href="https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390">https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390</a>
<br>> > _______________________________________________
<br>> > Nagios-users mailing list
<br>> > Nagios-users@lists.sourceforge.net
<br>> > <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
<br>>
<br>>
<br>>
<br>>
<br>>
<br>> -------------------------------------------------------
<br>> This sf.net email is sponsored by: OSDN - Tired of that same old
cell
<br>> phone?
<br>> Get a new here for FREE!
<br>> <a href="https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390">https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390</a>
<br>> _______________________________________________
<br>> Nagios-users mailing list
<br>> Nagios-users@lists.sourceforge.net
<br>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
<br>>
<br>>
<br>>
<br>>
<br>> -------------------------------------------------------
<br>> This sf.net email is sponsored by: OSDN - Tired of that same old
<br>> cell phone? Get a new here for FREE!
<br>> <a href="https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390">https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390</a>
<br>> _______________________________________________
<br>> Nagios-users mailing list
<br>> Nagios-users@lists.sourceforge.net
<br>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
<br>>
<p>--
<p>-------------------------------------------------------
<br>This sf.net email is sponsored by: OSDN - Tired of that same old
<br>cell phone? Get a new here for FREE!
<br><a href="https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390">https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390</a>
<br>_______________________________________________
<br>Nagios-users mailing list
<br>Nagios-users@lists.sourceforge.net
<br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a></blockquote>
<br> </html>
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390