![]() |
Email from the Command Line for the Compleat Idiot
I gather from my copy of MacOS X Unleashed that I can compose and send mail from the command line, bypassing my ISP altogether?
OK, I type mail ahunter3@myISP.com, {return}; Terminal asks for Subject: so I type in a subject {return}. I type stuff. Body of email. Now what? I do "man mail" and my reading of what it says is that I do a hard return to a new blank line and then Ctrl-D and out it goes. I repeat above-described process and then add the bit about new line and Ctrl-D. Regular email program (which obtains mail from the account to which I addressed the command-line email) doesn't fetch any such mail. Is there something else that the man pages and the big thick book both sort of glossed over here? Or does this instead perhaps have something to do with the "sendmail" bug that folks have mentioned? |
could very well be that your lack of receiving the email is a result of the new sendmail config.
examine: % mailq -v and % tail -50 /var/log/mail.log |
Compleat?
Compleat idiot huh? hmm....I thought it was "complete"....;)
|
ok ok, lets see if I can help...
If you have sendmail configured than all you have to do is:
% mail somebody@somewhere.com <-- Address of recipient (return) Subject: I'm sending mail from the Terminal! <--enter a subject (return) \/ Type a message isn't this cool? some guy named pyrohotdog showed me how to do this! (return to empty line) ^D (control D) Then it should say "EOT" and give you a new % prompt If you don't have sendmail setup then read one of the many forums about it or check out this site it should help, it worked for me :D |
Thanks, pyro!
OK, went to that page, grabbed & printed the instrux, modified the files, changed the permissions, rebooted, & gave it a whirl. Still no email being received at the address to which it is being "sent". I note that, regarding "hostname", the instrux say: Quote:
|
Basically its difficult because of your ignorance of DNS, registrars, and sendmail. Buy the O'reilly books, study the pages that basically show you how to configure dns for sendmail, read linux sendmail docs, etc... then come back and ask more specific questions. You will have to set up a DNS server and get a true IP (means buying 8 IPs on a subnet form your ISP), make sure reverse DNS is configurable as well, oh, **** it.... ---- nevermind, you wouldnt understand.
|
hunter, you need to examine your mail log to determine why sendmaill is choking.
% more /var/log/mail.log |
Quote:
|
If I knew how to ask more specific questions I'd probably be a lot closer to knowing how to answer them. At least the implicit ones like "Is there something I need to put for hostname, or a change I need to make to address this '10.0.5 sendmail bug' I keep hearing about, or does this DNS thing mean I should just forget about implementing sendmail, since I have ISPs that will send it for me, and try some other Unix functions instead?"
::checks forum description label again:: I'm a Unix newbie with a Mac attitude. I'm willing to spend some time reading a manual if it's something I want badly enough to crack a manual, but I like the water I land in to be below nose level when I do. Good instructions: Quote:
Quote:
Quote:
|
AKcrab,
Well said!. taikahn, If everybody knew about everything there will be no need for a newbie forum. AHunter3, Don't worry, it's okey not to know about a subject. Myself, I don't know things most of the time. Cheers... |
hostconfig
What is the problem now AHunter3? You can't receive the mail you sent? Can other people get it?
Remember, you have to have edit you /etc/hostconfig file and change MAILSERVER=-NO- to MAILSERVER=-YES- I don't think you have to have a hostname, it will just send from the address shortnam@localhost or something similar. if you want a hostname try % sudo hostname some_name and/or edit your /etc/hosts file I managed to get my DNS and sendmail working from our home LAN where every machine is "192.168.0.x" I fixed myself an IP and DNS, so I'm sure you can get that all worked out...... |
pyro, thanks for your patience and encouragement.
I have done the following: • edited hostconfig, changing MAILSERVER=-NO-" to "-YES-" • changed hostname from "-AUTOMATIC-" to "LOCALHOST_AHUNTER" • changed privileges on the var folder so that the admin group (which is me, on this computer) has read and write privs • changed the line in /System/Library/StartupItems/Sendmail, where it read "/usr/sbin/sendmail -bd -q1h" to all of that plus a space and an ampersand at the end • edited StartupParameters.plist for sendmail replacing "Preference" with "OrderPreference". These changes were delineated in the instruction page to which you sent me. Having done that (and rebooted), I opened a Terminal window and typed: mail <myregularISPbasedemailaddress> {return} Terminal replies: Subject? I type: "testing" {return} I type some text to be the body of the email and hit return again. I do Control-D. I do not get any error messages. I am returned to my % prompt. I launch Eudora and let it check incoming mail. Over the course of the rest of the day, I get other email but nothing titled "testing". My current TCP connection is via DHCP here at work. If I were using Eudora to send outbound email, I would connect to an SMTP server at uunet which is what we use here. Don't know if any portion of this is relevant. |
Did you use merv's suggestion of looking in the log? In the terminal:
Code:
% more /var/log/mail.log |
whether my attitude sucks or not, you are all leading him on a wild goose chase... no amount of configuring his machine alone is going to get him a fully qualified SMTP server with forward and backward DNS that people can reply to and have it get to him. That requires a DNS server that is a registered Name Server with a registrar. It also requires configuration of said DNS server to match his particular networking environment. He could, of course, possibly get his ISP to do some of that, thereby making it possible.
|
AKCrab, yeah, not that I comprehend it much:
Quote:
|
it says the "localhost" (thats your machine) denied the connection... probably because of sendmails conf. Hence, my suggestion to read the sendmail book by oreilly. Sendmail is a beast.
|
Quote:
|
sending without receiving is childs play :)
|
taikahn:
Quote:
I figured that once I got it to the point that I could send using sendmail to my regular account, I could figure out (=ask for help) how to set up a Reply-To header so that when folks replied to it it would go back to my regular ISP-based email account. Aside from that, to a major extent I'm just playing with it. Learning Unix things. I don't mind being told "Don't go there. Do something simpler". The objective at this point, though, is simply: send email from the command line and have it received at the email address to which I send it, not using a 3rd party SMTP server to do the sending work. I may rarely make use of it in real life, but if I learn how to do that now I'm on the way to knowing how to do it on a more formidable / more useful level in the event that I get a static IP and a DNS name some day, yes? If nothing else, it gets me past practicing "ls" and "mv" and "cd"... |
Just to confuse the issue some more...
Actually, I hope this makes the issue clearer in the sense that I don't think that much needs to be done to make it work.
I have been able to use the mailing feature you describe with a nearly 'out-of-the-box' set-up. I have not edited 'hostconfig' at all (MailServer is still set to 'No'). I *believe* I was able to do this before the 10.1.5 update (at which point all I had done was to set the permissions on '/etc/mail/' as recommended by mervtormel and others**). However, I can attest that I have sent such mail from the terminal since the 10.1.5 update because I just did so this week sometime. Since the 10.1.5 update (and before I sent a successful email of this variety) I have only done what Chris Stone at the O'Reilly network said to do to get sendmail working again after the 10.1.5 update: http://www.macdevcenter.com/pub/a/ma...mail_1015.html). This includes adding the line about 'DontBlameSendmail' so that I would no longer have to set permissions after an Apple update, but does not include changing MailServer=-No- to -Yes-. I hope this helps. **I had also edited the 'local-host-names' and 'trusted-users' to include my user name, but I can't imagine that that was necessary for this type of (nonlocal) mail. |
| All times are GMT -5. The time now is 10:22 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.