Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Exim aliases not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Sun Dec 25, 2022 10:27 am    Post subject: [solved] Exim aliases not working Reply with quote

Hi,

being prompted by ever growing exim mailqueue (triggered by Bug887339) i found out that my exim setup is not working as expect for local delivery and aliases.

Maildelivery to local user 'imap' is working as expected. Handed over to procmail and then showing up in my imap.
Mails to 'root' or 'munin' end up being stuck in exims mailqueue and are not pushed to imap.

Root is on the never to use list (as expected)
Quote:

User 0 set for local_delivery transport is on the fixed_never_users list

and munin has no homedir and no .maildir within then (also expected).
Quote:
Permission denied: cannot create /home/munin/.maildir


excerpt from /etc/mail/aliases
Code:

root: imap
munin: imap
....


Test output for some users would be:
Code:

 exim -bt root
root@foo.bar1
  router = localuser, transport = local_delivery

 exim -bt munin
munin@foo.bar1
  router = localuser, transport = local_delivery

exim -bt imap
imap@foo.bar1 -> |/bin/sh -c "IFS=' ' && exec /usr/bin/procmail -Yf- || exit 75 #...
  transport = address_pipe


exim.conf is more or less default with only domainlist/hostlist being specific to my system what i can see. It also has a alias part which uses /etc/mail/aliases.
I also invoked newaliases after each change and restarted exim. But it seems aliases are to considered - neither when testing with exim -bt or if i send an actual mail with "echo test2 | mailx root".

Code:

system_aliases:
  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup{$local_part_data}lsearch{/etc/mail/aliases}}
# user = exim
  file_transport = address_file
  pipe_transport = address_pipe


Any hints how to narrow down why my aliases are not used or is that expected and such kind of redirection is not what i should expect?

Thanks!


Last edited by s|mon on Wed Jun 28, 2023 6:56 am; edited 1 time in total
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 431
Location: Leeds

PostPosted: Mon Dec 26, 2022 1:52 pm    Post subject: Reply with quote

Hey
Do you see any errors in "journalctl -fb -u exim" when you restart the service? Are other aliases working?
_________________
# touch it
touch: cannot touch `it': Permission denied
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Mon Dec 26, 2022 4:58 pm    Post subject: Reply with quote

I am not using systemd, but i don't get any error entries in my logs either. Just the expected stoping/starting exim.
The other aliases in there were not created by me (assuming auto/scripts) and are mostly redirecting to root so not much to test with them.

If i create an alias in /etc/mail/aliases for a non existing user foo and test it it shows
Quote:
foo@foo.bar1 is undeliverable: Unknown user


Any alias for an existing user is also not used and mail is delivered to this users maildir.
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 431
Location: Leeds

PostPosted: Mon Dec 26, 2022 5:18 pm    Post subject: Reply with quote

Does /etc/mail/aliases have 644 permissions set?

Is the "system_aliases" section in exim.conf come after "begin routers"
_________________
# touch it
touch: cannot touch `it': Permission denied
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Tue Dec 27, 2022 12:43 pm    Post subject: Reply with quote

Permissions seem to be ok.
-rw-r--r-- 1 root root 918 Dec 26 17:51 aliases


"system_aliasses" comes after "begin routers" with "dnslookup" being in between both.
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 431
Location: Leeds

PostPosted: Tue Dec 27, 2022 2:00 pm    Post subject: Reply with quote

ok.. I don't use procmail so I can't say for sure where it's breaking, but I do use exim. If I test an alias, this is the output.
Code:
$ exim -bt aliasuser
localuser@fqdn
    <-- aliasuser@fqdn
  router = localuser, transport = local_delivery


So I'm thinking that it's not exim, but procmail that may be messing things up. Does procmail have aliases configured also?
_________________
# touch it
touch: cannot touch `it': Permission denied
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Tue Dec 27, 2022 7:20 pm    Post subject: Reply with quote

Not sure if procmail is in the loop at all. Even for users which are handled directly without procmail the alias does not apply.
As you see in the differences between our output there is no hint that on my system aliases are picked up.
Maybe i'll make a backup and fiddle around with exim.conf just to test but that is a bit pocking in the dark.
Thanks nevertheless
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 431
Location: Leeds

PostPosted: Tue Dec 27, 2022 7:35 pm    Post subject: Reply with quote

No worries. I'll let you know if I have any sudden moments of inspiration.
_________________
# touch it
touch: cannot touch `it': Permission denied
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 431
Location: Leeds

PostPosted: Sun Jun 25, 2023 1:56 pm    Post subject: Reply with quote

I know this is getting on a bit, but ironically mine have just stopped working :( Unfortunately 99% of my email goes to aliases, sooooo... The only thing that I think may have broken it is openssl-3. I got patched from 1.1.1u to 3.0.9 and exim gets rebuilt as a result.
I've downgraded but no change. I even upgraded to 3.1.1-r1 but still nothing. I'm sure I've read a few threads where openssl-3 has caused other damage.

Did you have any luck in the end?
_________________
# touch it
touch: cannot touch `it': Permission denied
Back to top
View user's profile Send private message
cdstealer
Guru
Guru


Joined: 30 Oct 2005
Posts: 431
Location: Leeds

PostPosted: Sun Jun 25, 2023 6:23 pm    Post subject: Reply with quote

Ah fixed it! The data line from the "system_aliases" block had changed slightly. I checked exim.conf.dist and compared, swapped "data = ${lookup{$local_part_data@$domain}lsearch{/etc/mail/aliases}}" for "data = ${lookup{$local_part}lsearch{/etc/mail/aliases}}" and all working again :)
_________________
# touch it
touch: cannot touch `it': Permission denied
Back to top
View user's profile Send private message
s|mon
Apprentice
Apprentice


Joined: 04 Jul 2004
Posts: 209
Location: Bayern [de]

PostPosted: Wed Jun 28, 2023 6:55 am    Post subject: Reply with quote

Thanks for the update!
Changed the same and now it seems to work as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum