1 (edited by nrm 2016-01-21 06:12:20)

Topic: Smart Host FreeBSD

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.93
- Linux/BSD distribution name and version: FREEBSD
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- Web server (Apache or Nginx):APACHE
- Manage mail accounts with iRedAdmin-Pro?no
- Related log if you're reporting an issue:
====

Any one have a good tutorial on setting up a smarthost using FreeBSD?  I have scoured google and come up empty.  The ones for Debian work for Ubuntu but come with a Cyrus auth error when starting postfix on BSD.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Smart Host FreeBSD

About "smarthost", do you mean you want to forward received email to another server?

3 (edited by nrm 2016-01-21 20:04:02)

Re: Smart Host FreeBSD

ZhangHuangbin wrote:

About "smarthost", do you mean you want to forward received email to another server?

Since my IP is blacklisted.  I want to use a mail service like send-grid or sparkpost to relay my email. 

Here is what I have added to main.cf

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/usr/local/etc/postfix/saslpasswd
smtp_always_send_ehlo = yes
relayhost = smtp.sparkpost.net:587


Here is the error from maillog
Jan 21 06:58:17 bsd postfix/smtp[16595]: warning: unsupported SASL client implementation: cyrus
Jan 21 06:58:17 bsd postfix/smtp[16595]: fatal: SASL library initialization
Jan 21 06:58:18 bsd postfix/master[5168]: warning: process /usr/local/libexec/postfix/smtp pid 16595 exit status 1
Jan 21 06:58:18 bsd postfix/master[5168]: warning: /usr/local/libexec/postfix/smtp: bad command startup -- throttling

4

Re: Smart Host FreeBSD

Show us output of command below:

postconf -n | grep 'cyrus'

iRedMail configures Postfix to use Dovecot as SASL authentication server:

smtpd_sasl_type = dovecot

5

Re: Smart Host FreeBSD

The output of postconf -n | grep 'cyrus' is blank.

6 (edited by nrm 2016-01-23 10:19:19)

Re: Smart Host FreeBSD

I am writing this for posterity.  Maybe it will help someone since there are not good tutorials out there.   I was able to get the iredmail install on FreeBSD to work with using posfix to relay to a smarthost.

After much digging I realized that the port used to compile postfix is complied without cyrus SASL support.  So I just recompiled it with cyrus SASL.

1. cd /usr/ports/mail/postfix
2. make config
3. Check the appropriate boxes for SASL support.
4. make deinstall reinstall
5. Use Cyrus SASL instead of Dovecot SASL (Comment out or delete this line smtpd_sasl_auth_enable = yes)
6.ADD smtp_sasl_auth_enable = yes
  smtp_sasl_security_options = noanonymous
  smtp_sasl_password_maps = hash:/usr/local/etc/postfix/saslpasswd
  smtp_always_send_ehlo = yes
  relayhost = yoursmarthost.net:port
7. postmap /usr/local/etc/postfix/saslpasswd
8. Restart Postfix

Google "postfix smarthost" to understand how to create a saslpasswd file.

Seems to be working fine until now.

7

Re: Smart Host FreeBSD

nrm wrote:

5. Use Cyrus SASL instead of Dovecot SASL (Comment out or delete this line smtpd_sasl_auth_enable = yes)

It should work with Dovecot SASL support.

nrm wrote:

Comment out or delete this line smtpd_sasl_auth_enable = yes

Without this line, Postfix doesn't need SASL auth at all. So it doesn't matter which one (Cyrus SASL or Dovecot SASL) you have.

8 (edited by nrm 2016-01-23 20:21:46)

Re: Smart Host FreeBSD

It should work with Dovecot SASL support.

It does for Centos + Ubuntu DOES NOT for FreeBSD.  I am assuming both binarys are compiled with Cyrus support. I get a 550 bounced on several different fresh installations of FreeBSD.  Thats why i finally decied to compile with Cyrus SASL support.

Without this line, Postfix doesn't need SASL auth at all. So it doesn't matter which one (Cyrus SASL or Dovecot SASL) you have.

it has been replaced with smtp_sasl_auth_enable = yes

9

Re: Smart Host FreeBSD

nrm wrote:

Thats why i finally decied to compile with Cyrus SASL support.

Do your mail clients can send email with smtp auth?

10

Re: Smart Host FreeBSD

They do use auth.  I believe there are two separate issues here.  Client to Postfix smtp auth and postfix to smarthost relay auth. 

The relayhost parameter on BSD does not utilize smtpd_auth.  I still can't seem to figure out why.