Is there a way to configure postfix so that it will attempt to use
direct delivery before relaying to another host?
I've built my webserver on Amazon EC2 which, even with static IP
addresses, does not handle reverse DNS lookup, causing (relatively few)
recipient servers reject the mail. We've contracted with a mail relay
service, but they are more expensive than the EC2 service itself! Since
we're a municipal government, we need to reduce expenses as much as
possible. The only solution I can think of is to have postfix attempt to
deliver outgoing mail directly, and then for failures due to connection
refusals, deliver them via the relay.
Is there a way to do this? Or maybe there is a better solution. Any help
is very welcome!
Thanks,
Mike
Re: How to use direct delivery before relay?
Sorry EC2 is a compute-farm not an email hosting service. IIRC, Amazon
have contributed the EC2 address space to the SpamHaus PBL, as they take
no responsibility for any email sent from that address space, spammers
can hire as many CPUs as they want, and try to send mail from EC2 if they
want.
Since most of the world uses zen.spamhaus.org, naturally neither you
nor the spammers will have much luck with sending email directly from
EC2.
It is hard to see how you save money on EC2 vs renting a dedicated Colo
node. EC2 is about scalability for variable loads, and the ability to rent
lots of CPU for a short-term compute project. If you need modest CPU +
bandwidth on an ongoing basis, you should be able to find something
reasonably competitive with EC2.
Instead of buying SMTP relay service. Rent a box, and deploy a relay
on it. Choose a reputable hosting provider, that does not tolerate
spammers, you don't want to be collateral damage when the hosting
provider's entire network is blocked.
Re: How to use direct delivery before relay?
Mike Gering:
Postfix looks up MX records by default, and can be configured to
add an "extra" MX host (with smtp_fallback_relay) that is given
the worst possible MX preference.
Note that if any host replies with a permanent error (5xx code) to
MAIL FROM, RCPT TO, DATA or end-of-data, Postfix will delete the
recipient(s) from the queue file and not try an alternate host for
those recipients.
However, I see occasional email abuse from EC2, so it is possible
that the EC2 IP address range had a bad email reputation.
In addition, many ISPs reject or silently discard mass mailings
from anywhere unless prior arrangements have been made.
Wietse
Re: How to use direct delivery before relay?
Unfortunately, the failures I see are 5xx. I checked the IP address
(174.129.10.202) and AFAIK it is not blacklisted. The site is www.ci.hillsborough.nc.us and is
obviously not a spam source. I'm surprised and disappointed that Amazon
does not provide a solution for legitimate customers.
Re: How to use direct delivery before relay?
What i think you can try do is try creating multiple instance of postfix
First Instance: Direct Delivery (If rejected forwarded and tried via
Instance 2)
Second Instance: Configured for only relay host
I guess this should solve the problem.
Rgds
Dhiraj
Stephen Leacock
- "I detest life-insurance agents: they always argue that I shall some
day
die, which is not so."
On Mon, Nov 9, 2009 at 03:00, Mike Gering wrote: