# Setting up an SMTP client for sending alerts

## don quixada

Hi, I'd like to set-up an SMTP client for sending alerts to my e-mail. 

I was reading the postfix tutorial but it was getting very complex and most of the stuff I don't need. All I want to do is have a device connect to an SMTP server on my Gentoo box to send e-mail alerts out. 

The postfix tutorial is assuming I own a domain name etc (which I don't). I don't really care if the e-mail comes from bob@123.123.123.123 (<-- dynamic IP) instead of bob@foo.com because I won't be sending it any e-mails. 

So my question is should I be using postfix at all or something else? (nullmail or ssmtp?)

Or, if postfix makes the most sense which items from the tutorial can I safely ignore? Or is there another howto that specifically addresses this issue?

Thanks!

dq

----------

## John R. Graham

In my experience, ssmtp is the simplest. I use it on several servers to send me health notifications.

- John

----------

## don quixada

Is it only for local health reports or can I get an external device (in this case an IP camera) to connect to the SMTP server and send mails via that?

dq

----------

## John R. Graham

ssmtp is very simple, but it's send only: local reports only. There's a simple howto on the Wiki that describes a more comprehensive email server setup. There are more complex ones as well. Alas, I'm not completely sure they're completely up to date.

- John

----------

## don quixada

Yeah, I looked at that one already but it is out of date so I had trouble with the configurations because they didn't match current versions of the software. Also, and more importantly, I need to set up SMTP because that's what the ip camera uses and that tutorial only seems to include IMAP for sending (unless I'm not reading it right)...

dq

----------

## eccerr0r

Just want to clarify a bit...

You have a home machine, and you have an ISP account elsewhere.

Your home machine generates an event of some sort, and you want your home machine to send a mail to your ISP somewhere?

This is actually important, because I've noticed a lot of "ISP accounts elsewhere" dislikes any port 25 mail coming from a dynamic IP solely in fear of spam, effectively making your home machine useless as a mail origination device.  You'd be forced to POP or IMAP to your ISP's mail server (and some people have authenticated SMTP login, which also works) and send it that way.  Else you will need a static IP.  And this is if your ISP isn't blocking outgoing port 25 connects, also in fear of spam creation.

Receiving mail on your own is a different story, it's your dynamic IP and you'd be happy to receive mail from anyone, you make your own rules.  Then again some stupid ISPs block you from receiving port 25 mails, and that's the end of that discussion.

That being said, ssmtp or some other mail client sounds like what you want to do, postfix sounds like overkill and still may not do what you need.  Either way likely you'll need to configure your ISP's mail server as you won't be running one on your computer... that is, if your machine can download data from your IP camera and then forward it off, versus you wanting your IP camera sending alerts to your computer via SMTP and then your computer makes decisions to send your main mail account.  This latter case would probably require a full SMTP server.  And my posting comes too late, you may also need an IMAP server too.

----------

## don quixada

Yeah, it's true, my ISP does block port 25. My ISP account does actually have its own e-mail address and I can connect through SMTP so that's probably the way to go. Unfortunately I tried it and the ip camera could not connect to the account. I think something is wrong with the firmware on the camera. AND there is no way to update the firmware without messing things up (so I'm told) so I may just have to live without that feature... :/

dq

----------

## don quixada

Ok, somehow I pooched my dns resolutions after following the postfix guide.

I can connect to my router 192.168.1.1 but any outside addresses are not resolving. I tried to revert my changes to /etc/conf.d/hostname and /etc/conf.d/net and even have dhcp_eth0="release nodns nontp nonis" in there as per the network guide.

But I still can't resolve. I didn't touch resolv.conf.

So any ideas on how to fix this?

dq

----------

## eccerr0r

Can you still connect outside/ping with dotted quad ip address - is your default route still pointing to your router?

# route | grep default

Did you reboot/restart the network recently after these changes?

----------

## don quixada

I can ping external ip addresses. And yes I tried both rebooting and restarting the service...

The route default has my router name that I named it and 0.0.0.0 beside it. Does that make sense?

dq

----------

## eccerr0r

Somehow your resolv.conf got changed then, or something in conf.d/net caused it to change?

What's the current contents of that file?

Maybe post the contents of your conf.d/net and double check it for errors.

----------

## don quixada

Ah you're right! My resolv.conf was overwritten. Duh! What a newb problem-- why did I even post about it!? Anyway, thanks for your help. I reverted it and everything works again... Better do a bunch more reading before I try to configure postfix again...

dq

----------

