How to send mail to SourceForge

Exim MTA logo I spend some time today trying to figure out how I would be able to send mail to SourceForge. SourceForge is an enormous enterprise with more than a million users and hundred thousand projects, most of which have one or more mailinglists associated with them — the amount of mail flowing through SourceForge each day must be huge. So why should I have difficulties sending mail to an address at SourceForge, you might ask? I’ll tell you… :-)

First I discovered that mail bound for mailinglists at SourceForge would disappear on its way. The mail first goes to my local Exim which forwards it to — the SMTP server at my ISP Bluewin. After that I have no idea what has happened to my mail, I only know that it doesn’t reach the SF mailinglists. A mail to six days ago has gone unanswered… :-/

I then tried cutting out the middle-man and configured my Exim (using the super-simple Debian way of dpkg-reconfigure exim4-config) to send its mail directly like a full-blown SMTP server. I had initially not configured Exim like that because I didn’t want to add yet another publicly accessible server to my system.

But then I ran into the next problem: the spam filtering done at SourceForge. Every time someone tries to send something to their Exim SMTP server (cool, SourceForge use Exim too!) it will make a callout verification of the sender address. This simply means that it will try to deliver a message to the envelope address in the mail. In my case that failed for some reason, and I got this in my Exim log file:

451-could not connect to xxx []: Connection refused
451-Could not complete sender verify callout for <mg@xxx>.
451-The mail server(s) for the domain may be temporarily unreachable, or
451-they may be permanently unreachable from this server. In the latter case,
451-you need to change the address or create an MX record for its domain
451-if it is supposed to be generally accessible from the Internet.
451 Talk to your mail administrator for details.

I tried opening my router to allow the incoming connection to port 25 (SMTP) but it didn’t help. What to do? The usual when you run into a problem like this: read lots of man pages, configuration files, documentation, websites, etc… :-)

And surely enough, it worked: While reading through the Exim configuration files under /etc/exim4/conf.d/ I stumbled over a reference to /etc/email-addresses. That file is used by Exim when it inserts the envelope sender header in its outgoing mail: if a user is not listed in that file (the default) then it generates the envelope address of

Return-Path: <username@hostname>

In my case that made SourceForge do the callout back to my machine. If I instead add the line


to /etc/email-addresses I get the following, much better envelope address in my outgoing mail:

Return-Path: <>

which causes SourceForge to check with (the mail exchange for And this check succeeds! Hurray, I can now once again send mail to SourceForge hosted mailinglists!

By the way, if you’re running an SMTP server and you’re having problems with spam, then try the Spam Filtering for Mail Exchangers guide to rejecting junk mail in incoming SMTP transactions. They describe a whole bunch of tricks, including the callout verification technique described above and the very clever greylisting technique.

The advantage of this is that you’ll save yourself the trouble of filtering the spam later using something like SpamAssassin, and you’ll save yourself the bandwidth cost of receiving the spam in the first case since you can drop the connection before it has even entered your system.


  1. Andreas Wacker » Blog Archive » return path exim4:

    [...] Even after this fix the return-path was set to something stupid like ‘www-data@hostname-I-gave-the-machine’ I took a bit of googling and a couple of pointless detours to /etc/hosts and dpkg-reconfigure exim4-config before I found this blog entry that pointed to /etc/email-addresses which indeed did the trick. [...]

  2. Adrian Puente:

    You are my Man! I have the same problem and I have no time for googling/Howtoing/ircing for the solution. Great job!

    Adrian Puente Z.

  3. eccentric:

    Excellent, /etc/email-addresses is a handy thing to know about and solved the problem I was having. Thanks for the help.

  4. the frig blig » Blog Archive » howto change the return-path in exim4:

    [...] Add an entry to /etc/email-addresses. Thank you Martin Geisler! [...]

Leave a comment