How Should You Handle Remote SMTP Users?
keytoe asks: "With all the recent discussion around here about spam relaying, black hole lists, spam police and so on I've decided to start taking part. According to the Securing and Testing page on ORBS, running sendmail with FEATURE(relay_local_from) enabled is Bad(tm) and the sendmail folk agree. How could one go about setting up selective relaying from remote dialup users without first knowing where they're coming from? Listing 'aol.com' and 'uswest.net' in '/etc/mail/relay-domains' simply subverts the original goal. I'm aware that authenticated SMTP will move toward this goal, but that needs to be supported on the client side - and it's not there yet for all platforms. Additionally, I've seen suggestions to use a POP-before-SMTP hack, but I'm not using the sendmail POP server. In short, I'm seeking a transparent (to the users) replacement for FEATURE(relay_local_from) that actually -will- pass the ORBS test and keep the nasty people out. Am I screwed?"
The only good solution is to authenticate users before allowing them to send mail. As a temporary kludge, you could setup sendmail to listen to a non-standard port.
Mea navis aericumbens anguillis abundat
Well, I cannot give you actual code or configuration files, but here are some ways others are doing it:
2bits.com, Inc: Drupal, WordPress, and LAMP performance tuning.
You really do want some kind of authentication when relaying for machines not on your network.
I have used ssh's portforwarding feature and it works fine. Set up the foward of a port on localhost to a machine running sshd and smtp and then configure your mail client to send to localhost.
My web provider is using a mechanism involving wtmp. I don't know the details and I haven't used it yet. They say that if you log in to a shell or ftp then the IP you logged in from will be able to relay mail for a limited time. Presumably they're using some home made script to manage the relay list dynamically.
You could probably modify your POP software (assuming it's open source) to log the source IP to a file. It should only be a line or two of code in the right place. Then set up a script to 'tail -f' that log and add IPs to the relay list. Purge the relay list on a regular basis so that IPs don't stay on it for too long.
I'm using Rockliffe Mailsite on (here it comes) NT. The most I seem to be able to do is only accept relay from people authenticated by email address, figuring yeah anyone could guess one of our addresses, but I think it's a line that many spammers wouldn't cross.
I like music
Sendmail is ancient. Stop using it.
.username.pop and you'll kill your pop server.
I recommend qmail in its place. Using it, you can put all of your dialup user's ips. This is assuming that you are the one handing out IP's -- you will have a specific block of them, so you can force that you only relay from those hosts.
Also, don't use sendmail. It stores all of your emails in one big file. What happens when you get a mailbox file that is 70-700megs big? When pop comes along, it starts timing itself out when you copy the box from username to
qmail stores each email in a seperate file to prevent this. If you have all the wrapper programs it runs under give the process the resources it needs, you can easily store gigabytes 'in your pop account'.
Not to mention all the benefits of vpopmail.
I could probably go on and on about why you shouldn't use sendmail.. so I'll stop now.
-- DrZaius - Minister of Sciences and Protector of the Faith
I think it's a line that many spammers wouldn't cross.
Ha, that's funny... that's a joke eh?
-rt-
-rt-
** Evil Canadians are taking over the world. Learn about the conspiracy
I have a similar problem. I have a few friends that want to remaind somewhat anonymous when sending mail. They don't want their school's IP to show up when sending mail. I volunteered to give them SMTP services but they aren't saavy enough to login via ssh to my box to use pine to send email. If they login, it will be via a free ISP, and allowing relaying from those domains opens a HUGE can of worms. Is there a way to limit "From" domains from the senders?
No more relaying for entire ISP networks, easier firewall rules..
I am not sure if this can easily be achieved in the USA or anywhere outside of the Netherlands, but we've got plenty of ISP's here that offer a static IP for little or no extra cost.
If such a setup is possible in your area, I'd recommend it. Convincing your client should not be any harder than "your site is insecure [open relaying / fscked firewalls are, aren't they?], but it can be fixed". The client will immediately go: "how?" and will easily accept your suggestion to go with a static IP.
>When pop comes along, it starts timing itself out when you copy the box from username to .username.pop and you'll kill your pop server.
:)
...MoO!
Erm... that's got nothing to do with sendmail. Why don't you switch to cucipop -- no temporary files at all