So… I guess I thought I was smart enough to set up a Debian server all by myself… and it looks like I’m not even able to get basic email to work! :roll: Bleh…

I could set up apache, php, mysql and have everything working… but email ? What the hell is going on?

I sorta had exim4 installed automatically while apt-get installing mysql-4.1 . I also installed mutt so I could “read” any mail. But that damn thing won’t save any email to /var/mail !! I think there should be a file named ‘root’ (at least) in there, but there is not.

All I know, is that I can use ‘mail’ to send email to an external machine. But I can’t use mail to send a local mail to root.

I get lines like these in /var/log/exim4/mainlog:

2x0x-05-27 01:18:17 1FjlZR-0007Wy-Gx == /var/mail/mail (root@ns34611.ovh.net) <root@ns0x0x0.ovh.net> R=mail4root T=address_file defer (13): Permission denied: creating lock file hitching post /var/mail/mail.lock.ns0x0x0.ovh.net.0x0x0cb9.0000711b (euid=8 egid=8)

The exim process seems to be running under Debian-exim4 and the permission for /var/mail seems to be drwxr-sr-x root root

Now of course I can make it work by funkying around with the permissions of that folder, but that doesn’t feel right… Besides I wonder what magic that ’s’ is trying to accomplish…

Is there a caring soul out there willing to show me the light? I’m so lost right now… Thanx!! ;)

Update:

I think I need to log what I did here… might get useful someday…

First, these are my new /var/mail permissions:
drwxrwxr-x root mail

Once that is done, exim will create mail files in the directory and I’m able read them with mutt… for all users, except for root. Because for toot, exim insists on creating a file named mail instead of root. I wonder why…

At that point, comes the whole exim4-conf trouble again. For some subtle reason the exim4 config in Debian is handled in the weirdest way. I might get it some day, but for now I just have to struggle with it… :-/

So I copied /var/lib/exim4/config.autogenerated (the file
generated by update-exim4.conf) over to /etc/exim4/exim4.conf and then edited that one, especially this part:

mail4root:
  debug_print = "R: mail4root for $local_part@$domain"
  driver = redirect
  domains = +local_domains
  data = /var/mail/<strong>root</strong>
  file_transport = address_file
  local_parts = root
  user = mail
  group = mail

data = /var/mail/root here solved my problem.

Update: I think I should be able to make this mod directly in exim4.conf.template so it gets included in the autogeneration.

The funniest part is I didn’t stop there! I moved on to breaking the whole thing again by installing the Courier IMAP server, which needs its mail delivered to ~/Mailbox instead of /var/mail. (Here’s a fairly useful page about this).

That means editing /etc/exim4/update-exim4.conf.conf manually to add this:
dc_localdelivery=maildir_home

And then go through the copy /var/lib/exim4/config.autogenerated over to /etc/exim4/exim4.conf again.

The good news is: it finally works!
(still gotta check on the ’s’ trick though…)


Comments from long ago:

Comment from: rosy

I read this post and wondering if
you could help me in sending mail
through php mail function.
I tried using command line argument and
it works fine.
I am using Debian, exim 3.36, php 4,
Apache and MySQL.
Thanks.

2006-11-16 19-22