Monday, September 19, 2022

Re: Mutt smtp configuration

> On Sun, Sep 18, 2022 at 23:09:28 -0400, Jaskaran Veer Singh wrote:
>> On Sun Sep 18, 2022 at 10:45 PM EDT, wrote:
>> > Hello
>> >
>> > I am new with Opensmtpd + Dovecot and with the fallowed configuration
>> i
>> > can get the mail; but i am not able to send mail using Mutt and
>> > Thunderbird i get this message: "SASL authentication failed"!
>>
>> IIRC, you have to open a ticket with vultr so they open port 25 for you.
>> It is
>> blocked by default.
>
> While it is true that port 25 shows as filtered in the nmap output
> (meaning OP will not be able to receive mail), this does not address
> their current problem. They are connecting on the submission port, 587.
> The submission port is correct for users on residential / otherwise
> dynamic connections to talk with their SMTP server (i.e. for submitting
> mail for relaying to other servers). And, indeed, it does show as open
> in the nmap output.

Thanks to respond.
We are using only imap pop and lmtp no submission.

>> > Mutt config:
>> > set hostname=mail.example.net
>> > set editor=nano
>> > set imap_user=user@example.net
>> > set imap_pass="passwd"
>> > set folder=imaps://$imap_user@mail.example.net
>> > set spoolfile=+INBOX
>> > set imap_check_subscribed
>> > set smtp_authenticators="login"
>> > set header_cache=~/.cache/mutt
>> > set message_cachedir="~/.cache/mutt"
>> > unset imap_passive
>> > set imap_keepalive=300
>> > set mail_check=180
>> > set record=+Sent
>> > set my_pass="passwd"
>> > set my_user='use@example.net'
>
> Are you setting $my_pass and $my_user in your .muttrc? mutt doesn't
> recognize these settings. It shouldn't affect sending mail, but I wonder
> what these lines are doing.

I dis a test with Thunderbird using these parameters, no one works:

imap conf:
Server amail.agroena.org port:993

Security setting:
ssl/tls
normal passwd (working correctly)

Smtp confog:
1. security ssl/tls port: 465
Nirmal passwd, no authentication.

2. security startls port: 587
normal passwd, no authentication.

i think that i might explain:
I have 3 mail server that were working correctly without Dovecot,
different configs; but they need virtual users!

>> > set realname='user'
>> > set from='user@example.net'
>> > set use_from=yes
>> > set smtp_pass="passwd"
>> > set smtp_url="smtp://$user:$user@smtp.example.net:587/"
>> > set ssl_force_tls=yes
>> > set ssl_starttls=yes
>
> Without seeing the rest of the smtpd configuration and log files, it's
> difficult to determine what the problem could be. This configuration is
> similar to what I use for my own server which works without issue. Are
> you sure that $ipv4 and $ipv6 are correct? I use interface names in my
> configuration, which are easier to get right than IP addresses
> (especially v6 addresses).

Full config:
# PKI for TLS
pki agroena.org cert "/etc/ssl/agroena.org.fullchain.pem"
pki agroena.org key "/etc/ssl/private/agroena.org.key"

# tables setup
table domains file:/etc/mail/domains
table passwd file:/etc/mail/passwd
table virtuals file:/etc/mail/virtuals
table hosts file:/etc/mail/hosts
table users file:/etc/mail/users

# Blocks junk mail
filter check_rdns phase connect match !rdns junk
filter check_fcrdns phase connect match !fcrdns junk
filter "dkimsign" proc-exec "filter-dkimsign -d agroena.org -s mail -k
/etc/mail/dkim/private.key" user _smtpd group _smtpd

# macros
ipv4 = "45.77.223.248"
ipv6 = "2001:19f0:5:3b4d:5400:04ff:fe1a:ee7b"
check = "pki agroena.org mask-src filter { check_rdns check_fcrdns }
hostname agroena.org"
authcheck = "pki agroena.org auth <passwd> mask-src senders <users> filter
{ check_rdns check_fcrdns dkimsign } hostname agroena.org"

# listeners
listen on socket filter "dkimsign"
listen on lo0 filter "dkimsign"
listen on $ipv4 port 25 tls $check
listen on $ipv6 port 25 tls $check
listen on $ipv4 port 465 smtps $authcheck
listen on $ipv6 port 465 smtps $authcheck
listen on $ipv4 port 587 tls-require $authcheck
listen on $ipv6 port 587 tls-require $authcheck

# rules
action "lmtp" lmtp "/var/dovecot/lmtp" rcpt-to virtual <virtuals>
action "outbound" relay src $ipv4

match from any for domain <domains> action "lmtp"
match from local for any action "outbound"
match from src <hosts> for any action "outbound"
match auth from any for any action "outbound"

>
> Have you checked your logs in /var/log/maillog when you try to
> authenticate with mutt/thunderbird? This should provide some more detail
> about what's going wrong.

From maillog:
Sep 20 05:41:53 agroena dovecot: auth-worker(40712): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<1>:
bsdauth(agro@agroena.org,24.80.5.31,<qiEQSRXpYL4YUAUf>): unknown user
(SHA1 of given password: 5d45051fa0b15c08b94d338ffb33dda01652d8e5) -
trying the next passdb
Sep 20 05:41:53 agroena dovecot: auth-worker(16454): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<1>:
bsdauth(agro@agroena.org,24.80.5.31,<zc0PSRXpWr4YUAUf>): unknown user
(SHA1 of given password: 5d45051fa0b15c08b94d338ffb33dda01652d8e5) -
trying the next passdb
Sep 20 05:41:53 agroena dovecot: auth-worker(40712): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<2>:
passwd(agro@agroena.org,24.80.5.31,<qiEQSRXpYL4YUAUf>): unknown user -
trying the next userdb
Sep 20 05:41:53 agroena dovecot: imap-login: Login:
user=<agro@agroena.org>, method=PLAIN, rip=24.80.5.31, lip=45.77.223.248,
mpid=33690, TLS, session=<qiEQSRXpYL4YUAUf>
Sep 20 05:41:53 agroena dovecot: auth-worker(40712): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<3>:
passwd(agro@agroena.org,24.80.5.31,<zc0PSRXpWr4YUAUf>): unknown user -
trying the next userdb
Sep 20 05:41:53 agroena dovecot: imap-login: Login:
user=<agro@agroena.org>, method=PLAIN, rip=24.80.5.31, lip=45.77.223.248,
mpid=18788, TLS, session=<zc0PSRXpWr4YUAUf>
Sep 20 05:41:53 agroena dovecot: auth-worker(40712): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<4>:
bsdauth(admin@agroena.org,24.80.5.31,<yFQTSRXp7s4YUAUf>): unknown user
(SHA1 of given password: e37a2178c21633f396315f93f63594dd80a9b737) -
trying the next passdb
Sep 20 05:41:53 agroena dovecot: auth-worker(16454): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<2>:
bsdauth(admin@agroena.org,24.80.5.31,<81ITSRXp8s4YUAUf>): unknown user
(SHA1 of given password: e37a2178c21633f396315f93f63594dd80a9b737) -
trying the next passdb
Sep 20 05:41:53 agroena dovecot: auth-worker(40712): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<5>:
passwd(admin@agroena.org,24.80.5.31,<yFQTSRXp7s4YUAUf>): unknown user -
trying the next userdb
Sep 20 05:41:53 agroena dovecot: auth-worker(16454): conn unix:auth-worker
(pid=10062,uid=518): auth-worker<3>:
passwd(admin@agroena.org,24.80.5.31,<81ITSRXp8s4YUAUf>): unknown user -
trying the next userdb
Sep 20 05:41:53 agroena dovecot: imap-login: Login:
user=<admin@agroena.org>, method=PLAIN, rip=24.80.5.31, lip=45.77.223.248,
mpid=57918, TLS, session=<yFQTSRXp7s4YUAUf>
Sep 20 05:41:53 agroena dovecot: imap-login: Login:
user=<admin@agroena.org>, method=PLAIN, rip=24.80.5.31, lip=45.77.223.248,
mpid=11834, TLS, session=<81ITSRXp8s4YUAUf>
> --
> Cheers,
> luna
>

No comments:

Post a Comment