Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello Everyone,
I am running a server at home. I need to have the server send an email everyday so i can get updated information no matter where i am at. I have tried using sendmail and mail but neither successfully send my email. I have followed various tutorials and can't seem to figure out what is wrong. All of the mails appear in the Que the ones destined for Gmail say connection timed out, the ones for yahoo do not have any status. Any ideas, I do not really need a complicated server setup as I only need it to send me one email once a day.
One thing that is not clear here is what mta you are really using. You say "sendmail" but on most systems, although there may be a "sendmail" command (probably /usr/sbin/sendmail), some other package is being used as the mta. Eg. postfix, exim, msmtp etc.
Related to this is what distro you are running. Most distros should come with a "default" mta, unless you have special requirements, or experience running some other mta you should probably stick to whatever the default is.
Finally, in order to get specific help, it is best to provide specific information. These include the distro and mta you are using (as discussed above), how you have configured your mta, and the *exact* error messages (cut-paste of log files and terminal ouputs).
If you're at home setting up the mail server then you need to have a fixed IP address and a domain registered. Otherwise it happens what you have experienced, that mail is queued and not delivered.
If you're at home setting up the mail server then you need to have a fixed IP address and a domain registered. Otherwise it happens what you have experienced, that mail is queued and not delivered.
Actually this is not strictly true. For many years I used a local mta on my laptop that always had a random IP address assigned by whatever dhcp server was on the network I happened to be connected to at the time. However, some smtp servers will not accept mail if they cannot establish a reverse connection to the smtp of the sending server (sorry I don't recall what this is actually called). IIRC the mail would appear to be sent and then just be silently dropped by the destination smtp server: this caused all sorts of problems.
So, a few years ago I switched to configuring the smtp servers on my machines to using a smarthost (as described in your links).
Thanks for the replies,
Evo2, I have only installed the Sendmail server so far as that is what most of the tutorials have shown, If I need to setup more I will. The Server is a Backup server I have running at home that pulls Backups from our website daily. I am in the process of setting up a script that will email me my external ip address to my gmail daily while it is on pulling backups so I can use WOL and Proxy services that I am going to setup on the Server. So the email is not very integral to anyone but myself I just need it to Email me once a day. I am going to try it via the relay method mentioned.
I just recently spent about a week configuring a mail server on my VPS (Postfix, Dovecot, Squirrelmail)
I can tell you that I ran into a lot of problems trying to send and receive mail with only my public IP address. It was when I finally transferred my authorative DNS zone from my previous hosting provider to my VPS that these problems smoothed out.
In your case, if you don't want to pay for a domain at least sign up for a dynamic DNS service, install Bind and configure an MX record for your mail server. (Although Bind may be a little overkill. Maybe someone can suggest a lightweight alternative for your purposes.)
Evo2 mentioned that some mail servers will not accept mail if they cannot perform a reverse DNS query. Meaning if your IP address does not resolve to a domain, your hosed. I believe there is some truth in that.
Thanks for the Replies,
Yeah I will try a relay once I get home, eventually I may get a registered domain name but seeing as I only need it to send myself an email it is not worth it right now.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
If you have a relay host (that is what you normally would set as outgoing mail server on your client) use the sendEmail program. Note the program name is sendEmail but your distro might call both the package and the program sendemail. Try the alternate if one of the two doesn't work.
sendEmail is strictly an e-mail client, which executes exactly one command. If you have a relay host it will work. If you don't, it depends. There are a dozen of options including password authentication, cc, bcc, attachments etc.
I have used mailx in the past for this type of task. It will default to using the local MTA on the server, but you can force it to use an external SMTP server. Look up mailx and gmail as I am sure I recently saw a tutorial on how to mailx to send mail to gmail using your google username and password as well.
perhaps the paths you set up in crontab are not the same as in your shell when you execute the script.
So it is always advisable to use full pathnames within the script, so that it can be ran.
for example:
Code:
$ ntpq -p
may not be the same as:
$ /usr/sbin/ntpq -p
which in first case may not execute, because of the PATH defined in the shell of the user (ie. "root" user can have different paths than "joe")
It may help if you would post the script you are running (with output) and the output of "cron email" job.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.