WebFaction
Community site: login faq

For some reason putting

mailto=my_address@my_domain.com

at the top of the crontab does not send out any mail. However, the program "mail" is already set up on webfaction servers. For example, if you type

mail -s "subject" some_address@some_domain.com

then type a sentence after that for the body, hit CTRL-D, then hit ENTER a couple times, it will shoot off an email from yourlogin@yourmachine.webfaction.com.

However, you can do this all in one line of code with

echo "City Hall 1pm" | mail -s "meeting today" nobody@december.com

Expanding on this, I just send all errors to the cronlog, then check if there's anything in the cronlog. If so, send email. Like this:

Check if there were any errors, and if so, mail them

if [ -s /home/user/db_arch/cron.log ]; then cat /home/user/db_arch/cron.log | mail -s "Error Backing Up Databases" address@gmail.com; fi

This question is marked "community wiki".

asked 06 Jun '11, 20:25

jackdesert
1145
accept rate: 0%

edited 07 Jun '11, 07:25

You can setup crontab to send mail by using:

MAILTO=user@example.com
(06 Jun '11, 20:29) neeravk

Like I said, the MAILTO=user@example.com didn't work for me on Webfaction

(07 Jun '11, 07:24) jackdesert

MAILTO should work - you are probably not using it properly. You may want to post a support ticket, so we can check your specific account.

(07 Jun '11, 07:29) tie

This is coming in a little late, but I just ran across this issue. In my case, the problem (according to support) was that cron does not automatically add a valid from address, causing WebFaction's servers to reject the message.

Cron now supports a MAILFROM in addition to a MAILTO. By adding a valid address as MAILFROM, it started working.

MAILTO=address@example.com
MAILFROM=address@example.com
permanent link

answered 29 Jan '12, 03:49

Hoboes
2826
accept rate: 25%

edited 29 Jan '12, 09:15

seanf
12.2k41836

Hi, Thanks for posting this answer. In fact, the default From address for cron is invalid on our CentOS6 servers, so we will be fixing this in the near future.

(29 Jan '12, 03:57) todork

MAILFROM is still needed.

(28 Aug '12, 16:44) doug

Thanks, adding MAILFROM resolved the issue for me!

(25 Oct '12, 00:01) mrooney
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×261
×81
×69
×50
×7

question asked: 06 Jun '11, 20:25

question was seen: 16,058 times

last updated: 26 Dec '12, 13:16

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM