Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: How to send mail by commandline

  1. #1
    Join Date
    Dec 2011
    Beans
    64

    How to send mail by commandline

    I have Ubuntu 12.10 with mailutils and postfix packages installed. I tried the following command line ==> mail -s "subject .... " name@domain.com but it fail to send out the mail where name@domain.com is my email address carried by google. Can anyone help with the complete installation & setup required for the mail command line to work on Ubuntu 12.10?

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: How to send mail by commandline

    Use "sudo more /var/log/mail.log" to see what errors might have occurred. You can also use "mail -v" to have the program display what it is doing as it tries to send the message.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Dec 2011
    Beans
    64

    Re: How to send mail by commandline

    Thanks for your feedback, I checked /var/log/mail.log and there is no such file on my system, and the -v suggest me to check help for valid options. Any idea what is going on here?

  4. #4
    Join Date
    Mar 2013
    Beans
    8

    Re: How to send mail by commandline

    It might be that your main.cf file has not been adjusted to send the log files

    How is your postfix server configured and what is the content of you main.cf file? You need to adjust your main.cf file to tell the program where to send error messages and returned email messages. In ubuntu 12.10, this file is in /usr/share/postfix. Once you adjust your config file, You can see your recorded log files with the verbose option.


    code:
    postfix -vc /usr/share/postfix/main.cf [command]
    Last edited by rich4421972; March 20th, 2013 at 02:35 AM.

  5. #5
    Join Date
    Dec 2011
    Beans
    64

    Re: How to send mail by commandline

    rich thanks for your help, in fact I didn't do any configuration for postfix and never used postfix, what I really need is to be able to send mail messages from command line so: 1. do I need postfix configured or mailutils can do it without postfix? 2. If I need to configure postfix beyond the 2-3 questions that were asked during the setup can you give me some directions or if it is simple the complete minimum set of details for such configuration. again, at this point I need to be able to send mail from command line as soon as possible and prefer a more robust setting later on.

  6. #6
    Join Date
    Mar 2013
    Beans
    8

    Re: How to send mail by commandline

    Have you thought about a more user-friendly system like Alpine? Unlike postfix, Alpine was made for those of us with less experience and does not require the hand-editing of configuration files (You configure the account settings from within the program). you can get alpine through the ubuntu ("universe") apt repositories, and, if you're online, there are easy to understand instructions at

    http://www.washington.edu/alpine/

    http://www.washington.edu/pine/tutorial.4/

    Alpine is the current version of the old University of Washington program, PiNE (Pine is Not Elm). It stands for something else these days. There are other mail clients out there, but alpine is considered to be "beginner-friendly" and I have always liked it, myself. I guess it makes sense that a program used in colleges would be somewhat easy to understand

    alpine is completely text-based but has menus and places where you can compose a message and send it. There is another easy to read HOWTO for alpine at

    https://howto.ccs.neu.edu/howto/mail...guring-alpine/

    There is also a mail client built into EMACS, but pine is much easier. I hope that some of this helps.

  7. #7
    Join Date
    Dec 2011
    Beans
    64

    Re: How to send mail by commandline

    rich, thanks again for the information, I will check alpine later. However I hope you can help with my immediate problem which is specifically to get the "mail" command to work, and I am not sure I even need to setup postfix or only some settings for mailutils. I appreciate any help or information regarding: 1. which packages I need to setup so "mail" command will work. 2. If possible get instructions on such settings. 3. Does alpine implement the "mail" command line? Thanks for your help.

  8. #8
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,485

    Re: How to send mail by commandline

    If you just want "send mail by commandline" like your subject says, and you have a default smart host (=SMTP server, from your ISP or Gmail for example), consider the CLI tool 'mailsend' from http://www.muquit.com/muquit/softwar.../mailsend.html

    Works for me.

    HTH

  9. #9
    Join Date
    Dec 2011
    Beans
    64

    Re: How to send mail by commandline

    Sanderj thanks for your feedback, I am specifically interested in making the MAIL command work any information regarding packages that are required or related settings will be helpful.

  10. #10
    Join Date
    Jan 2009
    Location
    ::1
    Beans
    2,485

    Re: How to send mail by commandline

    Quote Originally Posted by dvks View Post
    Sanderj thanks for your feedback, I am specifically interested in making the MAIL command work any information regarding packages that are required or related settings will be helpful.
    And what do you mean with "making the MAIL command work "? Send mail? Receive mail? Multiple users? Mail with outside world? Your own domain?

Page 1 of 3 123 LastLast

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
  •