zoukankan      html  css  js  c++  java
  • Ubuntu: Sending command line mail

    Ubuntu: Sending command line mail

    Ubuntu: Sending command line mail

    quietearth [General News 09.25.06]
    Tweet
    Share on Google+


    I needed to send email from the command line, specifically for cron jobs, and there are many programs which can do this. I'm going to use the gnu mailutils package so first off let's install the mailutils package:
    # apt-get install mailutils

    This will add a few extra packages, then bring us up into an exim4 configuration screen. My systems are behind a dsl router, and I'm not going to route the mail through any relay host, I just want everything sent direct (for some sendmail agents this might cause problems, but you'll have to look at your logfiles). In the exim4 config screen I pick "internet site... mail is sent and receieved directly using SMTP". On edgy you might have to answer a few more questions, but I had to run a dpkg-reconfigure.

    Click here to find out more!

    At this point we have exim4 listening on port 25 and I don't need that, so I need to stop the daemon and remove the startup links:
    # /etc/init.d/exim4 stop
    # update-rc.d -f exim4 remove

    The update-rc.d command removes inits startup/shutdown links, but unfortunately if the exim4 packages get updated the links will be back so we need to run that command again.

    Now lets try sending a test mail:
    # echo testing | mail -s Bla myemail@somewhere.com

    and take a look at /var/log/exim4/mainlog. You should be good to go!

    Tested under dapper and edgy.
  • 相关阅读:
    [转]基于S2SH框架的项目—antlr-2.7.2.jar包冲突问题
    输入法那没有小键盘的图标解决方法
    Chrome百度不显示中文字体
    转:数据库范式(1NF 2NF 3NF BCNF)
    转:海明纠错码
    奇阶魔方阵
    字符串的模式匹配
    红黑树
    排序算法总结
    关于面试总结9-接口测试面试题
  • 原文地址:https://www.cnblogs.com/lexus/p/2859077.html
Copyright © 2011-2022 走看看