Need some help with postfix+dovecot+mysql

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

Need some help with postfix+dovecot+mysql

Postby mark9117 » Dec 26th, '19, 21:09

5.4.6-desktop-2.mga7
dovecot-2.3.7.2-1.1.mga7
postfix-3.4.5-1.mga7
mysql Ver 15.1 Distrib 10.3.20-MariaDB, for Linux (x86_64) using readline 5.1

After upgrading my server to Mageia 7, I was unable to get my mail server (local email on my LAN only with 2 users: root and madams) to work after restoring backup configs. I eventually decided to just rebuild the mail server. I went from postfix+cyrus+mysql to the postfix+dovecot+mysql solution.

Trouble is, I can't get it to work. I've been through a dozen or so tutorials and read everything I can find (and make sense of). I can use telnet to send mail, but it never shows up anywhere. I presented this issue to the postfix users' mailing list and they pointed at dovecot. I was prepared to send a help request to the dovecot folks, but I am not convinced that Postfix is working. I can send email with telnet with no error:

Code: Select all
$ mail root@shuttle
Subject: testing

test

.
EOT
[madams@shuttle ~]$


My configuration is designed to use mbox mailboxes rather than Maildir. It's a small informal system and mbox has been fine for years now. I'm sticking with it. I can check my mbox with Webmin and the last mail that ran was on 12/22/19 despite the fact that I have 2 other machines sending admin messages to this server at least once a day. If my reading of that mbox file via Webmin is correct, nothing is appearing in those boxes.

Here is my postfix config:

Code: Select all
# postconf -n
alias_database = hash:/etc/postfix/aliases.db
alias_maps = hash:/etc/postfix/aliases
biff = no
compatibility_level = 2
debug_peer_list = 127.0.0.1
inet_interfaces = all
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 0
mailbox_transport = lmtp:unix:private/dovecot-lmtp
mydestination = shuttle, localhost, localhost.localdomain
myhostname = shuttle.local
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $myhostname
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/adams-lan.mail.pem
smtpd_tls_key_file = /etc/ssl/private/adams-lan.mail.key
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_transport = lmtp:unix:private/dovecot-lmtp


There was some information about a lack of reference to transport maps, lmpt or any other dovecot information. I'm down to just following information I can find on the Internet. I haven't located anything particularly helpful. Same goes for dovecot. Here is my config on it:

Code: Select all
# dovecot -n
# 2.3.7.2 (3c910f64b): /etc/dovecot/dovecot.conf
# OS: Linux 5.4.6-desktop-2.mga7 x86_64 Mageia 7
# Hostname: shuttle
disable_plaintext_auth = no
first_valid_uid = 10001
last_valid_uid = 10001
mail_gid = 10001
mail_location = mbox:~/:INBOX=/var/spool/mail/%u
mail_privileged_group = mail
mail_uid = 10001
passdb {
  driver = pam
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
ssl_cert = </etc/pki/tls/certs/adams-lan.mail.pem
ssl_key = # hidden, use -P to show it
userdb {
  driver = passwd
}


I know nothing about dovecot, so I'm just following advice on the internt.

All this is hampered by the fact that everything seems to test good as far as connectivity is concerned and the tutorials I'm finding don't really provide much troubleshooting beyond that. I can see that ports are open and listening:

Code: Select all
PORT    STATE SERVICE VERSION
25/tcp  open  smtp    Postfix smtpd
110/tcp open  pop3    Dovecot pop3d
143/tcp open  imap    Dovecot imapd
993/tcp open  imaps?
995/tcp open  pop3s?
Service Info: Host:  shuttle.local


I can connect to those imap and pop3 ports (either telnet or openssl) locally on the server or remotely from my desktop, and authenticate on them without error. I can list folders and see that the folders I expect to be there are not.

Code: Select all
$ telnet shuttle 143
Trying 192.168.1.105...
Connected to shuttle.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN] Dovecot ready.
a login madams xxxxxxxxxx
a OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY LITERAL+ NOTIFY] Logged in


I haven't figured out a way to read those files. the "mailx" command shows old messages when my user connects on the server, but from my desktop the mail command shows "no mail".

EDIT: I have found the imap commands that allows me to access mailbox contents. Old messages are there. Postfix is not delivering any new messages. I still think there is an issue with postfix.


The mail spools seem to be owned and permissioned correctly:

Code: Select all
# ll /var/spool/mail
total 6128
-rw-rw---- 1 apache  mail  284135 Dec 23 11:36 apache
-rw-rw---- 1 madams  mail 5947463 Dec 26 11:30 madams
-rw-rw---- 1 postfix mail   23170 Dec 14 04:02 postfix
-rw-rw---- 1 root    mail    4859 Dec 23 15:15 root


Does anybody have any suggestions as to how I can troubleshoot this? At this point, I'm not finding much help out there.

Thanks.

Mark
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Need some help with postfix+dovecot+mysql

Postby mark9117 » Dec 27th, '19, 01:34

Have continued to work on the situation and now I have some potentially helpful information showing up in the logs. Journalctl is showing a bounce:

Code: Select all
Dec 26 16:27:18 shuttle postfix/smtp[23705]: AA2814A44F8: to=<madams@pvr>, relay=none, delay=0.09, delays=0.04/0/0.05/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=pvr type=AAAA: Host not found)


I've never had AAAA records on this server, I don't see why I might need them now and have no idea where to put them or how to create them.

But where is it looking for host/domain name? I'm still digging, but help is welcome.

EDIT: I'm going to post that whole error block because something else is going on with hostname translation. I don't know if it's important.

First, here is the outgoing email from a remote user:

Code: Select all
$ echo "Subject: Test" | /usr/lib/sendmail -v root@shuttle
[<-] 220 shuttle.local ESMTP Postfix
[->] HELO pvr
[<-] 250 shuttle.local
[->] MAIL FROM:<madams@pvr>
[<-] 250 2.1.0 Ok
[->] RCPT TO:<root@shuttle>
[<-] 250 2.1.5 Ok
[->] DATA
[<-] 354 End data with <CR><LF>.<CR><LF>
[->] Received: by pvr (sSMTP sendmail emulation); Thu, 26 Dec 2019 17:17:05 -0700
[->] From: "Mark Adams" <madams@pvr>
[->] Date: Thu, 26 Dec 2019 17:17:05 -0700
[->] Subject: Test
[->]
[->] .
[<-] 250 2.0.0 Ok: queued as A71FD4A4343
[->] QUIT
[<-] 221 2.0.0 Bye


And here is the information that appears on the log as a result:

Code: Select all
Dec 26 17:17:05 shuttle postfix/smtpd[1043]: connect from pvr[192.168.1.103]
Dec 26 17:17:05 shuttle postfix/smtpd[1043]: A71FD4A4343: client=pvr[192.168.1.103]
Dec 26 17:17:05 shuttle postfix/cleanup[1048]: A71FD4A4343: message-id=<>
Dec 26 17:17:05 shuttle postfix/qmgr[31697]: A71FD4A4343: from=<madams@pvr>, size=323, nrcpt=1 (queue active)
Dec 26 17:17:05 shuttle postfix/smtpd[1043]: disconnect from pvr[192.168.1.103] helo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Dec 26 17:17:05 shuttle postfix/smtp[1049]: A71FD4A4343: to=<root@shuttle>, relay=none, delay=0.09, delays=0.05/0.01/0.03/0, dsn=5.4.4, status=bounced (Host or do>
Dec 26 17:17:05 shuttle postfix/bounce[1050]: warning: midna_domain_to_utf8_create: Problem translating domain "shuttle.local" to UTF8 form: U_FILE_ACCESS_ERROR
Dec 26 17:17:05 shuttle postfix/bounce[1050]: warning: [built-in]: conversion "myhostname" failed: input value: "shuttle.local"
Dec 26 17:17:05 shuttle postfix/cleanup[1048]: C62AE4A4390: message-id=<20191227001705.C62AE4A4390@shuttle.local>
Dec 26 17:17:05 shuttle postfix/bounce[1050]: A71FD4A4343: sender non-delivery notification: C62AE4A4390
Dec 26 17:17:05 shuttle postfix/qmgr[31697]: C62AE4A4390: from=<>, size=2271, nrcpt=1 (queue active)
Dec 26 17:17:05 shuttle postfix/qmgr[31697]: A71FD4A4343: removed
Dec 26 17:17:05 shuttle postfix/smtp[1049]: C62AE4A4390: to=<madams@pvr>, relay=none, delay=0.08, delays=0.03/0/0.05/0, dsn=5.4.4, status=bounced (Host or domain >
Dec 26 17:17:05 shuttle postfix/qmgr[31697]: C62AE4A4390: removed
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Need some help with postfix+dovecot+mysql

Postby doktor5000 » Dec 27th, '19, 15:39

mark9117 wrote:
Code: Select all
Dec 26 16:27:18 shuttle postfix/smtp[23705]: AA2814A44F8: to=<madams@pvr>, relay=none, delay=0.09, delays=0.04/0/0.05/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=pvr type=AAAA: Host not found)


I've never had AAAA records on this server, I don't see why I might need them now and have no idea where to put them or how to create them.

But where is it looking for host/domain name? I'm still digging, but help is welcome.


AAAA records are DNS entries for IPv6 adresses. IPv4 would be A records. It's looking them up in the hosts database, and the order is configured in /etc/nsswitch.conf.

Usually it would be looking them up in your /etc/hosts by default. Do you have an entry in there for the machine called pvr ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Need some help with postfix+dovecot+mysql

Postby mark9117 » Dec 27th, '19, 19:13

Thank you for the attention.

Yes, that machine operates on a static IP and is listed in my hosts file.
Last edited by doktor5000 on Dec 28th, '19, 03:21, edited 1 time in total.
Reason: removed fullquote
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Need some help with postfix+dovecot+mysql

Postby mark9117 » Dec 28th, '19, 02:06

I've limited the protocols to ipv4 and it is no longer looking for AAAA record, but there are still issues:

Code: Select all
Dec 27 15:13:00 shuttle postfix/bounce[10874]: warning: midna_domain_to_utf8_create: Problem translating domain "shuttle.localhost" to UTF8 form: U_FILE_ACCESS_ERROR
Dec 27 15:13:00 shuttle postfix/bounce[10874]: warning: [built-in]: conversion "myhostname" failed: input value: "shuttle.localhost"


I can't figure out why the input value is failing. I've tried a number of entries for "myhostname" and it makes no difference. Specifics on a U_FILE_ACCESS_ERROR seem rare. I've not learned much from google about this one.

And

Code: Select all
Dec 27 15:27:32 shuttle postfix/smtp[12543]: 218414A45CA: to=<madams@pvr>, relay=none, delay=0.08, delays=0.04/0/0.03/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=pvr type=A: Host not found)


The Internet seems to point toward a DNS issue. For the record:

Code: Select all
dig shuttle

; <<>> DiG 9.11.6Mageia-1.1.mga7 <<>> shuttle
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 35202
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;shuttle.                       IN      A

;; AUTHORITY SECTION:
.                       3600    IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2019122702 1800 900 604800 86400

;; Query time: 16 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Fri Dec 27 15:42:20 MST 2019
;; MSG SIZE  rcvd: 111



Code: Select all
 dig pvr

; <<>> DiG 9.11.6Mageia-1.1.mga7 <<>> pvr
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 53514
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pvr.                           IN      A

;; AUTHORITY SECTION:
.                       3600    IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2019122702 1800 900 604800 86400

;; Query time: 16 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Fri Dec 27 15:40:42 MST 2019
;; MSG SIZE  rcvd: 107


My /etc/resolve.conf file reads:

Code: Select all
# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 208.67.222.222
nameserver 208.67.220.220


I don't see how that could come into play since I'm trying to run mail on my internal lan. On the other hand, is Postfix expecting to find my lan machines on those nameservers? Because they aren't going to show up there.

Now, I've been tinkering with this setup and for some reason, I'm getting another erorr:

Code: Select all
 send-mail: RCPT TO:<root@shuttle> (550 5.1.1 <root@shuttle>: Recipient address rejected: User unknown in virtual mailbox table)


I'm going to have to step away for awhile. I'm considering just restoring default configs and trying to start fresh tomorrow.

Email servers kill me. I wish I knew what I was doing here.
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.

Re: Need some help with postfix+dovecot+mysql

Postby doktor5000 » Dec 28th, '19, 03:23

Could you please post the contents of /etc/hostname and also the respective full entries as they are listed in /etc/hosts ? The one for the machine pvr and the one for your actual hostname, which seems to be shuttle.localhost ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18052
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Need some help with postfix+dovecot+mysql

Postby mark9117 » Dec 28th, '19, 06:30

doktor5000 wrote:Could you please post the contents of /etc/hostname and also the respective full entries as they are listed in /etc/hosts ? The one for the machine pvr and the one for your actual hostname, which seems to be shuttle.localhost ?


Shuttle (mail server):

Code: Select all
# cat /etc/hostname
shuttle


Code: Select all
192.168.1.1             gateway
192.168.0.1             modem
127.0.0.1               localhost
192.168.1.100           adamsmdk
#192.168.1.101          chrisq 
#192.168.1.102          alexa
192.168.1.103           pvr
#192.168.1.104          games
192.168.1.105           shuttle
192.168.1.106           spike
192.168.1.107           buffy
205.171.3.65            DNS1
205.171.2.65            DNS2



PVR (another machine)

Code: Select all
# cat /etc/hostname
pvr


Code: Select all
# cat /etc/hosts
192.168.1.1             gateway
192.168.0.1             modem
127.0.0.1               localhost
192.168.1.100           adamsmdk
#192.168.1.101          chrisq 
#192.168.1.102          alexa
192.168.1.103           pvr
#192.168.1.104          games
192.168.1.105           shuttle
192.168.1.106           spike
205.171.3.65            DNS1
205.171.2.65            DNS2
Let's just reboot everything all the time.
User avatar
mark9117
 
Posts: 395
Joined: Sep 12th, '11, 20:32
Location: Eastern New Mexico -- Not Hell, but you can see it from here.


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron