Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Running kubuntu 10.04 on my host, let's call it alpha. I've got postfix as my system MTA. I've got crons running on alpha that need to send email to a remote host, let's call it mailhost. I cannot alter any configs on mailhost.

Normally I use Thunderbird to send/get email through mailhost using IMAP over TLS. The SMTP setup in Thunderbird is configured to use STARTTLS.

I want cron jobs running on alpha to send mail to mailhost, but because alpha is a dynamic-IP host behind residential NAT, it's difficult to get mailhost to accept mail from alpha due to the usual anti-spam/RBL heuristics. However, if I can get postfix to use TLS to connect to mailhost when it's sending mail to an address (dirtside@mailhost for example), then the mails should go through just fine.

What I'm trying to figure out is how to configure postfix to use STARTTLS with a specific username and password ONLY when connecting to mailhost.

Alternative solutions (e.g. using something besides postfix) are acceptable, but the ultimate task is still to allow crons running on alpha to send emails to

share|improve this question

You can use smtp_tls_policy_maps to configure the TLS policy on a per host basis.

smtp_tls_policy_maps = hash:/etc/postfix/tls_policy

/etc/postfix/tls_policy:    encrypt

Remember to run postmap /etc/postfix/tls_policy after editing that file.

You could also set smtp_tls_security_level = may to use TLS when the remote server supports it, but fallback to non-TLS otherwise.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.