VGM
VGM

Reputation: 69

Emails sent from a cronjob to a local mailbox

I have some cronjobs. These cronjobs send emails but I dont want to disable them with (>/dev/null 2>&1). I would like to know how can I deliver these emails to a local mailbox? Server doesnt accept connections from outside. So the port 25 is open only on localhost/127.0.0.1.

A solution to create an alias such as root: user@localhost is ok ? Any ideas?

Thank you!

Upvotes: 0

Views: 806

Answers (1)

asjo
asjo

Reputation: 3194

Using an alias is one soluton, another is to add a line before the cronjobs you want to send email somewhere else saying:

MAILTO=localuseryouwantemailtogoto

Check out man 5 crontab for the full details.

Upvotes: 1

Related Questions