 |
 |
mac os x 10.5 postfix usr/sbin/sendmail error
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
HI,
I have set up postfix on my Mac. I am able to start postfix via terminal. but when I try to send mail I get this output from terminal:
mail -s "Test" jrodrigo@localhost.com
.
EOT
mail: /usr/sbin/sendmail: No such file or directory
    
I have my php.ini sendmail path set to usr/sbin/sendmail with the default -t -i as I read on many tutorials. Which I don't understand because my Mac os x 10.5 (Leopard) Doesn't have that directory. I would greatly appreciate it if someone could help me out on this. Thank you in advanced.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
What are you trying to do exactly? You don't have to invoke your MTA from PHP, you can use the built-in php mail() function without any PHP configuration.
There are many important things to consider when mailing via either technique:
- if you are sending messages in large quantities do not simply run through a loop invoking mail() each iteration through the loop, as this opens up a ton of connections and many of these may be refused, and your messages aren't queued this way so the failure will be silent. Passing these send requests off to your MTA like you are trying to do will help prevent this since your MTA will queue, although you still don't want a brainless loop
- make sure that it is sent with a returnable address so that you can receive bounces sent back to your address. If you don't have a returnable address your messages and will likely eventually be treated as spam and your IP blacklisted
- in order to help prevent the latter from happening, having a PTR/reverse DNS entry for your IP that matches the machine's hostname will help a great deal
Probably more than you were looking for, but there ya go!
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
HI,
This is what I want to do:
<?php
$to = "jrodrigo@localhost.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "jrodrigo@localhost.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
if (@mail($to, $subject, $message)) {
echo('<p>Mail sent successfully.</p>');
} else {
echo('<p>Mail could not be sent.</p>');
}
?>
but when I open the php file in my browser I recieve Mail could not be sent. I can't figure out how to fix this. Maybe you have already provided an answer for me, it's just that I read your post and I think it's too advanced for me, I wouldn't know what to open, or what commands to type in terminal to create the reverse lookups to my ip and the other suggestions you made. Thank you for your posts.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
What do you get when you turn PHP's display_errors on so that error messages are output to your browser (you can also get these from your web server's error logs, if you have access to those)? Have you undone your PHP configuration changes? The stock configuration should work with the mail() function, which is what you are using.
It is possible that the receiving SMTP server is refusing connections from your IP. What is the domain? What is the MX for this domain? Are you able to do a:
telnet <domain> 25?
Not to be a jerk, but if this stuff is over your head, maybe you ought to explore other ways to do whatever it is you are doing? The last thing you want is some script you don't understand mailing away in a fashion you can't account for, especially if this web page invoking this script will be made public. You need to understand this stuff.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
thanks again,
and your probably right, I wanted to get a better understanding of postfix, but I'll probably go another route. but for whatever it's worth yes I am able to do a telnet like this:
LEAPORD-2:~ jrodrigo$ telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 LEAPORD-2.local ESMTP Postfix
mail from: jrodrigo@localhost
250 2.1.0 Ok
rcpt to: jrodrigo@localhost
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
testing today.
.
250 2.0.0 Ok: queued as 06DA0193557
quit
221 2.0.0 Bye
Connection closed by foreign host.
LEAPORD-2:~ jrodrigo$
then when I check my email in /usr/bin/mail I receive my local emails just fine. I did try to send an email to my yahoo mail just to test but i receive this in my mail box:
Last login: Sun Apr 26 00:33:07 on ttys001
You have mail.
/usr/bin/mail ; exit;
LEAPORD-2:~ jrodrigo$ /usr/bin/mail ; exit;
Mail version 8.1 6/6/93. Type ? for help.
"/var/mail/jrodrigo": 2 messages 1 new 2 unread
U 1 MAILER-DAEMON@LEAPOR Sun Apr 26 00:30 74/2596 "Undelivered Mail Retu"
>N 2 jrodrigo@localhost Sun Apr 26 00:35 14/552
?
thank you for your advise though, I do appreciate it.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Does the hostname of your computer start with the word "leapor"? If so, you are trying to send mail to Yahoo with the envelope address set to you@yourhostname.local, which will not work because yourhostname.local is not a deliverable address. You are going to have to set your hostname variable in Postfix to a deliverable domain name, and this will have to match the PTR address for your IP. Unless you own your IP space (your WAN IP address, that is, not the IP set by your router), in short you are always going to have difficulty sending mail to machines outside of your local network.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
Okay,
Thank you very much Besson3c for all your help and your patience. I changed my hostname from localhost to rodrigo7x.dyndns.org (my dns). then I tried to telnet into localhost 25 and then my dyndns.org 25 and got connection refused (which I expected since I haven't set a ptr). Well, I see that in order for this to work I have to call my ISP to set me up with a PTR for my dns or contact my dns provider and buy their mail package.
Besson3c, if you could answer this last question I would greatly appreciate it. Mailserv for Mac is a postfix enabler that claims to have set up the mail server quickly and easy. But since I don't have a PTR set up even if I get the Mailserv program it still won't let me send email from my lan to yahoo, correct?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
The lack of a PTR record is not going to cause connection refused messages, it is going to cause you being on spam blacklists. If you can't connect to port 25 using a remote interface, either Postfix is not listening on this interface (i.e. is only listening on 127.0.0.1), or your firewall is not open to accept connections. Are you behind a router?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
with this configuration in main.cf:
# Minimum Postfix-specific configurations
mydomain_fallback = localhost
relayhost=smtp.gmail.com:587
mydomain=dumdms.org
myhostname=rodirgo7x.dyndns.org
# Enable SASL authentication in the Postfix SMTP client.
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options=
# Enable Transport Layer Security (TLS), i.e. SSL.
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source=dev:/dev/urandom
inet_interfaces = all
inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = smtp.gmail.com
#sendmail_path = /usr/bin/mail
smtp_enforce_tls = yes
smtp_sasl_tls_security_options =
smtp_sasl_tls_verified_security_options =
smtp_tls_loglevel = 2
# optional if you wan to see what's going on with the TLS negotiation in /var/log/mail.log
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_passwords
smtp_tls_per_site = hash:/etc/postfix/smtp_tls_sites
tls_random_source = dev:/dev/urandom
mail_owner = _postfix
-------------------------------------------
When I type these commands in terminal I get:
h-3.2# netstat -t -a | grep LISTEN
tcp4 0 0 *.ipp *.* LISTEN
tcp6 0 0 *.ipp *.* LISTEN
tcp4 0 0 localhost.postgresql *.* LISTEN
tcp6 0 0 localhost.postgres *.* LISTEN
tcp6 0 0 localhost.postgres *.* LISTEN
tcp4 0 0 localhost.privoxy *.* LISTEN
tcp4 0 0 localhost.mysql *.* LISTEN
tcp4 0 0 *.globe *.* LISTEN
tcp46 0 0 *.http *.* LISTEN
tcp4 0 0 *.microsoft-ds *.* LISTEN
tcp4 0 0 *.netbios-ssn *.* LISTEN
tcp4 0 0 *.afpovertcp *.* LISTEN
tcp6 0 0 *.afpovert *.* LISTEN
tcp4 0 0 localhost.ipp *.* LISTEN
tcp6 0 0 localhost.ipp *.* LISTEN
tcp4 0 0 *.printer *.* LISTEN
tcp6 0 0 *.printer *.* LISTEN
sh-3.2# lsof -i tcp:25
nothing happens. So Yes my mac is not listening on port 25. and with the above configuration I can't even start postfix:
sh-3.2# postfix start
postfix: fatal: parameter inet_interfaces: no local interface found for 209.85.133.109
But if I make these change the main.cf to this then I can listen on port 25 and start postfix (howbeit with lots of warnings):
# Minimum Postfix-specific configurations
mydomain_fallback = localhost
relayhost=smtp.gmail.com:587
mydomain=localhost
myhostname=localhost.com
inet_interfaces = all
inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = localhost
sh-3.2# postfix start
postfix/postfix-script: warning: not owned by root: /etc/postfix/main.cf
postfix/postfix-script: warning: not owned by root: /etc/postfix/master.cf
postfix/postfix-script: warning: not owned by root: /etc/postfix/smtp_sasl_passwords
postfix/postfix-script: warning: not owned by root: /etc/postfix/smtp_sasl_passwords.db
postfix/postfix-script: warning: not owned by root: /etc/postfix/smtp_tls_sites
postfix/postfix-script: warning: not owned by root: /etc/postfix/smtp_tls_sites.db
postfix/postfix-script: warning: group or other writable: /etc/postfix/./.DS_Store
postfix/postfix-script: warning: group or other writable: /etc/postfix/./access
postfix/postfix-script: warning: group or other writable: /etc/postfix/./main.cf
postfix/postfix-script: warning: group or other writable: /etc/postfix/./main.cf~
postfix/postfix-script: warning: group or other writable: /etc/postfix/./master.cf
postfix/postfix-script: starting the Postfix mail system
sh-3.2# netstat -t -a | grep LISTEN
tcp4 0 0 localhost.smtp *.* LISTEN
tcp4 0 0 *.ipp *.* LISTEN
......
sh-3.2# lsof -i tcp:25
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
master 2825 root 11u IPv4 0x67a8a68 0t0 TCP localhost:smtp (LISTEN)
sh-3.2#
and yes I am behind a router. Actually I have a verizon modem (which I configured to be a bridge and just forward traffic to my belkin wireless router). My belkin also has virtual ports configured so that smtp 25 is open to Mac. However, even when my main.cf is configured to localhost and nestat says I am listening on port 25, when I go to check my ports website, it says "connection refused, could not see you on port 25".
Thanks again.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
I don't mean to sound like a jerk, but again, it looks like you are looking for shortcuts here to problems you don't really understand. The fact that you are trying to use Google as a relayhost on the port typically reserved for authenticated SSL connections (when you don't have permission to do so) is a clear indication of this.
Like I said, you are not going to be able to do what you want to do without owning your IP space. The furthest you'll get is being able to send messages successfully, but most commercial SMTP servers will reject your messages anyway. If you'd like help getting that far, I can try to help, but I'd really rather not just give you the configuration you need without you understanding what you are doing.
I'm sorry if this sounds dickish, I'm in a little bit of a mood.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
Thanks, I really appreciate that you are willing to help me understand. I kept on reading about authentication and I went this far:
I am able to send emails out from my mac to my gmail account (basically I tried to set it up so that I would be emailing myself, just as if I was using Mac Mail client and emailing myself at my gmail account). However, the emails end up in the sent folder and look like this:
from meatgmail@gmail.com
to
date Tue, Apr 28, 2009 at 11:18 PM
subject generic db posted
mailed-by gmail.com
One time I made a typo on my rcpt to: wrong gmail address and it actually appeared in my gmail inbox as undelivered because user account was not found at gmail.com.
But, I will leave that alone, as you said, I need to understand this better in my local network. I actually have been trying to get this to work on a windows environment as well. There, I install the communiGate mail server since xp doesn't have a MTA like postfix. the user account there is postmaster@rodrigo7x.dyndns.org (I set the settings to use my dyndns.org dns instead of localhost).
My mac's main.cf in postfix is also set to use it as well:
mydomain=dyndns.org
myhostname=rodrigo7x.dyndns.org
my Mac's email account is rodrigo7x@rodrigo7x.dyndns.org (but this works too rodrigo7x@localhost )
On the Mac I am able to send emails to the same machine and the same is true in the XP machine. However, I have not been able to send mail from Mac to XP or XP to Mac.
This is how I am trying on my Mac after I telnet into localhost via 25:
220 rodrigo7x.dyndns.org ESMTP Postfix
mail from: rodrigo7x@rodrigo7x.dyndns.org
250 2.1.0 Ok
rcpt to: postmaster@rodrigo7x.dyndns.org
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: I am a Mac to a xp
.
250 2.0.0 Ok: queued as D800E19C6A9
On the pc the communiGate mail sever is a gui interface like outlook kind of, and when I send mail from the pc to the Mac it just comes back to the inbox saying mailer-daemon@rodrigo7x.dyndns.org undeliverable mail
Thank you again and hopefully at least the lan will start working. I will call my isp and find out about a ptr record. Thanks.
(Last edited by rodrigo7x; Apr 29, 2009 at 10:13 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
Hi,
Just wanted to thank everyone who was very generous in helping me configure postfix. I finally got around to this site:
http://diymacserver.com/docs/
There's a lot of documentation there that explains everything in a very easy language for people like me, who need it, to understand the basic concepts that besson3c was trying to relay to me in this forum.
Well, just incase anyone is wondering, I learned in there about extra extensions that I needed to download to work with php like pear which doesn't come by default in Leopard, and basically this:
* Postfix, the SMTP engine
* Courier IMAP/POP3, for looking into your inbox
* Courier Auth, to authenticate against the mailserver
* Postfix admin, user and domain administration
* DSpam, spam filter
* Maildrop, inbox filtering
I haven't installed all them yet but I see how I need the courier IMAP/POP3 extension, if I want to set Postfix as my mail server, and my xp machine to use a mail client like outlook. Right now on the xp machine I have configure outlook to use smtp with the address of my Mac (which has the smtp server for my LAN). I am able to send mail from that windows machine to my Mac just fine. However, I cannot send mail from the Mac to the XP since I don't have Courier set up yet.
In the link I mentioned above, it explains how I need an A record to map a real Domain Name to a WAN ip that besson3c mentioned to me earlier in the forumn, and then the ptr record that I also need. Well, for now I will stick to the LAN aspect, and worry about the WAN when I get the DNS, with WAN IP and the A and tpr records. Hope, this thread has been as helpful to others as it was to me. Thanks besson3c for your help and the others before you.
       
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Courier IMAP is an IMAP implementation (and one of several) that is used for accessing mail stored on the server via IMAP or POP protocols, but it is *not* at all part of sending mail. Congrats on getting a little further, but again, I strongly suggest getting to know all of this stuff well so that you can admin it properly rather than just trying to find the best tutorial that gets you up and running the quickest by blindly copying and pasting Unix commands you don't understand, not to assert that you don't.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Also, if you'd like us to help you, it would be helpful to understand better exactly what you are trying to do. At first it seemed to be send mail to remote SMTP servers for whatever reason, but now that setting up an IMAP server and filtering mail has entered the picture, it is really unclear what your goalposts are here.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
HI,
besson said I should make clear what I wanted to do so I am posting back to be more concrete. I like to make websites as a hobbie and I got to the part of web development where I wanted to test forms being submitted through the browser when I noticed that email weren't being sent even to user@localhost not to mention going to the internet. So I figured postfix wasn't configured right. I read postings online to test sendmail etc. The forums I read led me to configure what I posted in this forum. Well, come to find out anyone can use gmail as an smtp as I was doing to send emails. That's just stating the port number and outgoing server that you will use to send your emails, just like when you put the same information in you mail client like Mail in Mac or Outlook in Windows.
I found out that my email weren't being sent when I did telnet localhost 25 because postfix wasn't configured properly on my Mac. I followed the DIYMacServer » Docs tutorial and other online tutorials to configure postfix properly then I was able to send emails in my local environment and phpmailer works and now I am able to send the emails from php script. However, there's lots of different ways to write the php script and it will depend on how your environment is set up. But a simple google will bring almost all the possibilities up.
For the diymacserver tutorial, there's a lot going on there and it is useful to understand things better but I never said I was going to do all that, just that it explains things well.
but I still don't understand why if I am able to send myself emails if I telnet localhost 25 in myusername@localhost address and also I am able to do that through the browser using php script then why when I just type this in terminal:
date | mail -s test rodrigo7x@localhost.com I still get this error:
sh-3.2# mail: /usr/sbin/sendmail: No such file or directory
I can only describe it like this " the machine thinnks" I want to use sendmail. So I think the link that sends go to postfix is not working but I don't know how to fix that. If someone has a solution for this, it is well appreciated. Thank you.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
What do you get when you do a:
ps aux | grep postfix
and
ps aux | grep sendmail
and
postconf -n
you realize that there is no localhost.com? It should simply be "you@localhost" if you want to send mail to yourself. This isn't your problem here, but I just thought you should know this.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
LEAPORD-2:~ rodrigo7x$ ps aux | grep postfix
root 59 0.0 0.0 75368 556 ?? Ss 10:14PM 0:00.01 /usr/local/cutedge/postfix/LaunchDaemons/postfixLauncher
rodrigo7x 620 0.0 0.0 599780 436 s000 R+ 10:21PM 0:00.00 grep postfix
LEAPORD-2:~ rodrigo7x$ ps aux | grep sendmail
rodrigo7x 632 0.0 0.0 599780 460 s000 R+ 10:21PM 0:00.00 grep sendmail
LEAPORD-2:~ rodrigo7x$ postconf -n
config_directory = /etc/postfix
inet_interfaces = localhost
mail_owner = _postfix
mydomain = dyndns.org
mydomain_fallback = localhost
myhostname = rodrigo7x.dyndns.org
relayhost = smtp.gmail.com:587
setgid_group = _postdrop
smtp_enforce_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_passwords
smtp_sasl_security_options =
smtp_sasl_tls_security_options =
smtp_sasl_tls_verified_security_options =
smtp_tls_loglevel = 2
smtp_tls_per_site = hash:/etc/postfix/smtp_tls_sites
smtp_tls_security_level = encrypt
smtp_use_tls = yes
tls_random_source = dev:/dev/urandom
LEAPORD-2:~ rodrigo7x$
No I hadn't realized I wasn't supposed to use localhost.com thank you.
the above commands were with postfix off. With postfix on I get this:
sh-3.2# ps aux | grep postfix
root 59 0.0 0.0 75368 556 ?? Ss 10:14PM 0:00.01 /usr/local/cutedge/postfix/LaunchDaemons/postfixLauncher
root 961 0.0 0.0 599780 460 s000 R+ 10:28PM 0:00.00 grep postfix
_postfix 954 0.0 0.0 75528 780 ?? S 10:28PM 0:00.01 qmgr -l -t fifo -u
_postfix 953 0.0 0.0 75480 748 ?? S 10:28PM 0:00.01 pickup -l -t fifo -u
root 952 0.0 0.0 76496 748 ?? Ss 10:28PM 0:00.01 /usr/libexec/postfix/master
sh-3.2# ps aux | grep sendmail
root 980 0.0 0.0 599780 460 s000 R+ 10:29PM 0:00.00 grep sendmail
Oh I actually bought mailserv for leopard. That's probably why the commands yield the cutedge path (maybe), I remember the mailserv page having that name. I thought the mailserv was suppose to make postfix work like a charm but whether it's on or off or even uninstalled postfix works the same way.
Thank you Besson3c for your help.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2009
Status:
Offline
|
|
Hi,
I wanted to post back on this thread I started last year. I was following instructions to configure postfix for a 32bit system but apparently my Mac is listed under the 64 but architecture by doing a google search. The Mac genius had told me it was a 32 bit system, anyhow, that probably explains why postfix wasn't working too well. But Besson3c was right about the mx records and even if I did get as far as to send email, my emails would be rejected by most commercial mail servers.
At that time I was just trying to learn about mail() funciton in php and using sendmail with the mac through postfix etc, without paying for a hosting service that provides emails for websites. Well, there's many hosting services that offer that and they offer php, mysql with it, there's dns services that provide free domain names and there's also free google apps that gives free email accounts for your domains up to 50 accounts (which is what I was trying to do using gmail in my postfix set up - in a way).
As besson3c mentioned, I didn't have a clear understanding of how all this works but in case someone is messing around like I was, I thought I drop by in this thread again and post the outcome of what I was trying to do.
Blessings!!! and thanks Besson3c if you are still around this forum for the help you gave.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|