use remote smtp server?
I have a server that send out mail using PHP's mail, Linux sendmail, maybe postfix, and nail.
How can I change all of these processes so that they use a registered smtp server with correct MX records to ensure that the mail is not delivered to junk especially if it HTML email? |
I sort of understand why you want to make a change, but your post is a bit vague about how email is sent. Are you using several clients connecting to a local SMTP server on your machine/network? Or are you using a server provided off-site (ISP etc)? If you are using a local server and your IP address is not static, your email is unlikely to be delivered at all. Please elaborate.
cheers, Ken |
any SMTP relay can be directed to use an upstream ISP relay instead of going direct - see the documentation for whatever SMTP installation you have.
|
Also, no matter how you set up yours and your upstream servers, you have no control over whether something in the chain flags the message as junk. That happens at the recipient's mail application, and possibly their immediate upstream mail provider (my ISP runs a spam detector on any mail they deliver to me).
The answer is, of course, to write mail that doesn't appear to be spam. |
If you are looking for a way to do this without reconfiguring the serverwide smtp settings, you can use the php Pear mail package instead of the built in mail command
|
Quote:
well yes and no. Filters like spamhaus will check the source IP address for blacklisting. Using a relay avoids that. |
I use Blat which was very easy for a Linux newbie like me to set up to use my own smtp server.
Regards, John |
Quote:
So, the mails get delivered (to most ISPs) but delivered as junk or not delivered at all (AOL, etc). I have access to a smtp server with the actual domain and proper MX records of mydomain.com but it is on a different remote server. Quote:
Quote:
Quote:
Quote:
|
Wouldn't it be simpler just to buy a domain for a few dollars a year and apply this to your server or use your domain provider to set up a sub domain.
Regards, John |
It's unlikely to be the lack of DNS MX records causing non-delivery. Most likely you have a dynamic address from your ISP unless you have specifically bought a static address, and as such external SMTP servers will not relay or deliver anything sent from that address, even if you have a domain name. Make sure you have a static address (if you can get one now since IP4 has run out of addresses AFAIK). Then you can get a free domain name from someone like DynDNS, if you are happy with their kinky offerings.
On the other hand your ISP should almost certainly provide an SMTP server which will be happy with relaying your mail as you will have been authenticated with them when setting up the connection. I'm pretty sure you can receive mail directly to your machine (rather than through the ISP's POP3 or IMAP4 servers) even with a dynamic IP address, as DNS servers like DynDNS will follow changes to your address. However you will need to setup a complex mailserver to handle it. A lot of work! cheers, Ken |
Quote:
The mail is delivered, it just goes to junk as it comes from an unrecognised domain. Some ISPs block it completely eg AOL as they do an MX check. Yes, the ISP has an smtp server that I want to use but I don't know how to change sendmail, PHP mail, postfix, and nail as per OP :) Quote:
mydomain.com running at the webs server host MX records at hosting company have stmp.hosting.com access justanip.address.x.x @ separate dedicated server running other functions So, there are 3 separate servers at different locations (web server, smtp server, local server) I could buy another domain name to run on the local server but then they would receive mail from slightyldifferent-mydomain.com not mydomain.com I could add a webserver and smtp on the local server too but I don't want to at the moment for performance and it would be a lot of effort to move files and DNS settings. |
send via SMTP relay
First, find out what your primary server is running with telnet;
telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain. Escape character is '^]'. 220 mail.somedomain.com ESMTP Postfix quit 221 2.0.0 Bye Connection closed by foreign host. In this case it's Postfix (see it in the output?) Add a line in /etc/postfix/main.cf relayhost = [my.relay.host.org] And yes, the square brackets are supposed to be there. Restart Postfix with /etc/init.d/postfix restart And all should be good - adjust paths to files to suit your distribution, and if you need more assistance, please post the result of your telnet session |
edit
|
More on my previous post
I'm not sure how php-mail works, but I had made an assumption that all of the mail was directed at the machine without the proper DNS entries. Nail for certain works nicely with localhost as the SMTP server, and if everything is local, it's simple to then have the local machine forward to an upstream mx. Don't forget to tell the upstream mx that you will be relaying to it, and add a forward or two so you can receive reply and bounce messages.
|
Quote:
So I guess it reduces to GIYF (Google is your friend). e.g. for sendmail there is http://cri.ch/linux/docs/sk0009.html as an example, and others as well. It's just a matter of ploughing through the arcane Linux config files with the help of those who suffered before us. Using your own ISP is easy as they know who you are and will relay without hassles. You won't need a domain name. Quote:
Ken |
All times are GMT -5. The time now is 08:58 AM. |