posfix setup for internal mail only (from root etc) to be read by thunderbird; fedora 36

garberw

New Member
Joined
Sep 8, 2022
Messages
2
Reaction score
0
Credits
80
Digital Ocean tutorial explains how to set up dovecot and postfix so you can for example read internal emails sent from cron jobs etc to root.
can anyone help me get this working please?

my postfix config is
[email protected]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
compatibility_level = 3.6
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = all
inet_protocols = all
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mail_owner = postfix
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = mail.electron.localdomain, $myhostname, localhost.$mydomain, localhost
myhostname = electron.localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
recipient_delimiter = +
relayhost =
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_cert_file = /etc/ssl/certs/mailcert.pem
smtpd_tls_key_file = /etc/ssl/private/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
unknown_local_recipient_reject_code = 550
[email protected]#

dovecot config

[email protected]#
[email protected]# cat /etc/dovecot/dovecot.conf
disable_plaintext_auth = no
mail_privileged_group = mail
mail_location = mbox:~/mail:INBOX=/var/mail/%u
userdb {
driver = passwd
}
passdb {
args = %s
driver = pam
}
protocols = "pop3 imap"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
}
ssl=required
ssl_cert = </etc/ssl/certs/mailcert.pem
ssl_key = </etc/ssl/private/mail.key
[email protected]#


[email protected]# systemctl status dovecot
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2022-09-08 11:40:31 PDT; 1h 5min ago
Docs: man:dovecot(1)
https://doc.dovecot.org/
Process: 1604 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 1637 (dovecot)
Status: "v2.3.19.1 (9b53102964) running"
Tasks: 5 (limit: 38081)
Memory: 9.1M
CPU: 630ms
CGroup: /system.slice/dovecot.service
├─ 1637 /usr/sbin/dovecot -F
├─ 1646 dovecot/anvil
├─ 1647 dovecot/log
├─ 1648 dovecot/config
└─ 4957 dovecot/stats

Sep 08 11:49:48 electron.localdomain dovecot[1647]: pop3-login: Error: Failed to initialize SSL server context: Can't load SSL private key (ssl_key setting): Key is for a different cert than ssl_cert: user=<>, rip=::1, lip=::1, secured, session=<eMTV5C7ososAAAAAAAAAAAAAAAAAAAAB>
Sep 08 11:49:48 electron.localdomain dovecot[1647]: pop3-login: Disconnected: TLS initialization failed. (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<eMTV5C7ososAAAAAAAAAAAAAAAAAAAAB>
Sep 08 11:52:01 electron.localdomain dovecot[1647]: pop3-login: Error: Failed to initialize SSL server context: Can't load SSL private key (ssl_key setting): Key is for a different cert than ssl_cert: user=<>, rip=::1, lip=::1, secured, session=<+X627C7oEocAAAAAAAAAAAAAAAAAAAAB>
Sep 08 11:52:01 electron.localdomain dovecot[1647]: pop3-login: Disconnected: TLS initialization failed. (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<+X627C7oEocAAAAAAAAAAAAAAAAAAAAB>
Sep 08 12:03:37 electron.localdomain dovecot[1647]: pop3-login: Error: Failed to initialize SSL server context: Can't load SSL private key (ssl_key setting): Key is for a different cert than ssl_cert: user=<>, rip=::1, lip=::1, secured, session=<cyg/Fi/oWJUAAAAAAAAAAAAAAAAAAAAB>
Sep 08 12:03:37 electron.localdomain dovecot[1647]: pop3-login: Disconnected: TLS initialization failed. (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<cyg/Fi/oWJUAAAAAAAAAAAAAAAAAAAAB>
Sep 08 12:34:46 electron.localdomain dovecot[1647]: pop3-login: Error: Failed to initialize SSL server context: Can't load SSL private key (ssl_key setting): Key is for a different cert than ssl_cert: user=<>, rip=::1, lip=::1, secured, session=<2DCdhS/opNkAAAAAAAAAAAAAAAAAAAAB>
Sep 08 12:34:46 electron.localdomain dovecot[1647]: pop3-login: Disconnected: TLS initialization failed. (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<2DCdhS/opNkAAAAAAAAAAAAAAAAAAAAB>
Sep 08 12:41:43 electron.localdomain dovecot[1647]: pop3-login: Error: Failed to initialize SSL server context: Can't load SSL private key (ssl_key setting): Key is for a different cert than ssl_cert: user=<>, rip=::1, lip=::1, secured, session=<Hn+Ani/ossAAAAAAAAAAAAAAAAAAAAAB>
Sep 08 12:41:43 electron.localdomain dovecot[1647]: pop3-login: Disconnected: TLS initialization failed. (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<Hn+Ani/ossAAAAAAAAAAAAAAAAAAAAAB>
~






maybe there is something wrong with /etc/hosts
[email protected]#
[email protected]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.8 electron.localdomain electron
192.168.1.4 photon
192.168.1.46 laptop
192.168.0.5 proton
192.168.0.6 weathera
192.168.0.7 weatherb
[email protected]#

[email protected]# hostname --fqdn
electron.localdomain
[email protected]# hostname
electron.localdomain
[email protected]#

[email protected]# cat /etc/aliases
........ etc ........
# trap decode to catch security attacks
decode: root

# Person who should get root's mail
#root: marc
# garberw
# root: <deleted by Administrator>
root: [email protected]
[email protected]#

and I ran "newaliases"

[email protected]#
[email protected]# cat /root/.forward
[email protected]
[email protected]#

### test email
[email protected]# mail -s "testing" root
sample email text
^D
EOF
[email protected]#


setup for thunderbird

email address = [email protected]
server name = pop3.localhost.localdomain
port = 110
default port = 110
user name = garberw
connection security = STARTTLS
authentication method = normal password

This above is what the auto account config came up with.
I have tried lots of other things like listing the email address as [email protected]
but nothing else came close. These settings are the only ones I could get to even create
an account.
In the left folder panel of thunderbird if I right mouse click on the name of the account
then select "get messages" (for this account) nothing happens e.g. it does not download any mail.
 
Last edited by a moderator:


OP
G

garberw

New Member
Joined
Sep 8, 2022
Messages
2
Reaction score
0
Credits
80
turns out the above DOES work. Just had to fix the dovecot error by installing cyrus-imapd to get /etc/pam.d/pop and then symbolic link that file to pop3 in same directory.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Latest posts

Top