sendmail - should be simple, but I don't get it.

Discussion in 'Windows Desktop Systems' started by Glaanieboy, Jun 8, 2004.

  1. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Alright, this should be simple to setup, but all the guides I have found are going too deep, to a point that I don't get it.
    On my Windows box, I have setup PHP to forward mail to smtp.wanadoo.nl with From:glaanieboy@msn.com. But on my FreeBSD box, I see I have to use sendmail, but how? I don't want to create a SMTP server, I just want it to forward to a SMTP server. But so far all guides on sendmail I have found, talk about setting up a SMTP server. Can anyone help me and/or guide me in the good direction? Thanks.
     
  2. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    in /etc/rc.conf

    sendmail_enable="YES"

    I think that would do it
     
  3. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Yes, it has been set to "yes", but when I haven't seen an option where I specify a smtp server and from: address. Where can I find that?
     
  4. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Woops, I see I forgot to point the php.ini file to the sendmail path:
    The first two options enabled me in Windows to specify a smtp and mail from: address, but in Unix you can only point to a sendmail, which must have a similar function then (redirecting to a smtp with from: ), I guess.
     
  5. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    First off, I dont know Sendmail or Qmail, or PosFIX etc.

    Now that I got that out of the way, I believe that Sendmail is unnecessarily confusing and unintuitive to setup. From what I've read, unless you know sendmail, use qmail, its easier, again from what I've read. Also sendmail has some known securiity issues.
     
  6. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Can I use qmail with PHP then? If so, how?
     
  7. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
  8. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Yeah, maybe he can tell me how he setup the server OSNN is hosted on, I believe it runs on FreeBSD as well...
     
  9. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    qMail Guide

    then once that is in then change the sendmail_path to "/var/qmail/bin/qmail-inject"

    I know the smtp settings are Win32 only, but does changing them have the right effect??
     
  10. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Cool, I see X-Istence wrote that guide, good to know I can go to him for help :) Thanks Geffy!
     
  11. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    yep, its one of the most popular guides on that site
     
  12. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Unfortunately it doesn't cover how to redirect mail to an external smtp server :(. I have just tested out settings the Win32 settings, but they did not work :( Must I use an extra option in mail() in PHP? I now have this:
    mail("glaanieboy@msn.com","Subject test","Body test");
     
  13. Reg

    Reg eXperienced!

    Messages:
    639
    Location:
    Arlington, TX
    Sendmail is basically a basic SMTP system. All it does is routes email form your machine to whatever email address you send it to. There may be a way to forward it to an SMTP, but why would you want to do that?

    If you have a more advanced installation of Sendmail, try typing in

    locate sendmail.cf

    That is the normal config file for sendmail. It's usually located in /etc/mail
     
  14. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Well, my ISP has blocked port 25, wouldn't that block any SMTP server I set up? Or is port 25 only used for incoming requests?
     
  15. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    25 is for connecting to a smtp server, afaik it should send out on a different port, but connecting to port 25 on another machine
     
  16. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    So the blocking of port 25 won't affect me, as I would only use the SMTP to send out mails?
     
  17. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    I believe so as ports below 1024 are reserved for server listening, not server transfer, I am pretty sure that the data is sent out on a port higher than 1024
     
  18. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Ah ok. I'll have to try it out then.
     
  19. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Alright, qmail installed, thanks to the guidance of X-Istence, but I can't get it to work in PHP. Here are the current settings in [Mail functions] in the php.ini file:
    Altough sendmail is not installed anymore, qmail is able to emulate it's functions and I created a symlink from /usr/bin/sendmail to the sendmail emulator in the qmail bin. I first tried Geffy's suggestion, that is setting the Win32 settings anyway, but that doesn't seem to work. Then I uncommented the [Unix] bit, adding the line you see in the quote, but that did not help either. What can I do? It's not in the test script, I just tested it in Windows and there it's working fine. qmail is up and running, so there must be a setting in qmail somewhere. For reference, I followed the guide about qmail found on bsdguides.org that X-Istence wrote (all but the Spam part, as I don't use it), is there a setting I missed? Or missing from the guide?
    Again, all I want is a way of sending mail from the server, for use in php mail() functions. I don't need any new mailaddress, although I am tempted by the idea of having infinite mail addresses.I would rather just use the smtp server from my ISP, just like in Windows, but that seems hard under Unix.
     
  20. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    do that

    btw you also need to remove the ; from the sendmail_path line as lines starting with ; are comments and so are ignored