Take the 2-minute tour ×

I have an Ubuntu server and I have various needs to send email from it (automysqlbackup, other scripts, mantis bug tracker) but it has access to internet only using a proxy. Postfix or anything else, as long as I'm able to send mail, it's perfect.

I could use Squid or Astaro Security Gateway, since we have two proxies on this network...

The easiest the best :)

Thanks a lot!

share|improve this question

4 Answers 4

up vote 1 down vote accepted

By default, when trying to send an email, Ubuntu will look up the MX record for the address domain, and try and send directly to that.

You have two options:

  • Set up an MTA on your Ubuntu server, such as Postfix or Exim, and configure that to relay to an internal SMTP server that can send outside the firewall (probably what you are thinking of when you say proxy)
  • or change the firewall configuration to allow outbound traffic on port 25 from your Ubuntu server - that is the easiest solution, especially if you have to ask someone else to do the firewall change :-)
share|improve this answer

Well, sending email out through an HTTP proxy is not going to work; your best bet would be to configure an SMTP relay for this box on your mail server within the network or through the firewall itself (most firewalls support this as a feature).

share|improve this answer
The some ugly hacks you can send email via some proxies, if it allows the use of the CONNECT method to port 25. Most proxies block this fortunately, to prevent the proxy from being an open relay. –  Zoredache Jan 14 '11 at 16:01

The Ubuntu/Debian Exim configuration handles this out of the box. Configure your server to forward all mail to a Smarthost (your ISP's relay server). I use this configuration internally to consolidate all email on a single server.

share|improve this answer

Your question is very short on detail but your comment about

access to internet only using a proxy

makes me wonder about what the proxy will and won't allow. If it only allows HTTP and HTTPS, which is quite common, you will not be able to send email because even if there was no restriction on outbound traffic your server would not receive any SMTP replies. In such a case you would need to send email via your local mailserver, which presumable is permitted to send email externally.

share|improve this answer

Your Answer


