Exim4 delivers mail to mail instead to root

For interesting topics. But remember this is a Linux Forum. Do not post offensive topics that are meant to cause trouble with other members or are derogatory towards people of different genders, race, color, minors (this includes nudity and sex), politics or religion. Let's try to keep peace among the community and for visitors.

No spam on this or any other forums please! If you post advertisements on these forums, your account may be deleted.

Do not copy and paste entire or even up to half of someone else's words or articles into posts. Post only a few sentences or a paragraph and make sure to include a link back to original words or article. Otherwise it's copyright infringement.

You can talk about other distros here, but no MX bashing. You can email the developers of MX if you just want to say you dislike or hate MX.
Message
Author
brad
Posts: 49
Joined: Fri Apr 09, 2021 6:41 pm

Exim4 delivers mail to mail instead to root

#1 Post by brad »

Linux mx-linux 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux

I just wanted to use exim4 instead sendmail or postfix which btw works great.
If anybody can understand and reproduce this issue please help, for the ones who copy and paste from google please refrain, I did search.

I configured local-only (no network):

Code: Select all

dpkg-reconfigure exim4-config
and

Code: Select all

update-exim4.conf
Thanks!
Last edited by brad on Tue Nov 22, 2022 9:24 pm, edited 4 times in total.

brad
Posts: 49
Joined: Fri Apr 09, 2021 6:41 pm

Re: Exim4 fails to deliver mail

#2 Post by brad »

mail is delivered to users but not to root. Instead /var/mail/root all mail is delivered to /var/mail/mail

2022-11-21 14:55:41 1oxCtJ-0009R0-Cd => /var/mail/mail (root@mx-linux) <root@mx-linux> R=mail4root T=address_file

Code: Select all

root@mx-linux:/var/mail# tail /var/log/exim4/mainlog
2022-11-21 14:46:13 End queue run: pid=35890
2022-11-21 14:47:51 1oxClj-0009PG-PK <= root@mx-linux U=root P=local-esmtp S=432 id=a8d4d2d2-66dc-34b-f222-27821553cbe4@mx-linux
2022-11-21 14:47:52 1oxClj-0009PG-PK => /var/mail/mail (root@mx-linux) <root@mx-linux> R=mail4root T=address_file
2022-11-21 14:47:52 1oxClj-0009PG-PK => brad <brad@mx-linux> R=local_user T=mail_spool
2022-11-21 14:47:52 1oxClj-0009PG-PK Completed
2022-11-21 14:55:41 1oxCtJ-0009R0-Cd <= root@mx-linux U=root P=local S=321
2022-11-21 14:55:41 1oxCtJ-0009R0-Cd => /var/mail/mail (root@mx-linux) <root@mx-linux> R=mail4root T=address_file
2022-11-21 14:55:41 1oxCtJ-0009R0-Cd Completed
2022-11-21 15:16:29 Start queue run: pid=38616
2022-11-21 15:16:29 End queue run: pid=38616

Code: Select all

root@mx-linux:/var/mail# ll
total 720
drwxrwsrwt  2 root mail   4096 Nov 21 14:55 ./
drwxr-xr-x 13 root root   4096 Jan 14  2022 ../
-rw-rw----  1 brad mail   4430 Nov 21 14:52 brad
-rw-------  1 mail mail 716127 Nov 21 14:55 mail
-rw-------  1 root mail      0 Oct  8  2021 root
I added mail: root but still delivers to mail

Code: Select all

root@mx-linux:/var/mail# cat /etc/aliases
# /etc/aliases
mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
backuppc: root
mail: root
Last edited by brad on Tue Nov 22, 2022 9:18 pm, edited 2 times in total.

brad
Posts: 49
Joined: Fri Apr 09, 2021 6:41 pm

Re: Exim4 deliver mail to mail instead to root

#3 Post by brad »

so what is the workaround folks? Maybe I am not setting the /etc/aliases correctly?

Code: Select all

### router/mmm_mail4root
1446 #################################
1447 # deliver mail addressed to root to /var/mail/mail as user mail:mail
1448 # if it was not redirected in /etc/aliases or by other means
1449 # Exim cannot deliver as root since 4.24 (FIXED_NEVER_USERS)

User avatar
FullScale4Me
Posts: 1107
Joined: Fri Jan 08, 2021 11:30 pm

Re: Exim4 deliver mail to mail instead to root

#4 Post by FullScale4Me »

A quick search gives exim4 cannot send email to root (all localhost users) There are two issues on that page with fixes. There could be more.

Google search term used

Code: Select all

exim4 route to root on localhost
Michael O'Toole
MX Linux facebook group moderator
Dell OptiPlex 7050 i7-7700, MX Linux 23 Xfce & Win 11 Pro
HP Pavilion P2-1394 i3-2120T, MX Linux 23 Xfce & Win 10 Home
Dell Inspiron N7010 Intel Core i5 M 460, MX Linux 23 Xfce & KDE, Win 10

brad
Posts: 49
Joined: Fri Apr 09, 2021 6:41 pm

Re: Exim4 deliver mail to mail instead to root

#5 Post by brad »

FullScale4Me wrote: Mon Nov 21, 2022 8:31 pm A quick search gives exim4 cannot send email to root (all localhost users) There are two issues on that page with fixes. There could be more.

Google search term used

Code: Select all

exim4 route to root on localhost
Have you been successful with any of those?

User avatar
figueroa
Posts: 1104
Joined: Thu Dec 20, 2018 11:20 pm

Re: Exim4 delivers mail to mail instead to root

#6 Post by figueroa »

Run newaliases after making changes to your aliases file. Usually, all mail to root is redirected to a real user with a line in aliases like:

Code: Select all

# Put your local aliases here.
root:          user@domain
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

brad
Posts: 49
Joined: Fri Apr 09, 2021 6:41 pm

Re: Exim4 delivers mail to mail instead to root

#7 Post by brad »

figueroa wrote: Mon Nov 21, 2022 10:14 pm Run newaliases after making changes to your aliases file. Usually, all mail to root is redirected to a real user with a line in aliases like:

Code: Select all

# Put your local aliases here.
root:          user@domain
FYI: You don't need to run newaliases on an exim system, it's just provided as a compatibility layer for applications expecting a more "sendmail-like" environment. Exim directly scans the contents of the /etc/aliases file the first time it reads it and caches results, remembering it for subsequent lookups if there are any. It doesn't actually use the /etc/aliases.db file like sendmail does.

User avatar
figueroa
Posts: 1104
Joined: Thu Dec 20, 2018 11:20 pm

Re: Exim4 delivers mail to mail instead to root

#8 Post by figueroa »

Thanks, @brad
I've never actually used exim. I made assumptions. I actually use postfix, courier-imap, procmail with associated tools. I first learned mail under Unix so I'm a dinosaur.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

Post Reply

Return to “General”