# Postfix won't send portage logmails

## msulli1355

I followed the guide at http://en.gentoo-wiki.com/wiki/Mail_server_using_Postfix_and_Dovecot to set up postfix.  Posfix WILL send emails from cron, but not portage.  I installed app-accessibility/festival-2.1-r1::gentoo today.  At the bottom of my teminal window, it says:

>>> Installing (1 of 1) app-accessibility/festival-2.1-r1::gentoo

 * 

 *     Useful examples include saytime, text2wave. For example, try:

 *         "/usr/share/doc/festival-2.1-r1/examples/saytime"

 * 

 *     Or for something more fun:

 *         "echo "Gentoo can speak" | festival --tts"

 * 

 * This version also allows configuration of site specific

 * initialization in /etc/festival/siteinit.scm and

 * variables in /etc/festival/sitevars.scm.

 * 

!!! An error occurred while trying to send logmail:

Connection unexpectedly closed

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

 * IMPORTANT: config file '/etc/postfix/main.cf' needs updating.

 * See the CONFIGURATION FILES section of the emerge

 * man page to learn how to update config files.

When I consult /var/log/messages, I see this:

Sep  3 15:28:24 camille postfix/smtpd[14770]: connect from camille.espersunited.com[192.168.0.3]

Sep  3 15:28:24 camille postfix/smtpd[14770]: fatal: no SASL authentication mechanisms

Sep  3 15:28:25 camille postfix/master[6903]: warning: process /usr/libexec/postfix/smtpd pid 14770 exit status 1

Sep  3 15:28:25 camille postfix/master[6903]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

What gives?  I manually started saslauthd because somebody said that resolved their issue:

michael@camille ~ $ sudo ps ax | grep saslauthd

Password: 

10839 ?        Ss     0:00 saslauthd -a sasldb start

10840 ?        S      0:00 saslauthd -a sasldb start

10841 ?        S      0:00 saslauthd -a sasldb start

10842 ?        S      0:00 saslauthd -a sasldb start

10843 ?        S      0:00 saslauthd -a sasldb start

14832 pts/0    S+     0:00 grep --colour=auto saslauthd

I'm kinda lost here.  Please help!

----------

## freke

I've got a working (for me:)) Dovecot/Postfix-setup - I'm using Dovecot for handling sasl (you've got Dovecot running?), though (ie. 'smtpd_sasl_type = dovecot' in /etc/postfix/main.cf), I don't have saslauthd running.

(No idea if Dovecot calls it at some point)

Other than that it seems odd that Cron can send mails but not Portage (how's your restrictions in /etc/postfix/main.cf?)

ie. I've got something like:

```
smtpd_client_restrictions =

        sleep 10

        check_client_access mysql:/etc/postfix/mysql-sa-policy.cf

        check_client_access hash:/etc/postfix/maps/access_client

        warn_if_reject reject_unknown_reverse_client_hostname

smtpd_helo_restrictions =

        warn_if_reject reject_invalid_helo_hostname

        reject_non_fqdn_helo_hostname

smtpd_sender_restrictions =

        warn_if_reject reject_unknown_sender_domain

        reject_non_fqdn_sender

smtpd_relay_restrictions =

        permit_mynetworks

        permit_sasl_authenticated

        reject_unauth_destination

smtpd_recipient_restrictions =

        permit_mynetworks

        permit_sasl_authenticated

        reject_unknown_recipient_domain

        reject_non_fqdn_recipient

.....
```

Might also check mynetworks/mynetworks_style in /etc/postfix/main.cf

Also seems like you might want to update your main.cf using etc-update or similar?

```
* IMPORTANT: config file '/etc/postfix/main.cf' needs updating. 

* See the CONFIGURATION FILES section of the emerge 

* man page to learn how to update config files.
```

----------

## msulli1355

I took care of the etc-update thing.  I also openened up /etc/postfix/main.cf and added the line:

mynetworks = 192.168.0.0/28, 127.0.0.0/8

I restarted postfix, and then tried to re-merge festival.  At this point it's the only package that I know of that definitely tries to send logmail.  I got the familiar 

!!! An error occurred while trying to send logmail:

Connection unexpectedly closed

My /var/log/messages says:

Sep  5 10:35:11 camille postfix/smtpd[31523]: connect from camille.espersunited.com[192.168.0.3]

Sep  5 10:35:11 camille postfix/smtpd[31523]: fatal: no SASL authentication mechanisms

Sep  5 10:35:12 camille postfix/master[27613]: warning: process /usr/libexec/postfix/smtpd pid 31523 exit status 1

Sep  5 10:35:12 camille postfix/master[27613]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

What's next?

----------

## magic919

I can't view the howto.

Can you do a postconf -n | grep sasl and paste it.

----------

## msulli1355

michael@camille ~ $ sudo postconf -n | grep sasl

Password: 

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_path = private/auth

smtpd_sasl_type = dovecot

----------

## magic919

That's ok.  Can you confirm that Postfix is build with dovecot-sasl support too?

----------

## msulli1355

Calculating dependencies... done!

[ebuild   R    ] mail-mta/postfix-3.0.1-r1::gentoo  USE="berkdb dovecot-sasl eai ldap mysql pam sasl ssl -cdb -doc -hardened -ldap-bind -lmdb -mbox -memcached -nis -postgres (-selinux) -sqlite -vda" 0 KiB

----------

## freke

I was able to get the same result:

```
Sep 18 17:31:32 [postfix/smtpd] connect from ns.vlh.dk[127.0.0.1]

Sep 18 17:31:32 [postfix/smtpd] warning: SASL: Connect to private/auth failed: Connection refused

Sep 18 17:31:32 [postfix/smtpd] fatal: no SASL authentication mechanisms

Sep 18 17:31:32 [postfix/master] warning: process /usr/libexec/postfix/smtpd pid 16832 exit status 1

Sep 18 17:31:32 [postfix/master] warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
```

after shutting down Dovecot - has Dovecot been started (rc-status | grep dovecot)? - is it running (ps aux | grep dovecot)?

----------

## msulli1355

michael@camille ~ $ sudo rc-status | grep dovecot

 dovecot                                                           [  started  ]

michael@camille ~ $ sudo ps aux | grep dovecot

root      3176  0.0  0.0   3392  2232 ?        Ss   Sep14   0:00 /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf

dovecot   3404  0.0  0.0   3092  1704 ?        S    Sep14   0:00 dovecot/anvil

root      3405  0.0  0.0   3224  1948 ?        S    Sep14   0:00 dovecot/log

michael  19419  0.0  0.0   4636  2156 pts/4    S+   10:12   0:00 grep --colour=auto dovecot

michael@camille ~ $

----------

