[exim] Control mail sending to specific domains

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Vaidya nathan
Fecha:  
A: exim-users
Asunto: [exim] Control mail sending to specific domains
Hi

I just checked with a test mail to my own yahoo ID & it does not seem to be delivered, but the exim log shows no non-delivery failure & the message is not seen in the queue (msglog folder) either.

Any help please





Author: Vaidya nathan

Date: 2009-11-30 18:13 +5.530

To: exim-users

Subject: [exim] Control mail sending to specific domains

Hi



I'm new to Exim.



Can any one please let me know how to restrict Exim to send mails only to specified domains.



I've done the following setting in exim.conf







domainlist relay_to_domains = mydomain.com







But when a mail is sent to a different domain other than mydomain.com, it seems to go thru. I've configured Exim to transfer all mails to an external mail provider using an SMTP account as follows -







begin routers



smarthost:



driver = manualroute



domains = ! +local_domains



transport = remote_smtp



route_list = * external.mail.server







begin authenticators



fixed_login:



driver = plaintext



public_name = LOGIN



client_send = : myaccount@??? : Password







exim_main.log shows



2009-11-30 10:15:07 KTWNV4-0001L8-Q0 => other.user@??? R=smarthost T=remote_smtp H=external.mail.server [123.4.5.6] X=TLSv1:RC4-MD5:128



2009-11-30 10:15:07 KTWNV4-0001L8-Q0 Completed From nd@??? Tue Dec 01 15:42:30 2009
Envelope-to: exim-users@???
Received: from ffm-dr1.syndicat.com ([62.146.89.62]:63352)
    by tahini.csx.cam.ac.uk with esmtp (Exim 4.71)
    (envelope-from <nd@???>) id 1NFUru-0007ST-0Q
    for exim-users@???; Tue, 01 Dec 2009 15:42:27 +0000
Received: from localhost.syndicat.com ([127.0.0.1] helo=localhost)
    by ffm-dr1.syndicat.com with esmtp (Exim 4.69)
    (envelope-from <nd@???>) id 1NFUro-00019m-MR
    for exim-users@???; Tue, 01 Dec 2009 16:42:16 +0100
X-Virus-Scanned: amavisd-new at syndicat.com
Received: from ffm-dr1.syndicat.com ([127.0.0.1])
    by localhost (ffm-dr1.syndicat.com [127.0.0.1]) (amavisd-new,
    port 10024) with ESMTP id TkvVNDbQnI+4 for <exim-users@???>;
    Tue,  1 Dec 2009 16:42:16 +0100 (CET)
Received: from pd955745b.dip.t-dialin.net ([217.85.116.91] helo=pingpong)
    by ffm-dr1.syndicat.com with esmtpsa (TLSv1:AES256-SHA:256)
    (Exim 4.69) (envelope-from <nd@???>) id 1NFUrh-0004ae-Jz
    for exim-users@???; Tue, 01 Dec 2009 16:42:15 +0100
From: Niels Dettenbach <nd@???>
Organization: Syndicat IT&Internet
To: exim-users@???
Date: Tue, 1 Dec 2009 16:41:59 +0100
User-Agent: KMail/1.12.2 (Linux/2.6.31-gentoo-r3; KDE/4.3.3; i686; ; )
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1567533.MiPXyPaCJT";
    protocol="application/pgp-signature"; micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
Message-Id: <200912011642.09097.nd@???>
X-Spam-ASN: 
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ffm-dr1.syndicat.com
X-Spam-Level: 
X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
    J_CHICKENPOX_28 autolearn=no version=3.2.5
X-Spam-Score: -3.5 (---) 
X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00=-1.5, EXIM_DRIVER=-1,
    EXIM_EXP_VAR=-1 autolearn=ham version=3.1.8
Subject: [exim] problem with smarthost setup
X-BeenThere: exim-users@???
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: A user list for the exim MTA <exim-users.exim.org>
List-Unsubscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject=unsubscribe>
List-Archive: <http://lists.exim.org/lurker/list/exim-users.html>
List-Post: <mailto:exim-users@exim.org>
List-Help: <mailto:exim-users-request@exim.org?subject=help>
List-Subscribe: <http://lists.exim.org/mailman/listinfo/exim-users>,
    <mailto:exim-users-request@exim.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Dec 2009 15:42:31 -0000



--nextPart1567533.MiPXyPaCJT
Content-Type: Text/Plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Dear all,


i'm a little bit confused here.

I have a smarthost configuration and several email adresses in the same dom=
ain=20
are locally - others on the smarthost (not locally).

This means if someone on the local host writes an email to a recipient in a=
=20
local domain, exim has to check if he can deliver it locally (to cyrus by=20
LMTP) - otherwise the address must be at the smarthost (providers mailserve=
r).


So i tried the follwing routers (the section "remoteuser" quoted with "#")

=2D-- snip ---
# MySQL aliases
mysql_aliases:
  driver          =3D redirect
  allow_fail
  allow_defer
  data            =3D ${lookup mysql {MYSQL_LOCAL_DEST}{$value}}
  user            =3D mail
  file_transport  =3D address_file
  pipe_transport  =3D address_pipe



# System
system_aliases:
driver =3D redirect
allow_fail
allow_defer
data =3D ${lookup{$local_part}lsearch*{/etc/mail/aliases}}
user =3D mail
file_transport =3D address_file
pipe_transport =3D address_pipe

system_aliases2:
driver =3D redirect
allow_fail
allow_defer
data =3D ${lookup{$local_part@$domain}lsearch*{/etc/mail/aliases}}
user =3D mail
file_transport =3D address_file
pipe_transport =3D address_pipe

#remoteuser:
# driver =3D manualroute
# domains =3D +local_domains
# condition =3D "${if !eq{$header_X-Virus-Scanned} {1}{0}}"
# transport =3D remote_smtp
# route_list =3D * syndicat.com

# This router matches local user mailboxes.
localuser:
driver =3D accept
#check_local_user
transport =3D local_delivery

=2D-- snap ---

My idea was:
if none of the routers before match and the mail was not coming from the=20
smarthost - just route it to the smarthost.

In that section i (tried) checked against a header entry which is only=20
available in emails which still coming from the smarthost (yes, it makes no=
=20
sense to blow mails back to him which still comes from him to our local hos=
t).

But this can't work as exim goes anytimes goes through to the localuser:=20
router. In case of a non local postbox i get an LTMP 550 error (mailbox doe=
s=20
not exist).

If i place "remoteuser" after "localuser" localuser matches anytime but lea=
ds=20
to the LTMP error from cyrus in cases the postbox is not local.

Can anyone help here? Any ide is very welcome here.


many many thanks,
best regards,


Niels.
=2D-=20

=2D--

Niels Dettenbach
---
Syndicat IT&Internet
http://www.syndicat.com
T.-Muentzer.-Str. 2, 37308 Heilbad Heiligenstadt - DE
---
Kryptoinfo:=20
PGP public key ID 651CA20D
Fingerprint: 55E0 4DCD B04C 4A49 1586 88AE 54DC 4465 651C A20D
https://syndicat.com/pub_key.asc
---

--nextPart1567533.MiPXyPaCJT
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (GNU/Linux)

iQIcBAABCAAGBQJLFTlQAAoJEM78prARigUnGIcP/jAWUHl8hfEEiSbIGX8GsBVe
LUa7Lxq6hphLWjQlNEm/CQGqmzZbvamnpX5Z83U4wxK2Hv8y/WXQ5m9w2TVRxO84
m4KoAA5JqlEy/e82UCt5HLMNj1GHRgTk9A3om47R2F4MDuxa3wf4CZPMARiJaIK5
Zog/f2CcD9IpyKERqEN7j68ub9Cbu/4McnsrAGFM8xk3gT9CBawwiDewTB/5eMtt
gf7ZX+J/nMK8ayCnVA7mucsTgxblbdT9o8/7h4U3JLR/WvuFGqSJIBHy2Lb768mN
6N/pdg81t1n2/oA74YZw0nnU46M40m+L0fN+Ss/o8CD6xu2Yi1o8a46Ngbm8NF6u
28zMEkqRtka5q84mt7+sXpWytjMw00xvHnpgWihbV08UsWaHGZkva7DpUnE4sUqT
899FuNQZwDRKQQF6nR5iIx2KmBrBxkp2WV9cmnSqg4eS/4/YWbbFaR9M9hSyzTeJ
4yhf6pZIwfWVz4o8CqCo2PReeX3c+kDB97RMkwadIvlDch5zxPFNDzBOen5qZ7ah
sjyjnzLWd4LhYPuGiASoMVHtUl+78NgzR8/J7jyP419JbkI0gDeCV+poP2vm7mlP
NgiOWSem09hpQ6GhrZSZoC1aeUbqZygiDUtaME+6P1bgSHOTtUTPQq12wObDMavk
ief2qjWlYYAaYSKAIfKF
=+xeK
-----END PGP SIGNATURE-----

--nextPart1567533.MiPXyPaCJT--