[X-Unix] nevermind, figured it out ;) (re: simple commandline one-shot emailer)

James Bucanek subscriber at gloaming.com
Tue Feb 3 10:37:37 PST 2004


Peter Marreck wrote on Tuesday, February 3, 2004:

>After a thorough search of "man mail" and "man sendmail", these just 
>seem to be ways to talk to a local mailserver and a local mailbox.

That's correct.  In it's standard configuration, sendmail does nothing more than queue up a message with the sendmail daemon, (more or less) just as if it had received the message via an SMTP request.  The sendmail daemon then gets to work delivering the message.  Sendmail (the daemon) is normally designed to run as a fully functional SMTP server, so it delivers the mail directly to the destination server.  In the case of Postfix, the sendmail daemon is replaced by a "transport agent" whose job it is to send mail to another server.  Different architecture, but the same basic idea.  [ Note that some terms could be wrong, as I'm just typing this from memory. ]

>There seems to be no way to specify a foreign mailserver, unless I am 
>missing something here.

The sendmail deamon can be reconfigured to send all mail to a relay SMTP server.  For personal use, I edit the following file in /etc/postfix/main.cf:

    relayhost = smtp.west.cox.net

This tells Postfix to relay the mail to the given server instead of trying to delivery it directly.

>Not to mention, I got my girlfriend to switch to Linux on her thinkpad 
>(she had a recent "ok, that's it!" moment when another round of spyware 
>invaded her windows installation, hee hee), and until I get her to make 
>the final jump to OS X ;) , I wanted a "phone-home" script that emails 
>her IP on a semi-regular basis in the event the laptop is stolen. (I am 
>also trying to do the same for my Powerbook.)

Personally, I'd suggest solving this problem by signing up for a free dynamic domain service like <http://dyndns.org/>.  It will do exactly what you're talking about and avoids all of the mail configuration problems we've just been discussing.  Example: For security and virus abatement, my ISP (cox.net) does not allow outgoing SMTP connections except to the mail servers they supply (smtp.west.cox.net).  Furthermore, Cox's SMTP servers can't be used for relaying mail when sent messages from outside their network.  So if I configured my laptop to send via smtp.west.cox.net, and someone stole it, the script wouldn't sent mail anymore because it's now outside the Cox network.  Alternatively, if I could relay using an outside SMTP server the thieves could connect to a network that doesn't allow connecting to an outside server (like Cox), and again it doesn't work.

There is also commercial theft software available that's for more sophisticated at trying to track stolen equipment.  Sorry, but I don't have any URLs.

______________________________________________________
James Bucanek       <mailto:privatereply at gloaming.com>



More information about the X-Unix mailing list