I am trying to setup a mail service on a local Debian Buster/Sid.
This mail service should take input mails and direct them to these locations : - if mail is for "myownlocaldomain", it must be delivered to a local mailbox user. - elsewhere, the mail goes to our ISP smarthost, that delivers (or not) to destination.
So far, I use exim4 for this purpose. I have done this set up a long time ago and can not really remember how I did manage to make it work, but I did.
Users had trouble with this setup : when they make a typo in recipient address, they don't get immediate feedback. The mail goes through exim4 and generates immediatly "Recipient address rejected: Domain not found" in the log, but it takes time to notify the sender.
I have tried to shorten the retry and failing timers of exim4, in /etc/exim4/conf.d/retry/30_exim4-config :
"* * F,10m,2m"
I expected to have a retry every 2 minutes, then after 10 minutes the mail would bounce.
I have also edited the other config file ( /etc/default/exim4) to set : QUEUEINTERVAL='1m'
So far, I can not manage to produce the following result : trying a bit to send mail, for a little time, then fastly NOTIFY the sender if the mail can not be sent.
I expect the following behaviour when my server receives a mail from my local network:
mail to joe@localdomain goes to /home/joe/Maildir,
mail sent from joe@localdomain to jack@example.com is sent to jack@example.com, through ISP smarthost, with sender name rewritten to match our real mail address,
Any other mail goes to the ISP smarthost,
IN ANY OF THESE CASE, if the mail can not be delivered right now, the sender must be notified.
exim4 would be fine for me, but at this time I am too scared to break something that works so far, by trying to edit anything in /etc/exim4/conf.d.
Is there a way to sort out config files (with "option = my_value" lines), from the script files (with .ifndef and variables and code inside), from /etc/exim4 ?
I would be ok to backup my whole /etc/exim4 directory and try to modify some of these 47 files, but it would be easier to know where to start.
At this point, would I better to start from scratch, maybe with another MTA (qmail ? postfix ?) ? Or is there some trick I didn't understand with exim4, that would make it easier to understand and debug ?
Edit : I ran dpkg-reconfigure exim4-config and switched to the single config file option. There still are 47 files in /etc/exim4. I am glad emacs keeps a $file~ backup of every $file it alters : I have been able to check for files ending in "~", within /etc/exim4/conf.d/.
That is how I spotted this modification I made in /etc/exim4/conf.d/main/90_exim4-config_log_selector :
"# uncomment this for debugging
MAIN_LOG_SELECTOR == MAIN_LOG_SELECTOR +all -subject -arguments"
This is an edit I made a long time ago. I remember now. Tt says "uncomment this for debugging".
So : I am a total idiot missing something obvious about exim4 on Debian, or else it is designed to have 47 scripts already written, that you must edit here or there to configure.
I found the "exim -bP" command that nicely prints out current config, but it doesn't now show me WHERE in the config files.
I just have to keep track of any change in a separate file (isn't that what config files exist for ?), and/or know exim4 AND Debian enough to instantly think "that is in /etc/exim4/conf.d/foobar/number_description".
At this point I just decided to switch to anything else than "exim4 on Debian". I am going to try qmail, in the hope Debian didn't break it yet.