Mailing List Archive

virtual_delivery not working correctly
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]

Dear All,

I am using the following virtual_delivery director to lookup mailboxes via MySQL however when no mailbox is returned exim still attempts delivery.
Is there a way to make Exim not to perform delivery if the user or data was not found/selected from the $lookup ?

MYSQL_MAILBOX = SELECT mailboxfile FROM mailboxes WHERE username = '${quote_mysql:$local_part}'

virtual_delivery:
driver = appendfile
file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
delivery_date_add
envelope_to_add
return_path_add
user = mail
group = mail
#mode = 0660

Thanks

Paul
--
Re: virtual_delivery not working correctly [ In reply to ]
On Thu, 23 May 2002, Paul wrote:

> I am using the following virtual_delivery director to lookup mailboxes via MySQL however when no mailbox is returned exim still attempts delivery.

You have quoted a transport, not a director.

> Is there a way to make Exim not to perform delivery if the user or data was not found/selected from the $lookup ?

What do you want to happen? Do you want the message to be bounced, or
kept on Exim's queue for later delivery? You need to to take these kinds
of decision at directing time, not transport time.

> MYSQL_MAILBOX = SELECT mailboxfile FROM mailboxes WHERE username = '${quote_mysql:$local_part}'
>
> virtual_delivery:
> driver = appendfile
> file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
> delivery_date_add
> envelope_to_add
> return_path_add
> user = mail
> group = mail
> #mode = 0660

If the lookup fails, "file" will end up empty. Exim will see that it is
not an absolute path name. It will assume a configuration error, and
freeze the message.

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: virtual_delivery not working correctly [ In reply to ]
Phillip,

I would like the message to be bounced, as it's not a valid user because the
SQL lookup did not return any data.
Exim tries to deliver to a blank mailbox as you stated, but I want Exim to
return the usual 550: user unknown

How can this be achieved?

----- Original Message -----
From: Philip Hazel
To: Paul
Cc: exim-users@exim.org
Sent: Thursday, May 23, 2002 6:20 PM
Subject: Re: [Exim] virtual_delivery not working correctly


On Thu, 23 May 2002, Paul wrote:

> I am using the following virtual_delivery director to lookup mailboxes via
MySQL however when no mailbox is returned exim still attempts delivery.

You have quoted a transport, not a director.

> Is there a way to make Exim not to perform delivery if the user or data
was not found/selected from the $lookup ?

What do you want to happen? Do you want the message to be bounced, or
kept on Exim's queue for later delivery? You need to to take these kinds
of decision at directing time, not transport time.

> MYSQL_MAILBOX = SELECT mailboxfile FROM mailboxes WHERE username =
'${quote_mysql:$local_part}'
>
> virtual_delivery:
> driver = appendfile
> file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
> delivery_date_add
> envelope_to_add
> return_path_add
> user = mail
> group = mail
> #mode = 0660

If the lookup fails, "file" will end up empty. Exim will see that it is
not an absolute path name. It will assume a configuration error, and
freeze the message.

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##
Re: virtual_delivery not working correctly [ In reply to ]
On Fri, 24 May 2002, Paul wrote:

> I would like the message to be bounced, as it's not a valid user because the
> SQL lookup did not return any data.
> Exim tries to deliver to a blank mailbox as you stated, but I want Exim to
> return the usual 550: user unknown
>
> How can this be achieved?

By getting the *director* not to recognize the address. You haven't
posted the director you are using, so I can't tell you what's wrong with
it...

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: virtual_delivery not working correctly [ In reply to ]
Dear Phillip,

Thanks for point this out, below is the original transport handler and it's
corresponding director below it.

virtual_delivery:
driver = appendfile
file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
delivery_date_add
envelope_to_add
return_path_add
user = mail
group = mail

virtual_local_user:
domains = ${lookup mysql {MYSQL_DOMAIN}{$value}}
driver = smartuser
transport = virtual_delivery

Thanks
Paul

----- Original Message -----
From: Philip Hazel
To: Paul
Cc: exim-users@exim.org
Sent: Friday, May 24, 2002 6:10 PM
Subject: Re: [Exim] virtual_delivery not working correctly


On Fri, 24 May 2002, Paul wrote:

> I would like the message to be bounced, as it's not a valid user because
the
> SQL lookup did not return any data.
> Exim tries to deliver to a blank mailbox as you stated, but I want Exim to
> return the usual 550: user unknown
>
> How can this be achieved?

By getting the *director* not to recognize the address. You haven't
posted the director you are using, so I can't tell you what's wrong with
it...

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##
RE: virtual_delivery not working correctly [ In reply to ]
Paul,

your director is checking the domain the message is destined for, not that
the mailbox exists.

Regards,
Mark.

-----Original Message-----
From: Paul [mailto:beanhead@optushome.com.au]
Sent: 27 May 2002 00:41
To: exim-users@exim.org
Cc: ph10@cus.cam.ac.uk
Subject: Re: [Exim] virtual_delivery not working correctly


Dear Phillip,

Thanks for point this out, below is the original transport handler and it's
corresponding director below it.

virtual_delivery:
driver = appendfile
file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
delivery_date_add
envelope_to_add
return_path_add
user = mail
group = mail

virtual_local_user:
domains = ${lookup mysql {MYSQL_DOMAIN}{$value}}
driver = smartuser
transport = virtual_delivery

Thanks
Paul

----- Original Message -----
From: Philip Hazel
To: Paul
Cc: exim-users@exim.org
Sent: Friday, May 24, 2002 6:10 PM
Subject: Re: [Exim] virtual_delivery not working correctly


On Fri, 24 May 2002, Paul wrote:

> I would like the message to be bounced, as it's not a valid user because
the
> SQL lookup did not return any data.
> Exim tries to deliver to a blank mailbox as you stated, but I want Exim to
> return the usual 550: user unknown
>
> How can this be achieved?

By getting the *director* not to recognize the address. You haven't
posted the director you are using, so I can't tell you what's wrong with
it...

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##


--

## List details at http://www.exim.org/mailman/listinfo/exim-users Exim
details at http://www.exim.org/ ##


Salamis Group of Companies - WWW.SALAMISGROUP.COM

This communication contains information which is confidential and may
also be privileged. It is for the exclusive use of the intended
recipient(s). If you are not the intended recipient(s) be advised
that any form of distribution, copying or use of this communication
or the information it contains is strictly prohibited and may be
unlawful. We apologise if you have received this communication in
error. Please return it to the sender immediately, delete this
communication from your computer and destroy any copies of it. Any
views/opinions expressed in this email are that of the author and may
not reflect the views of Salamis (M&I)Ltd.
Re: virtual_delivery not working correctly [ In reply to ]
Dear All,

I now have my config working correctly but I now need two seperate directors
for email forwarding.
The one for localuser's should lookup via foward files and the director for
virtual_users should do an SQL lookup.
Below is my correctly configured directors but I am unsure how to specifiy
different forwarding directors for each driver


local_delivery:
driver = appendfile
file = /var/mail/$local_part
delivery_date_add
envelope_to_add
return_path_add
group = mail

virtual_delivery:
driver = appendfile
file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
delivery_date_add
envelope_to_add
return_path_add
user = mail
group = mail

userforward:
driver = forwardfile
check_local_user = false
data = ${lookup mysql {MYSQL_FORWARD}{$value}}
no_verify
no_expn
check_ancestor
filter
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply


localuser:
driver = localuser
transport = local_delivery

virtual_local_user:
driver = smartuser
domains = ${lookup mysql {MYSQL_DOMAIN}{$value}}
condition = ${lookup mysql {MYSQL_USER}{$value}}
transport = virtual_delivery

Thanks

Paul
Re: virtual_delivery not working correctly [ In reply to ]
On Mon, 27 May 2002, Paul wrote:

> Thanks for point this out, below is the original transport handler and it's
> corresponding director below it.
>
> virtual_delivery:
> driver = appendfile
> file = ${lookup mysql {MYSQL_MAILBOX}{$value}}
> delivery_date_add
> envelope_to_add
> return_path_add
> user = mail
> group = mail
>
> virtual_local_user:
> domains = ${lookup mysql {MYSQL_DOMAIN}{$value}}
> driver = smartuser
> transport = virtual_delivery

> On Fri, 24 May 2002, Paul wrote:
>
> > I would like the message to be bounced, as it's not a valid user because
> the
> > SQL lookup did not return any data.
> > Exim tries to deliver to a blank mailbox as you stated, but I want Exim to
> > return the usual 550: user unknown
> >
> > How can this be achieved?
>
> By getting the *director* not to recognize the address. You haven't
> posted the director you are using, so I can't tell you what's wrong with
> it...

As I said, get the *director* not to recognize the address. Add a
setting of "local_parts" to your director so that it only works for
local parts that are valid.




--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.