Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Custom Router/Transport Help

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


ryan.roegan at gmail

Mar 12, 2010, 4:53 PM

Post #1 of 4 (831 views)
Permalink
Custom Router/Transport Help

I'm trying to make a test mail server that is authorative for all domains
and delivers all mail received to one mailbox. I'm using debian 3, exim4
and courier imap.

I've added the router and transport below. I would like all mail delivered
into the sw user's mailbox. But i get permission errors upon delivery:

2010-03-01 18:17:27 1NmHfr-0003Pz-2n <=
root [at] debian-blackhole=root P=local S=443
2010-03-01 18:17:27 1NmHfr-0003Pz-2n ==
root [at] debian-blackhole=sw_router T=sw_deliver defer
(13): Permission denied: cannot chdir to
/home/sw/Maildir


What am i missing? Sorry i'm pretty new to exim configuration and developed
this config based on the delivered configuration.

router:

accept_all:
driver = accept
transport = just_deliver


Transport:

just_deliver:
debug_print = "T: maildir_home for $local_part@$domain"
driver = appendfile
.ifdef MAILDIR_HOME_MAILDIR_LOCATION
directory = MAILDIR_HOME_MAILDIR_LOCATION
.else
directory = /home/sw/Maildir
.endif
.ifdef MAILDIR_HOME_CREATE_DIRECTORY
create_directory
.endif
.ifdef MAILDIR_HOME_CREATE_FILE
create_file = MAILDIR_HOME_CREATE_FILE
.endif
delivery_date_add
envelope_to_add
return_path_add
maildir_format
.ifdef MAILDIR_HOME_DIRECTORY_MODE
directory_mode = MAILDIR_HOME_DIRECTORY_MODE
.else
directory_mode = 0700
.endif
.ifdef MAILDIR_HOME_MODE
mode = MAILDIR_HOME_MODE
.else
mode = 0600
.endif
mode_fail_narrower = false
# This transport always chdirs to $home before trying to deliver. If
# $home is not accessible, this chdir fails and prevents delivery.
# If you are in a setup where home directories might not be
# accessible, uncomment the current_directory line below.
current_directory = /
--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


eximX0902w at linuxwan

Mar 13, 2010, 1:44 AM

Post #2 of 4 (809 views)
Permalink
Re: Custom Router/Transport Help [In reply to]

On Fri, 2010-03-12 at 16:53 -0800, Ryan Roegan wrote:
> 2010-03-01 18:17:27 1NmHfr-0003Pz-2n <=
> root [at] debian-blackhole=root P=local S=443
> 2010-03-01 18:17:27 1NmHfr-0003Pz-2n ==
> root [at] debian-blackhole=sw_router T=sw_deliver defer
> (13): Permission denied: cannot chdir to
> /home/sw/Maildir
>
>
> What am i missing? Sorry i'm pretty new to exim configuration and developed
> this config based on the delivered configuration.

As a wild guess .. permissions or dir doesn't exist problem.

The appendfile transport runs as the system user the email is destined
for unless the user/group options are used.

In this case you're trying to deliver to /home/sw/Maildir as the sw user
- that user either doesn't have access to that directory, or the
directory doesn't exist and create_dir isn't set. The tmp, cur and new
directories might also be missing.

The appendfile transport
http://docs.exim.org/current/spec_html/ch26.html



--
The Exim manual - http://docs.exim.org


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


dirk_linnerkamp at vodafone

Mar 13, 2010, 4:03 AM

Post #3 of 4 (810 views)
Permalink
Re: Custom Router/Transport Help [In reply to]

Hi Ryan,

Am 13.03.2010 01:53, schrieb Ryan Roegan:
> I'm trying to make a test mail server that is authorative for all domains
> and delivers all mail received to one mailbox. I'm using debian 3, exim4
> and courier imap.
>
> I've added the router and transport below. I would like all mail delivered
> into the sw user's mailbox. But i get permission errors upon delivery:
>
> 2010-03-01 18:17:27 1NmHfr-0003Pz-2n<=
> root [at] debian-blackhole=root P=local S=443
> 2010-03-01 18:17:27 1NmHfr-0003Pz-2n ==
> root [at] debian-blackhole=sw_router T=sw_deliver defer
> (13): Permission denied: cannot chdir to
> /home/sw/Maildir

...did you set the "group" option in the routers configuration to
exim's group?

...however if you use the 'mail' group which exim normally belongs
to om Debian, you should add user 'sw' to the group and change
the directory mode to 0660 instead of 0600.

...try it and report.



--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


ryan.roegan at gmail

Mar 15, 2010, 10:55 AM

Post #4 of 4 (758 views)
Permalink
Re: Custom Router/Transport Help [In reply to]

Thank you for pointing me in the right direction.

i added group=mail and then added sw to the mail group. Changed the
transport directory_mode to 0660 but then i started receiving permission
issues accessing files in /tmp.

I didn't really understand what user exim was using for delivery or how to
force it to use a specific user.

Once i put user=sw in my transport all is fixed.

So hopefully someone will find this useful.

If you want to setup a simple catch all smtp server using debian 3 and exim
4, very useful for testing email based notification systems. Use the
following config:

1. Install the following packages:

exim4, courier-imap

2. Update exim4 config

change the following settings /etc/exim4/update-exim4.conf.conf

#authorative for all domains:
dc_other_hostnames='*'

#read the split config in conf.d
dc_use_split_config='true'

3. Create the user

Create the user that you would like all mail delivered to ie:

#create user catchall
useradd catchall -m

3. Create the router file

create the file /etc/exim4/conf.d/routers/01_exim4_accept_all:

ca_router:
driver = accept
transport = ca_deliver

4. Create the transport file

create the file /etc/exim4/conf.d/transport/01_exim4_catch_all_transport:

ca_deliver:
driver = appendfile
user=catchall
directory = /home/catchall/Maildir
create_directory
delivery_date_add
envelope_to_add
return_path_add
maildir_format
directory_mode = 0600
mode_fail_narrower = false
current_directory = /

5. Update the config

sudo update-exim4.conf

On 2010-03-13 12:03, Dirk Linnerkamp wrote:

> Hi Ryan,
>
> Am 13.03.2010 01:53, schrieb Ryan Roegan:
> > I'm trying to make a test mail server that is authorative for all
domains
> > and delivers all mail received to one mailbox. I'm using debian 3,
exim4
> > and courier imap.
> >
> > I've added the router and transport below. I would like all mail
delivered
> > into the sw user's mailbox. But i get permission errors upon delivery:
> >
> > 2010-03-01 18:17:27 1NmHfr-0003Pz-2n<=
> > root@???=root P=local S=443
> > 2010-03-01 18:17:27 1NmHfr-0003Pz-2n ==
> > root@???=sw_router T=sw_deliver defer
> > (13): Permission denied: cannot chdir to
> > /home/sw/Maildir
>
> ...did you set the "group" option in the routers configuration to
> exim's group?
>
> ...however if you use the 'mail' group which exim normally belongs
> to om Debian, you should add user 'sw' to the group and change
> the directory mode to 0660 instead of 0600.
>
> ...try it and report.
>
>
>
>
--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.