Results 1 to 10 of 10

Thread: Route new email and erase current

  1. #1
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Route email to /dev/null

    I have a crontab that accesses a php script on my server. The cronjob emails the root account after every job. How can I route mail to root to /dev/null? I've found a few tutorials on forwarding to /dev/null but I can't seem to get them to work on my server...

    Thanks.
    Last edited by m3bik; May 6th, 2009 at 03:50 AM.

  2. #2
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    Sorry, it's not addressed to root@server it's addressed to user@server but it's the user I use as root...

  3. #3
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    Still no luck...

  4. #4
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    I've tried editing the alias file, /etc/aliases and added:

    user: /dev/null
    Restarted the server. The user account still gets mail...

  5. #5
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    I've tried creating a symlink from /var/mail/user to /dev/null and that still doesn't work! The server renames the symlink to something crazy and creates /var/mail/user again.

  6. #6
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Route new email and erase current

    To redirect stdout to /dev/null, you append this to the end of your crontab command:
    Code:
    > /dev/null
    To send both stdout and stderr to /dev/null, you would use this:
    Code:
    > /dev/null &> /dev/null
    Dr Small
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  7. #7
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    I've added that, and I still get an email...
    Last edited by m3bik; May 6th, 2009 at 04:30 AM.

  8. #8
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Route new email and erase current

    Quote Originally Posted by m3bik View Post
    You come in and make it soo easy.... Thanks!!
    So, did that solve your problem?
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  9. #9
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    Quote Originally Posted by Dr Small View Post
    So, did that solve your problem?
    No, that response was premature... My bad. I still get emails sent to the user account after every cronjob...

  10. #10
    Join Date
    Mar 2009
    Beans
    70
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Route new email and erase current

    I've started a new topic as my plan to fix this has changed...

    See - http://ubuntuforums.org/showthread.php?p=7223188

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •