Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up an SMTP client for sending alerts
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
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Fri Oct 14, 2016 5:10 pm    Post subject: Setting up an SMTP client for sending alerts Reply with quote

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
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10156
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Oct 14, 2016 5:46 pm    Post subject: Reply with quote

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

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Fri Oct 14, 2016 6:14 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10156
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Oct 14, 2016 6:50 pm    Post subject: Reply with quote

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
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Fri Oct 14, 2016 7:43 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Fri Oct 14, 2016 7:47 pm    Post subject: Reply with quote

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.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Sun Oct 16, 2016 3:15 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Thu Oct 20, 2016 6:34 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Thu Oct 20, 2016 7:50 pm    Post subject: Reply with quote

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?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Fri Oct 21, 2016 2:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7051
Location: almost Mile High in the USA

PostPosted: Fri Oct 21, 2016 3:40 am    Post subject: Reply with quote

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.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Fri Oct 21, 2016 3:57 am    Post subject: Reply with quote

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
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