-1

We are running a mail server with postfix mta. But now to are moving to EXIM, as it has a lot of features inbuilt without using milters.

In postfix you can deliver to non system users quite easily by just creating a file say /etc/nonsysmail.txt and putting in it simple lines like:

info@mail.virtual.host   nonsysmail/nonsystemUserA/
sales@mail.virtual.host   nonsysmail/nonsystemUserB/
programs@mail.virtual.host   nonsysmail/nonsystemUserc/  
*@mail.virtual.host   nonsysmail/nonsystemUserAll/

postmap /etc/nonsysmail.txt

Is there someway to achieve same with EXIM too, using just plain text files. I am not allowed to use mysql db there. Can someome suggest me full procedure for using non system virtual users with EXIM mta.

Sven
  • 98,649
  • 14
  • 180
  • 226
Jon lee
  • 9
  • 1

1 Answers1

2

It depends on your exact exim config, but it boils down to adding an extra transport after the real_local transport, such as:

virtual_local:
    driver = accept
    domains = +local_domains
    local_parts = lsearch;/etc/exim/virtual_users
    transport = virtual_maildir

This will lookup the name in the given file, and if found use the named transport to deliver the message; if not found processing is passed on to the next router.

The virtual_maildir transport will be something like:

virtual_maildir:
    driver = appendfile
    maildir_format
    create_directory = true
    directory_mode = 0700
    directory = /var/spool/virtmail/$local_part
    # or: directory = lsearch;/etc/exim/virtual_users
    user = virtmail
    group = virtmail
    mode = 0660
    mode_fail_narrower = false
    return_path_add
    envelope_to_add
    delivery_date_add

Things may have to be tweaked a bit, this is off the cuff. exim's debugging output is excellent for tracking down problems; for debugging everything in a delivery

exim -bv -d+all virtualuser@example.com
wurtel
  • 3,864
  • 12
  • 15
  • This i found at http://wiki2.dovecot.org/HowTo/VirtualhostingWithExim and i already tried and no success. this needs prediction. thnk u @wurtel – Jon lee Mar 24 '15 at 10:25
  • I wrote the above based on my own config, not from some wiki.,What do you mean: *this needs prediction* ? What didn't work? What did the debug output for a delivery (using the command I showed) tell you? – wurtel Mar 24 '15 at 10:28
  • i found approx. same solution at above url. it needs prediction (http://horms.net/projects/perdition/) however accept my apologizes, as it was urs. come to point. after putting above routers/transprts. squirrelmail says -- Message not sent. Server replied: Requested action not taken: mailbox unavailable 550 Verification failed for Unrouteable address Sender verify failed – Jon lee Mar 24 '15 at 12:03
  • exim mainlog: 2015-03-25 01:44:46 H=localhost (mail.myserver.com) 127.0.0.1 sender verify fail for : Unroutable address – Jon lee Mar 24 '15 at 12:08
  • exim mainlog: timestamp H=localhost (mail.myserver.com) [127.0.0.1] F= rejected RCPT : Sender verify failed – Jon lee Mar 24 '15 at 12:10
  • exim mainlog: timestamp unexpected disconnection while reading SMTP command from localhost (mail.myserver.com) [127.0.0.1] – Jon lee Mar 24 '15 at 12:12
  • I am not able to understand log of exim. it may be my config error or something. thanking you @wurtel. – Jon lee Mar 24 '15 at 12:15
  • It doesn't like your SENDER address, it's not even getting to check the recipient; it has nothing to do with virtual users at this point. So, before adding the configuration for virtual users, please make sure that email to and from normal users works. If necessary open a new question about that. – wurtel Mar 24 '15 at 12:23
  • ok @wurtel, i will do that. but pl can u tell what to put in /etc/exim/virtual_users file. thnking you a lot. – Jon lee Mar 24 '15 at 12:38
  • Simple: just the user names, one per line. – wurtel Mar 24 '15 at 13:29
  • thanking you @wurtel. i work now also thanking to exim -bv -d+all virtualuser@example.com. this cmd help me a lot. BUT ONE FINAL QUESTION? How to create a catchall account. for example userA, userB are all in /etc/exim/virtual_users so they mail is ok. BUT all mail to misspelt userrA is bounced (unknown user). so a catchall is required by me. ANY SUGGESTION – Jon lee Mar 25 '15 at 06:05
  • Add an extra router as last one (so that it will only be reached if all the others fail) that looks like the one above, but with `local_part = *` and a different transport e.g. `virtual_catchall`. Then copy the `virtual_maildir` transport to `virtual_catchall` and replace `$local_part` with `catchall` or whatever. – wurtel Mar 25 '15 at 07:47