Sendmail in Panther

rhale1

KU Mac Geek
Is sendmail missing from 10.3? I've yet to get it working (let alone find where it is) since the 10.3 WWDC Build. It's rather distressing b/c I use the php mail() function often on my web site (hosted on my mac, of course).
 
Apparently, according to this link, Postfix replaces sendmail.

Now the big question: how do I get it working and tell php to use it.
 
Sweet, Postfix is a lot better than sendmail!

You can edit /etc/postfix/main.cf as long as Apple hasn't moved the config stuff around like they did with some other programs.

There's a lot of info in this thread including a startup item so it starts up every boot.
 
You'll have to setup Postfix a bit before using it, but there isn't much to do.

Open the file /etc/postfix/main.cf
You can type in that path in Textedit or use pico or some other command line text editor.

First you'll want to setup your hostname
Search for "hostname = " in the document and replace it with what you want your hostname to be.

Then, setup anti relay control so your computer isn't used by spammers(and we all hate you for it ;))
Search main.cf for "mynetworks_style = " and replace it with "mynetworks_style = host" so that only your computer can send email with postfix.

Then, in terminal start postfix with "sudo postfix start" and type in your admin password.

This will start postfix and it will run for as long as your computer is running. When you restart it will not start by itself. There are threads in the unix forum, and I believe the FAQ forum for a way to start it automatically each boot.

It should be the same as Jaguar AFAIK.

In PHP you will use the mail function and it will find postfix through the installed sendmail replacement program.
 
Thanks for the information. I am, as many other PowerBook users in the situation that I don't have the same IP all the time. How do I set up the "myhostname" parameter in that case? There is a way to get sendmail to work without static IP/domain name and I would be surprised if there wasn't with Postfix. Keep i mind that I only need the SMTP server. I am aware that using POP3 or IMAP involves more tweaking in the config file.

I have also looked at the thread you cited in the other thread that I asked a similar question and I have followed the directions in this thread but I believe something must have changed. I still get user/group related errors when attempting to start Postfix: parameter setgid_group: unknown group name: postdrop
 
You don't need a hostname to use it. The emails sent out will just have your Rendezvous name as the host.

Try creating the postdrop group:

niutil -list . /groups gid | sort -n +1 | awk '{ print $2 }'
pick a gid that isn't being used and use that for this command:

sudo niutil -create . /groups/maildrop
sudo niutil -createprop . /groups/maildrop passwd '*'
sudo niutil -createprop . /groups/maildrop gid 201

Replace 201 with an unused gid.
 
I followed you directions and after fixing a few permission in /private/var/spool/postfix/ it runs beautifully from PHP's mail() function. I still get an error though when sending messages using either localhost or 127.0.0.1 as SMTP-server in Eudora (and Mail).
 
Hmm, I've had the same thing happen to me with earlier Postfix versions. I think 2.0.12 to 2.0.13 would not work on my Mac under 10.1.5 and 10.2.6

In terminal try "sudo postfix start" if it's not already started, and type "telnet localhost 25" to try and connect to the SMTP port.

If it says connection refused then I think it's a problem with the version of Postfix. I have 2.0.14 working on OSX 10.1.5 and it works, but previous versions would not work at all.

I'm not sure why, but this could be an incompatibility with OS X.

I'm not sure how to tell which version of postfix is installed though.

This is a possiblity, based on what I had happen, but I find it strange that Apple would ship Panther with a broken Postfix if this really is the problem.
 
The connection is indeed refused when I connect via telnet. Is it reasonably easy to install a newer version without having to go through too much configuring? I'd try that path since as an early Panther adopter I don't expect a response from too many other people than you anytime soon :)
 
Yes it is really easy to install, and quite fast as well if you already have all the man pages installed(which you should).

Download the latest(2.0.16) from here
and decompress it.

There is a readme file in the postfix-2.0.16\auxiliary\MacOSX folder called README-INSTALL.OSX that tells you everything you need to do.

You shouldn't have to run the niscript because you should already have the postfix and postdrop groups. The script creates postfix and maildrop groups as well as a postfix user and some other things.

You should be able to just run the compile part in the readme file which is "sudo make install" in the postfix-2.0.16 directory.

Then answer the installer's questions and it should install everything where it needs to be. When it asks you for the group to use, tell it postdrop if you haven't run the niscript, which you shouldn't have to do.

Now hopfully you should be able to start Postfix, and connect!

I don't know if this latest version will work, because I have 2.0.14 installed.

Good luck;)
 
Hi,
I have just installed Panther and it's lovely :)

But it took my sendmail away :(

As a total newbie in unix/terminal I would REALLY appriciate a FULL and EXACT instrucion how to install/activate/config or what ever I have to do so I can use postfix insted of sendmail for my smtp (thats all I need).

(I can see that I have the postix in the /etc/postfix catalog)

With sendmail I used Webmin to config but it don't seem to work with postfix :(

Thanks in advance guys!
 
I found that replacing the default /etc/postfix/master.cf with /etc/postfix/master.cf.defaultserver after a clean Panther install seems to solve the permissions issues with "telnet localhost 25."

However, while I can now send mail, I still can't receive mail. When I try "telnet <actual IP address> 25" the connection is always refused. Any ideas?
 
bobomac said:
I found that replacing the default /etc/postfix/master.cf with /etc/postfix/master.cf.defaultserver after a clean Panther install seems to solve the permissions issues with "telnet localhost 25."

However, while I can now send mail, I still can't receive mail. When I try "telnet <actual IP address> 25" the connection is always refused. Any ideas?

Ahh... Found the extra "inet_interfaces = localhost" that Apple stuck down there at the bottom of main.cf. Commented that out and the "mynetworks_style = host" they also added and now everything works!!
 
I can't get Postfix to start. I've set myhost and mydomain to 'localhost', but whenever I start postfix:
Code:
[ip-wv-66-190-116-085:/etc/postfix] rhale1% sudo postfix start
I then get this:
Code:
postfix: fatal: bad string length (0 < 1): mydomain_fallback =

Any ideas? I get the same thing when I replace main.cf with main.cf.default (using sudo cp main.cf.default main.cf).
 
I installed the latest version but it still refuses to send out mail over SMTP :( ... I'll let it at that for the moment because at the end of the day I need the mail() function in PHP to work much more than having my own SMTP server. I'm sure I'll get a solution sometime. Maybe I'll just have to take the time to make a clean install of 10.3 one of these days, I only updated from 10.2.8 and that entailed other problems (I was struggling with kernel panics on startup after my second or third restart under 10.3 which I only resolved by fixing permissions and repairing the hard drive; I still feel somewhat uncomfortable about my installation of Panther even though it's screamingly fast und fun working with :D ).

Thanks for your help, Captain Code :p
 
I found that replacing the default /etc/postfix/master.cf with /etc/postfix/master.cf.defaultserver after a clean Panther install seems to solve the permissions issues with "telnet localhost 25."


Thanks so much, bobomac! This did the trick for my SMTP server to work. I'm a happy camper once again :D
 
What can be causing this two returns =(


[MinG4:~] matsjidk% telnet localhost 25
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host


AND THIS


[MinG4:~] matsjidk% sudo postfix reload
Password:
postfix: fatal: file /etc/postfix/main.cf: parameter mail_owner: unknown user name value: postfix


Whats going wrong ??

 
Connection refused is because Postfix isn't started. Panther should have created the Postfix user, but it might not have worked for some reason.
Before creating the postfix user with the commands below, type this in terminal:
sudo niutil -list . /users
note the space between the period and /users
Make sure there isn't a postfix user listed.
I'll quote part of testuser's post on how to create the postfix user:

Next we need to create the 'postfix' user, and make him a member of the 'postfix' group, but not the 'maildrop' group. Again you will need to find a unique user ID (uid). To see all the current uids:
niutil -list . /users uid | sort -n +1 | awk '{ print $2 }'

Choose a UID that is not in use (in my case 200) and create the postfix user using the gid for the postfix group above:
sudo niutil -create . /users/postfix
sudo niutil -createprop . /users/postfix realname "Postfix User"
sudo niutil -createprop . /users/postfix passwd '*'
sudo niutil -createprop . /users/postfix uid 200
sudo niutil -createprop . /users/postfix gid 200
sudo niutil -createprop . /users/postfix home /dev/null
sudo niutil -createprop . /users/postfix shell /dev/null
sudo niutil -createprop . /users/postfix change 0
sudo niutil -createprop . /users/postfix expire 0
sudo niutil -createprop . /users/postfix _writers_passwd postfix
 
Back
Top