# Where is Postfix SASL smtpd.conf for enhanced logging to see username failures?

**URL:** <https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459>\
**Category:** Virtualmin\
**Created:** [May 6, 2024, 6:14am UTC](https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459 "2024-05-06T06:14:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [May 6, 2024, 6:14am UTC](https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459/1 "2024-05-06T06:14:50Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Ubuntu 22.04 |
| Webmin version | 2.111 |
| Virtualmin version | 7.10.0 Pro |
| Related packages | Posfix |

Good morning,

I need to turn on Postfix SASL enhanced login. I want to see the usernames when there is a failure. The reason is we have a server with 100+ domains and 1000+ users. Often we these failures when SMTP is misconfigured:

```auto
2024-05-03 15:06:01 server postfix/smtpd[816492]: connect from a-b-c-d.ip.airmobile.co.za[a.b.c.d6] 
2024-05-03 15:06:03 server postfix/smtpd[816492]: warning: a-b-c-d.ip.airmobile.co.za[a.b.c.d]: SASL PLAIN authentication failed: authentication failure 
2024-05-03 15:06:06 server postfix/smtpd[816492]: warning: a-b-c-d.ip.airmobile.co.za[a.b.c.d]: SASL LOGIN authentication failed: authentication failure 
2024-05-03 15:06:08 server postfix/smtpd[816492]: warning: a-b-c-d.ip.airmobile.co.za[a.b.c.d]: SASL PLAIN authentication failed: authentication failure 
2024-05-03 15:06:09 server postfix/smtpd[816492]: warning: a-b-c-d.ip.airmobile.co.za[a.b.c.d]: SASL LOGIN authentication failed: authentication failure 
2024-05-03 15:06:09 server postfix/smtpd[816492]: lost connection after AUTH from a-b-c-d.ip.airmobile.co.za[a.b.c.d]

```

According to this Stack post if I turn on Postfix SASL to verbose level 4 I might be able to get usernames:

> <https://serverfault.com/questions/936269/log-username-in-maillogs-when-there-is-sasl-authentication-failure>

1. Try setting the logging level as log\_level:4 in smtpd.conf ( might be /usr/lib/sasl2/smtpd.conf )

2. In /etc/postfix/master.cf, add -v after a process like

```auto
smtp inet n - n - - smtpd -v

```

Finding `/etc/postfix/master.cf` is easy, but where is `smtpd.conf`? I looked in `/usr/lib/sasl2/` and there is no such file called `smtpd.conf`.

Incidentally we’re seeing this problem at lot more lately because the new version of Microsoft Outlook takes over IMAP and SMTP and proxies them via Microsoft’s servers. Sometimes this automated configuration gets the password wrong.

---

<div class="post-metadata">

**Author:** ![stefan1959](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@stefan1959](https://forum.virtualmin.com/u/stefan1959)\
**Post date:** [May 6, 2024, 8:45am UTC](https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459/2 "2024-05-06T08:45:24Z")

</div>

did you try the locate command  
 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/f/f26ad821eeab1f835a49caded6c1ff389ee1ee8f.png)

---

<div class="post-metadata">

**Author:** ![vander.host](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/vander.host/32/4430_2.png) [@vander.host](https://forum.virtualmin.com/u/vander.host)\
**Post date:** [May 6, 2024, 9:12am UTC](https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459/3 "2024-05-06T09:12:42Z")

</div>

Thanks @stefan1959 ,

I guess you’re using a Red Hat derivative?

For noobs like me, on my Ubuntu-based system:

```auto
ls -lah /etc/sasl2/smtpd.conf
ls: cannot access '/etc/sasl2/smtpd.conf': No such file or directory

```

Then

```auto
locate smtpd.conf
Command 'locate' not found, but can be installed with:
apt install mlocate

```

Then

```auto
apt install mlocate 

```

Wait 5 minutes “Initializing mlocate database; this may take some time…”

Then:

```auto
locate smtpd.conf
/etc/postfix/sasl/smtpd.conf

```

---

<div class="post-metadata">

**Author:** ![stefan1959](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@stefan1959](https://forum.virtualmin.com/u/stefan1959)\
**Post date:** [May 6, 2024, 9:15am UTC](https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459/4 "2024-05-06T09:15:18Z")

</div>

> [@vander.host](#):
>
> `smtpd -v`

This spews alot of extra stuff, can’t see a usernames though, turning it off 🙂

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [May 14, 2024, 9:16am UTC](https://forum.virtualmin.com/t/where-is-postfix-sasl-smtpd-conf-for-enhanced-logging-to-see-username-failures/126459/5 "2024-05-14T09:16:11Z")

</div>

Closed on May 14, 2024, 9:16am UTC

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
