The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   how to send mail? (http://hintsforums.macworld.com/showthread.php?t=88927)

wdympcf 04-28-2008 07:46 PM

Quote:

Sorry - I have no experience with this.
(I don't usually send mail from the command-line.)
Me either. However, it would appear that it is not that crucial to the OP that they be able to send mail from the Terminal....

mnewman 04-28-2008 09:54 PM

It's not easy to get postfix working. As noted above, your ISP may be blocking mail that you try to send. To get this working you will probably have to edit the postfix configuration file: /etc/postfix/main.cf

Here are the lines that I added or modified in my main.cf file:

Code:

unknown_local_recipient_reject_code=550
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
smtpd_sender_restrictions=check_sender_access hash:/etc/postfix/access
inet_interfaces=all
inet_protocols=all
message_size_limit=5000000
mailbox_size_limit=51200000
mynetworks_style=subnet
##myorigin=mydomain.com
myhostname=mydomain.com
relayhost=smtp.myisp.com
local_recipient_maps=
luser_relay=myshortname
smtp_generic_maps = hash:/etc/postfix/generic
virtual_alias_maps = hash:/etc/postfix/virtual

Oddly, sometimes I have to comment out the "relayhost" line. My ISP is inconsistent about how it treats mail originating from a dynamic IP address.

Here's what the mail.log looks like when mail has been sent successfully:

Code:

Apr 29 08:46:50 Smooch postfix/smtp[7241]: 7D99B8232F8: to=<me@mac.com>, relay=smtp.myisp.com[2xx.xxx.xxx.xxx]:25, delay=4.3, delays=0.32/0.08/3.6/0.33, dsn=2.0.0, status=sent (250 ok:  Message 140916886 accepted)
Good luck. Every time Apple does an OS/X update things change and I have to tweek postfix to get it working again.

As for why someone would want to send e-mail from the command line: I use it in shell scripts to notify me by e-mail when tasks have been done. For example, I have Carbon Copy Cloner send me e-mail when a backup has been done.


All times are GMT -5. The time now is 10:17 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.