![]() |
shell "mail" (NOT "Mail") -- & Python & PHP, etc.
:( OK, I have been, indirectly, chasing this issue for months, if not years. As far as I can see, most scripting languages (even non-scripting ones) send e-mails via the same low level mail facility and thus, indirectly, shell 'mail' -- certainly I have always been stuck getting the languages and the shell from e-mailing. Obviously the GUI based Mail.app works fine.
I program from home, on MY LAN, behind MY router, etc. My email is via an external ISP and e-mail via Apple (.Mac -- thus IMAP.) I have tried Postfix Enabler, but to no effect, regarding this shell 'mail' -- of course it allows my Postfix to work, for me to send via my 'localhost' (via Mail.app) BUT NO shell 'mail'. This is part of the shell 'mail' error message -- as I do get the failure bounces (to the 'mail' root or webmaster NOT Mail.app) as it happens: Code:
<dgringo.test@mac.com>: host smtp.mac.com[17.250.248.45] said: 553 5.1.0Here is hoping for assistance and or guidance. David Green. |
Quote:
Code:
xxxx:~ darrell$ mail xxxxx@telus.netIt worked. Here are the headers Code:
Return-Path: <darrell@xxxx.dyndns.org>I have a dyndns.org domain name (costs nothing, https://www.dyndns.com/services/pricing/#free)... I use DNSupdate to keep the IP address synced -- http://www.btree.org/dnsupdate/) My computer is set in its /etc/hostconfig file to that domain name using these instructions: > The fix for me was recommended by > another group: get a dyndns.org account and change the HOSTNAME line in > /etc/hostconfig from > > HOSTNAME=-AUTOMATIC- > > to > > HOSTNAME=montanaro.dyndns.org The postfix config has the 'smart host' set to my ISP's smtp server. In your case the mac.com smtp server is complaining it doesn't like the .local domain name. Cheers, Darrell |
In my experience, /usr/bin/mail usually works fine, assuming postfix/sendmail are running. What stops it these days is your service provider blocking outbound connections and mail servers rejecting messages that come from dynamic addresses and addresses with an invalid reverse lookup.
So, you might want to try configuring things to relay all mail through your ISP's server. Another possible speed bump is you didn't check your POP account within the previous 10 minutes but that's not all that difficult to script. |
hostconfig...
Darrell; Yes, I use dyndns too... I used to have my Mac update itself, i.e. the same as you, but since upgrading my router to a NETGEAR one (a long time ago), NETGEAR knows about dyndns and keeps my IP synced.
OK, we seem to be similar... although my /etc/hostconfig DOES NOT have a HOSTNAME=. Should I just, simply, add this directive in -- as your suggestion has the air of being proper ? My postfix settings seem to otherwise be as per yours; it complains about the .local on the perceived domain name. Thanks (getting excited about a possible fix/explanation), David |
Quote:
My recollection is the HOSTNAME=-AUTOMATIC- was dropped in the hostconfig file between Panther and Tiger. When I did a Tiger install on another machine I just added it in and it worked fine. See http://www.opendarwin.org/en/faq/ch02.html#hostconfig for more information. Your HOSTNAME will have to be what smtp.mac.com allows when it issues the command MAIL FROM. Cheers, Darrell |
Thanks for the opendarwin clues :)
Off hand, and assuming adding the HOSTNAME works, as I have multiple Macs within my Internet, can they all use my dyndns value as their HOSTNAME or should I take another route? |
Quote:
You appear to have a different configuration than I have. You are using a authenticating smtp server and it cares what is in the FROM header of emails. I am not using an authenticating smtp server and my server doesn't care what is in the FROM header. You are using NAT. I am not. How that will all play out, I'll be interested to hear :) See if the changing the hostname works first, would be my advice. It is a simple change and is easily reverted. You will need a restart for it to take full effect. Cheers, Darrell |
Sadly, I must ask How does one restart the mail system <embarrassed> ?
|
Quote:
Cheers, Darrell |
A Restart?? But this is why I use Macs NOT ******* PCs!!
Yeah, OK :) |
Quote:
1- my non-aliased email 2- "local recipient table" - possibly consider keeping this valid. Ponder, ponder -- why is doing development type work so obtuse (certainly if not from a Unix background) ? David |
Quote:
Have a look at your mail.log in Console, there may be more detail there. Here are the logs of an email from Eudora thru my localhost SMTP server to my relay host mail.telus.net. Eudora's setting for the SMTP server is 'localhost'. Postfix's smarthost or relayhost setting is mail.telus.net. Eudora's log Code:
Mon Apr 30 09:16:33 2007Code:
Darrell |
Points to make clear -- if they might help knowing about:
My local accounts (and administrator) on all my Macs is the same, BUT my email account on .Mac is the same PLUS a "1" ending; i.e. xxxx1@mac.com The postfix administrator is as per the local one. My SASL authentication uses, of course, the .Mac one (with the extra "1"). This is the current failure coming from "/var/log/mail.log": NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 <xxxx.info@mac.com>: Recipient address rejected: User unknown in local recipient table; from=<xxxx.test@mac.com> to=<xxxx.info@mac.com> proto=ESMTP helo=<[127.0.0.1]> It now fails with any .Mac account / alias. It has always appeared to be trouble at my end; either authentication or recognition, as it is now. Do you think my local / mail administrator must be xxx1@mac.com too, OR I should arrange for the Recipient table to be up to date and or correct, OR is there something more fundamental to correct? I seem to always get to within the faintest of it all working, but it fails. If you do not mind, can we confer more about how I can help you help me to diagnose this -- as you do seem to have good suggestions and knowledge ? David |
Quote:
If you have another SMTP server that will relay your email I would use that. (i.e., my ISP's SMTP server doesn't enforce address rules... it enforces source IP addresses for anti-spam. If your ISP has a similar SMTP server that you can use this would be the simplest solution.) If your ISP doesn't block port 25 then use postfix as a direct SMTP server to where you want to send mail. i.e., remove the postfix 'smarthost' entry. (my ISP blocks port 25 hence I must relay via their SMTP server) Quote:
I don't know what they are, but it would appear from the error log above it wants specific addresses. Code:
550 <xxxx.info@mac.com>: Recipient address rejected: User unknown in local recipient table(Obfuscating the email addresses in these postings, for our own very good 'anti-spamming' reasons, makes it more difficult to see what exactly is going on.) Cheers, Darrell p.s., responses from me will slow down, I'm on Galiano Island http://tinyurl.com/2ybjgr, with dialup access, for a couple of days. |
I thought the references to my "dgreen@" was the mail server incorrectly putting my local account (and the admin account) with "mac.com", the SMTP target -- i.e. my local accounts (Macs) are "dgreen" but I have to use "dgreen1", due to historical reasons, on .Mac. This, I presumed, was confusing the software.
And to confuse you, I set my "HOSTNAME=mac.com", thinking that would have helped. The xxx.info@ and xxx.test@ are valid aliases at the .Mac end, thus, to me, showing that the problem was still at my end and NOT .Mac. Bye-the-by, I have a hotmail, gmail and a couple other mail accounts. They are rarely used and, usually, have a different user name. I also presume that as I my ISP only gives me internet access (I never bothered to use it's SMTP), whereas, Apple gives me the email, that I must have an unblocked port 25 -- yes? (Re: obfuscation. I do not really take this anti-spamming seriously, but I felt it might look bad if /let it all hang out/. Is this making some sense to you? :) David PS. I did work for MS for awhile, near Seattle. :( |
Quote:
Quote:
Quote:
Quote:
Quote:
Your problem is that you are trying to use mac.com as a relay host. And it won't let you. Quote:
I manage my spam by 1. munging my email addresses, 2. incrementing my email addresses when they receive spam, 3. guarding my email addresses. At the moment I haven't had a spam in months. This is despite my email address being widely distributed by automated faq postings on Usenet and on a web site. (I have one never used email address that gets several hundred spams a month. It was exposed briefly on Usenet ten years ago) Cheers, Darrell |
(Security: Firstly, I vaguely try, BUT I do not wish my life to be messed up by EITHER spam OR overt efforts to avoid it; this is partially why I let .Mac handle my emails.)
As a developer, I do need the ability to email from the command line / shell of one or more of my Macs. Having removed any Postfix Enabler smart host and HOSTCONFIG= from the /etc/hostconfig file, rebooted and, finally, viewing my up to date mail log (/var/log/mail.log), it seems to show it all working -- i.e. from Mail (from @mac.com) and from mail (from @iMacAlone) -- except no actual email arrival from mail. Code:
May 1 11:20:31 iMacAlone postfix/smtpd[657]: disconnect from localhost[127.0.0.1]I guess this comes down to, maybe, additionally having a genuine mail server (a particular Mac + port forwarding to it). I have never explored the ideas of mail between my Macs and how this works with identical accounts... would I need to login to each Mac using a Intranet enabled/using account? Your thoughts please :) |
Yippee -- I did it (with your help :) )
I knew it must have been something incredibly fundamental! <beating himself over the head> I set my router to allowing SMTP through, I set up my HOSTNAME= to be my dyndns setting, Mail works, mail did not ... until I checked my gmail spam folder -- it was there!!! What say you Darrell, have I _finally_ got all the pieces working? David Green PS. It _was_ convoluted, and I failed to remember / track all the separate bits! |
The only thing which I would like to do, but is not necessary, is to figure out how I can get my incoming "mail" operational too -- a complete luxury I suppose.
|
you know, while we're on this topic, there's something I'm not clear on...
I'm not at all used to using shell mail, so pardon my ignorance, but what I'd like to be to do is grab some mail that I just downloaded through a GUI app (thuinderbird in this case, but let's go for the general answer), turn around, and delete it via shell from the server. this is an end run around TB's limited filtering capacity, so I can delete spam from the server immediately - saves me having to digest and recode thunderbird (god bless open source, but still...). can you demystify this process for me a bit? |
Quote:
|
Quote:
Quote:
If your ISP doesn't mess with port 25 you could set the equivalent up fairly easy. Cheers, Darrell |
Quote:
1. the osx mail program /usr/bin/mail, 2. the osx smtp mail server /usr/sbin/postfix, 3. and the pop mail server you are downloading your mail from (probably something like pop.yourisp.net). i.e., you can't do what you want to do. Cheers, Darrell |
Surly OS X should totally account for the mail i/o, but as I use British Telecom as my ISP, I better check them blocking 25 too.
|
Quote:
tell you what, let's trade - you teach me how to talk to unix, and I'll teach you how to talk to people. <heehehehehe> |
Quote:
Quote:
e.g., referring to my answer earlier, enter into Terminal 'man postfix' and 'man mail' Quote:
Cheers, Darrell |
Quote:
it seems to me the most important element in this kind of conversation is listening. usually the person asking the question has a clear visualization of what s/he wants to accomplish, but only a foggy understanding of the capabilities and limitations of the software. then it becomes a matter of piecing out what they see in their head and helping them find some way to implement it (if possible). that's hard in email, because a) many people don't express themselves as well in writing as they do in speech, and b) (as you pointed out) you lose all of the non-verbal cues that help you tune in to what they want - it has to be done entirely in words. for instance, what I want is to coerce my email application to remove junk mail from the pop server, but leave good mail up there for a while. Mail.app can be convinced to do it, sort of (though it has an annoying tendancy to re-download the last message on the server once for every piece of junk that's deleted). Thunderbird can't do it at all (though that issue has popped up on their development lists). I'm looking for loopholes. what I would have liked for an answer was a short explanation of why unix mail can't do what I want it to do. then I would have learned something, even if it didn't solve my problem. all you told me, though, was that I don't know anything about unix mail, which is something I already knew. or something like that... :confused: there's nothing helpful in mail man page (that I knew before I asked), but I'll check out the postfix man and see what it has to say. thanks for that tip. |
Quote:
Quote:
I was trying to say that I didn't think that Post Office Protocol 3 was capable of doing what you want. But you say you can get Mail.app to do it :confused: so I can't be of much help :) i.e., from http://www.ietf.org/rfc/rfc1939.txt "POP3 is not intended to provide extensive manipulation operations of mail on the server; normally, mail is downloaded and then deleted. A more advanced (and complex) protocol, IMAP4, is discussed in [RFC1730]." Cheers, Darrell |
Quote:
the problem is that it's buggy... it downloads extra copies of valid emails every time it deletes junk mail from the server. occasionally (randomly, as far as I can tell) it deletes all the old messages on the server. pain in the you-know-what... |
| All times are GMT -5. The time now is 05:51 AM. |
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.