local smtp agent
jhary at unsane.co.uk
Thu Oct 26 14:01:24 UTC 2006
ke han wrote:
> I have an application on my FreeBSD 6.1 server which needs to send out
> e-mail. I have access to a a well managed SMTP server on another
> server. I would like to send e-mail from my app to a local SMTP agent
> which then handles sending to the "real" SMTP server in a more
> fault-tolerant manner than I can easily achieve with my app code.
Very sensible, I've seen a lot of problems from developers trying to
reinvent the wheel/smtp daemon ;)
> I believe this to be a typical scenario. What is the recommended
> approach? Use the default sendmail?or use procmail? Is there a howto
> someone can point me to? Does the recommendation change if the local
> SMTP agent needs to connect to the "real" SMTP server using TLS with id
> and password?
ssmtp is a good if basic approach. (/usr/ports/mail/ssmtp)
I believe it supports TLS and auth although its been a while since i
looked. (actually found a howto here
http://www.qnd-guides.org/qnd-ssmtp.html which says it does)
I'm just not sure about error handling (says it doesnt do queue's so if
your "real" server is un-contactable i'm not sure how it handles that.)
If this is an issue you might want a "real" MTA that will queue it and
retry with your SMTP server set as a smarthost.
You can use the base sendmail (just need a
in the .mc file and i think the default for sendmail in FreeBSD is to
just work for outgoing, however getting TLS and auth involved makes it
a lot more complex.
I wouldnt really recommend it unless you fancy getting stuck into some
semi complex sendmail config but if your interested
See http://www.sendmail.org/m4/smtp_auth.html the section about sendmail
acting as a client and
http://www.sendmail.org/m4/starttls.html for the TLS side.
and look in /etc/mail/ (freebsd.mc is a good starting .mc file but will
Pretty much any of the MTAs in /usr/ports/mail can do what you want
though, my favorites being postfix and exim.
Hope this helps,
> thanks, ke han
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions