wolfgang wrote:Hmmm, I am still struggling with my alerting with email. I assume that there is a buildt in email server in freeNATS VM, if this is the case then i know why my email is not working, because my ISP (and most others also) block outgoing email from servers in network. To avoid this i would like to know where to configure the outgoing email server, to use the outgoing email server of my ISP instead of the buildt in email server of freeNATs VM.
Dave can you confirm if it shall work with buildt in email server? and if yes how to configure for external outgoing email server?
Ah yes I'm afraid that is a bit of an issue right now. The VM uses sendmail to send email which will try and deliver directly to the domain.
If you want to configure a mail relay (a "smart" relay in sendmail-speak) then I am afraid what you will need to do is:
- Login to the console as root
- Edit the file /etc/mail/sendmail.cf using the following command:
- Using page down go down to the bit that says (five page-downs):
Code: Select all
# "Smart" relay host (may be null)
DS
(n.b. this is in the "Local Settings" section of the file if you have trouble finding it)
- Change the DS line to read:
(you can use an IP address - no space between the DS and the mail server)
- Save the file with Control-X and then pressing return to accept the filename
At this point you will want to probably clear your mail queue as it will be full of all the failed messages
Edit:Sorry but the line above was missing a / which deleted the mqueue directory (and maybe other things!)
- Now restart sendmail
Code: Select all
/etc/rc.d/init.d/sendmail stop
[i]will output a stop message...[/i]
/etc/rc.d/init.d/sendmail stop
[i]should fail to stop this time...[/i]
/etc/rc.d/init.d/sendmail start
After issuing the start you should see "Starting Sendmail: Ok". If it fails make a careful note of the exact error.
This should now cause sendmail to relay mail through the SMTP server specified.
A few notes though: this won't work if you normally need to authenticate to the mail server to send mail and you
may suffer from a problem another user has had if your ISP has very strict anti-spam rules (unlikely).
If you make the change, sendmail starts ok and you still don't get mail wait until you've tried to send a few and then grab a copy/screenshot of the outputs of the following commands on the console:
Code: Select all
mailq
tail -c 1024 /var/log/maillog
Let me know how you get on. Sorry for the console editing - I'm looking at putting some sort of easy configurator in.
Regards,
Dave.