|
|
#1 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
Mail!... in Terminal?
So... I'm poking around in the forums this evening, when I come across an interesting thing. I launch the Terminal to type the thing I came across, and notice that the welcome bit at the top is different... it says "You have new mail."
How'd that happen?! I've never used the Terminal to access or send any mail. I have, however recently configured httpd an other server-related files while setting up PHP, MySQL, and virtualhosts... I'm assuming the server is mailing me something? How do I retrieve this message?
__________________
..:: Zeb ::.. |
|
|
|
|
|
#2 |
|
Major Leaguer
Join Date: Feb 2003
Posts: 263
|
Can you post the results of:
cat /etc/motd and biff |
|
|
|
|
|
#3 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
Here it is:
Code:
Last login: Wed May 28 23:28:01 on ttyp1 Welcome to Darwin! You have new mail. [Macintosh:~] zeb% cat /etc/motd Welcome to Darwin! [Macintosh:~] zeb% biff is n [Macintosh:~] zeb%
__________________
..:: Zeb ::.. |
|
|
|
|
|
#4 |
|
Major Leaguer
Join Date: Feb 2003
Location: Berkeley, CA
Posts: 270
|
Try typing "mail" on the Terminal. It's probably just log or error files that have been "emailed" to your user account.
I believe this mail system is all legacy Unix stuff, left over from the good ol' days of command line stuff, but I'm not too familiar with how it works. Perhaps somebody more knowledgable could chime in? Last edited by grrl_geek; 05-29-2003 at 02:43 AM. |
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
AH Neat! A miniature little mail program!
Yes, it appears that while I was stuck in "vi" trying to figure out how to get out, I finally managed to escape but severed the vi process. The mail was informing me that I could recover this file that I screwed up (luckily I typed the file name wrong, so vi created a blank one!) ... mail ... who'da thought to type that in... And the type ? for help right up on the front line... what a great thing!... Unlike vi!![]() So, aixccapt99, what were you up to with the biff thing?
__________________
..:: Zeb ::.. |
|
|
|
|
|
#6 | |||||||||||||||||||
|
MVP
Join Date: Jan 2002
Location: Wasilla, AK
Posts: 1,043
|
Learn to love vi. It's your friend.
|
|||||||||||||||||||
|
|
|
|
|
#7 | |||||||||||||||||||
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
I've already gotten a bit friendly with pico, do you think vi will mind?
__________________
..:: Zeb ::.. |
|||||||||||||||||||
|
|
|
|
|
#8 |
|
Major Leaguer
Join Date: Feb 2003
Posts: 263
|
biff controls a setting that notifies you when new mail arrives.
man biff for the details, it's pretty simple. Joe |
|
|
|
|
|
#9 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
So, how do I send mail to this account? (...not using this "mail" utility, but from a regular email client...)
__________________
..:: Zeb ::.. Last edited by zeb; 05-29-2003 at 03:45 AM. |
|
|
|
|
|
#10 |
|
Major Leaguer
Join Date: Feb 2003
Posts: 263
|
You mean from your local machine? Or from the internet?
From the internet, you'd need to run sendmail or one of its replacements. That delivers mail to the users on the machine it's running on. I think that's the only way you'd get this to work with a GUI mail client, since they expect to send mail off to the 'net. Locally only, look at man mail which tells you how to send. Basically it's mail username then type the message into the terminal then terminate with ctrl-D at the beginning of a new line. The system (not root) crontab is actually supposed to mail root it's daily/weekly/monthly script output: sh /etc/daily 2>&1 | tee /var/ log/daily.out | mail -s "`hostname` daily output" root Of course, the root user has a .forward file (I assume mail consults this; it's at /var/root/.forward) which passes the mail off to /dev/null |
|
|
|
|
|
#11 | ||||||||||||||||||||||||||||||||||||||
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
I mean from my local machine through Entourage. I'm confused by what you said:
I'm not sure what you mean here... At first, it sounds like you are describing sending mail to my user on my machine from a different location via the internet. Then you say "...delivers mail to the users on the machine it's running on..." which sound like you are describing sending mail to my user on my machine from my machine (which is what I would like to do). Regardless of what you meant, let me try to explain what I would like to do: Lets call the email address that the original error message was mailed to user@localhost (if you know exactly what it would be called, I'd like to know). I would like to be able to use Entourage on my machine to send a message to my user@localhost; and, if possible I would like to have Entourage be able to pick up messages sent to user@localhost. I know it sounds useless, but the former part would function as a way to test the latter. So, if I understand what you meant, I would need to configure sendmail to somehow look out for messages going to user@localhost, and send them there instead of sending them off to the internet... and I guess I would need to set Entourage to use the appropriate POP and SMPT servers to send mail to user@localhost and check the user@localhost account for new mail. How can this be done? (If this can be done...)
__________________
..:: Zeb ::.. |
||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
#12 |
|
Major Leaguer
Join Date: Jan 2002
Location: Edinburgh, Scotland
Posts: 437
|
let's say I want to send mail from my terminal to Nick, who's through in the other room at his PC, but has an account on my G4.
I go to the terminal, type in Code:
% mail nick Once I've entered a subject, I can type in my message. To finish the mail, I type a period [.] on a single line, then hit [enter]. Next time Nick SSHs into my machine, he'll see a note saying Code:
You have new mail. Code:
Now that's fine and dandy, and I think it's kind of the first thing you were getting at. Using Entourage for this gets tricky, however. While terminal "mail" can send mail to local accounts, Entourage has to send mail via SMTP (afaik - please correct!). Think of it like an office - if you send stuff via internal mail, you don't need a stamp, and you can just whack the person's name and dept. on the envelope and it will get there. If you need to mail someone outside the office, you need a stamp, a postal code, and a formal method of addressing etc. Now Entourage is kind of like a visitor to your office. Just because they are in the office, it doesn't mean they can necessarity use your internal mail. They'd probably still have to address and stamp an envelope and send it via external mail. Well, they would if your boss was particularly tight with internal mail ![]() Anyway, now we get to sendmail. Sendmail is kind of like your mailroom. If you've only got a one room office, you don't need a mailroom to deal with internal mail - you can just pass notes to each other. However, if you want to take mail in from or send mail out to the outside world, chances are you'll need a room to sort it all, check it's stamped (and stamp it if it's not), take in mail that's been delivered, separate it to make sure it goes to the right place etc etc etc. So that's sendmail. As for HOW to send mail via entourage, the problem is that I've got sendmail installed, so I'm not sure if it's possible without it. If I fire up a new message in Mail.app and type in "nick" as the "to" address, then specify my local IP as the SMTP host address, the mail gets there in the terminal. As I said, I think you'd need to have sendmail configured, otherwise your local IP won't be accepted as an SMTP host. Hope this helps?!??!? |
|
|
|
|
|
#13 |
|
Triple-A Player
Join Date: Nov 2002
Location: Frankfurt, Germany
Posts: 167
|
zeb, excuse my if I intrude into your thread, but JayBee's last post was fascinating. There's a utility "qmail" (available, e.g., at http://au.gu.st) that will allow you to replace your run-of-the-mill smpt server with a tweaked version of your local sendmail (if I unserstand correctly). It works with Apple's Mail, but I couldn't make Entourage accept this new "server." Any ideas on this?
|
|
|
|
|
|
#14 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
JayBee - I do have sendmail up and running, I thinks it's just a matter of configuring it properly... which I really don't know how to do. I set up sendmail when I was setting up MySQL. I have followed the O'Reilly instructions for editing one of the source file for sendmail.cf, and I know it says not to edit the sendmail.cf file... but there is lots of things in it that seem like what I am looking for... for example (starting on line 269ish):
Code:
# SMTP daemon options O DaemonPortOptions=Name=MTA O DaemonPortOptions=Port=587, Name=MSA, M=E # SMTP client options #O ClientPortOptions=Family=inet, Address=0.0.0.0 If configuring sendmail properly would allow mail to be sent between Entourage and the local user account, then I would just need to set up an account in Entourage that looked something like this: e-mail address: zeb@localhost -or- zeb@127.0.0.1 Account ID: zeb@localhost -or- zeb@127.0.0.1 -or- zeb POP server: localhost -or 127.0.0.1 -or- sendmail password: ******** -or- ****** -or- ********** ![]() SMTP server: localhost -or 127.0.0.1 -or- sendmail -or- mail.sendmail.receivemail.localhost.127.0.0.1.dontGoToTheOutsideWorld.becauseImNotevenConnected.local Wouldn't that work? Anyone particularly proficient with configuring sendmail?
__________________
..:: Zeb ::.. |
|
|
|
|
|
#15 |
|
All Star
Join Date: Feb 2003
Location: Chico, CA
Posts: 686
|
zeb-
You've got the basic idea. I've been trying to sort through all this myself, and it can be done. However, I'm using exim for my smtp server/MTA (mail transfer agent) and Mail.app for my email client, so your setup with sendmail and Entourage will differ in the specific configuration options needed. As I understand it, a basic unix email environment creates a separate mbox (mailbox) file for each user of the machine at /var/mail/username. The mbox file "username" is where that user's "local" mail goes. To send mail to this mailbox from your local email client, you need an smtp server listening to port 25 (sendmail, exim, qmail, postfix, or whatever) and configured correctly to deal with mail to "user@localhost". In Mail.app I simply set my smtp server to '127.0.0.1", which just tells it to send the mail to the smtp server on computer I'm on. When the mail is sent, exim (or sendmail or whatever) will receive the mail on port 25 and route "user@localhost" to the correct "/var/mail/username" mailbox, again assuming you've configured the MTA correctly (VERY important step). You should then get a "You have new mail" message when you start terminal with biff running, and you can check it there as well (I'd suggest you look into mutt as a terminal email client - very nice). As far as getting Entourage to read the local mail, you should be always be able to install a pop or imap server to allow Entourage (or any client) to check the local account. I don't use Entourage, but if it works with mbox format directly and you can point it to the /var/mail/username file, you may not need a pop or imap server. If you do need the server, I'd suggest qpopper, because it's simple to set up, but you can try an imap server if you're more adventurous. Basically qpopper listens on port 110 for mail requests. Again, in Mail.app I just set the pop server to "127.0.0.1" and the account name to my user name, and Mail will request for new mail to be delivered from the local mailbox. Note that this works just like checking mail on your ISP's server: if your client is configured to delete the mail from the server, it will be removed from /var/mail/username once Entourage has checked the mail. Getting all this to work with real mail to and from the rest of the world is an entirely different beast, because DNS becomes very important. So it can be done. Got all this working for my system after a lot of experimentation and mistakes (I'm new to unix). It's a long way between point A and point B! Hope this helps a bit. Brad |
|
|
|
|
|
#16 | |||||||||||||||||||
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
Yes, a VERY important step... well, I don't use Mail.app, but I did just setup an account with it to send mail to zeb@localhost, and set the SMTP to 127.0.0.1... and I got an error that "The Server '127.0.0.1' refused to allow a connection on port 25." Which means that I don't have sendmail configured to listen to port 25. That would be the first step. The second step, as you suggest would be to configure send mail to deal with user@localhost. Let's get these two steps outta the way first. Does anyone know how to configure sendmail to listen to port 25 and deal with mail to username@localhost?
__________________
..:: Zeb ::.. |
|||||||||||||||||||
|
|
|
|
|
#17 |
|
All Star
Join Date: Feb 2003
Location: Chico, CA
Posts: 686
|
Hmm, this is frustrating; I can give you a few pointers, but no specifics, since you're working with different software.
For exim, you need to kick it into daemon mode to monitor port 25; "exim -bd" in the terminal does the trick. Without this step, I get the "connection refused" error message you mention. From the sendmail man pages, I gather this may work for sendmail also (type "man sendmail" in terminal), ie "sendmail -bd". As far as "user@localhost, you may need to do nothing special. Exim is peculiar, as I understand it, in not automatically recognizing "localhost" as the local domain; I have to explicitly tell exim that "localhost" is local! You might not encounter this with sendmail. In which case, you're in good shape! Brad |
|
|
|
|
|
#18 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 457
|
jbc - this is getting a bit off subject from the original question, so I'm going to start a new thread so that it gets some more visibility...
thread continuation: configuring sendmail to listen to port 25, etc... (in the UNIX - newcomers forum) ... Shingle Springs huh? I'm just over the hills in Grass Valley... at least for now.
__________________
..:: Zeb ::.. |
|
|
|
![]() |
|
|