Re: Can't map an address to another one

2016-08-21 Thread Edgar Pettijohn
On 16-08-21 07:54:12, Mik J wrote:
> Hello,
> This is my configuration
> table domains file:/etc/mail/domaines
> table aliases file:/etc/mail/aliases
> table users file:/etc/mail/users
> table courriels file:/etc/mail/courriels
> table passwords file:/etc/mail/passwords
> table clients file:/etc/mail/clients
> 
> max-message-size 50M
> 
> pki smtp.mydomain.org certificate "/etc/ssl/certs/smtp.mydomain.org.crt"
> pki smtp.mydomain.org key "/etc/ssl/private/smtp.mydomain.org.key"
> 
> #
> # INBOUND MAILS #
> #
> listen on 127.0.0.1 port 10024 tag CLAM_IN # Inbound Emails Clamav
> listen on 127.0.0.1 port 10028 tag DKIM_IN # Inbound Emails dkimproxy
>

Try this:
 
> accept tagged CLAM_IN for domain  virtual  deliver to maildir 
> "/var/mail/vmail/%{rcpt.domain}/%{rcpt.user}/Maildir"

  
%{dest.user}
  
If not look below ...
 
> accept tagged CLAM_IN for local alias  deliver to maildir 
> "/var/mail/vmail/%{rcpt.domain}/%{rcpt.user}/Maildir"
> accept tagged DKIM_IN for any relay via smtp://127.0.0.1:10023
> accept from local for domain  relay via smtp://127.0.0.1:10027
> accept from source  for domain  relay via 
> smtp://127.0.0.1:10027
> accept from any sender ! for domain  relay via 
> smtp://127.0.0.1:10027
> 
> ##
> # OUTBOUND MAILS #
> ##
> listen on 127.0.0.1
> listen on 127.0.0.1 port 10026 tag CLAM_OUT # Outbound Emails Clamav
> listen on 127.0.0.1 port 10030 tag DKIM_OUT # Outbound Emails dkimproxy
> listen on 10.255.89.250 port 25 tls pki smtp.mydomain.org auth-optional 
> 
> listen on 10.255.89.250 port 587 tls-require pki smtp.mydomain.org auth 
> 
> 
> accept tagged CLAM_OUT for any relay via smtp://127.0.0.1:10029
> accept tagged DKIM_OUT for any relay
> accept from local for any relay via smtp://127.0.0.1:10025
> accept from source  for any relay via smtp://127.0.0.1:10025
> 
> # cat /etc/mail/courriels
> @mydomain.org
> 
> # cat /etc/mail/users
> i...@mydomain.org u...@mydomain.org
> u...@mydomain.org vmail

You are mixing a userbase table with an alias table.  Try something a little 
simpler without all the redirection.

smtpd.conf

table users passwd:/etc/mail/vusers.db
table aliases db:/etc/mail/aliases.db

listen on lo0
listen on egress

accept from any for domain "example.com" userbase  alias  
deliver to maildir

/etc/mail/vusers
user::5000:5000::/var/vmail:/sbin/nologin

/etc/mail/aliases
user:   user1

> 
> 
> Logs
> Aug 21 09:38:04 mysmtp smtpd[1986]: smtp-in: New session efae73fbac2080c1 
> from host mail-x-x.google.com [x.x.218.49]
> Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: Started TLS on session 
> efae73fbac2080c1: version=TLSv1.2, cipher=ECDHE-RSA-AES128-GCM-SHA256, 
> bits=128
> Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: Accepted message ab0439bc on 
> session efae73fbac2080c1: from=, 
> to=, size=2627, ndest=1, proto=ESMTP
> Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-out: Connecting to 
> smtp://127.0.0.1:10027 (localhost) on session efae7405008428c6...
> Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-out: Connected on session 
> efae7405008428c6
> Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: New session efae74061f50e98f 
> from host localhost [127.0.0.1]
> Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: Closing session efae73fbac2080c1
> Aug 21 09:38:06 mysmtp dkimproxy.in[31732]: DKIM verify - pass; 
> message-id=,
>  signer=<@gmail.com>, from=
> Aug 21 09:38:06 mysmtp smtpd[1986]: smtp-in: Accepted message afeec3df on 
> session efae74061f50e98f: from=, 
> to=, size=2929, ndest=1, proto=ESMTP
> Aug 21 09:38:06 mysmtp smtpd[1986]: relay: Ok for ab0439bc92880b67: 
> session=efae7405008428c6, from=, 
> to=, rcpt=<->, source=127.0.0.1, relay=127.0.0.1 
> (localhost), delay=1s, stat=250 2.0.0: afeec3df Message accepted for delivery
> Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-out: Connecting to 
> smtp://127.0.0.1:10023 (localhost) on session efae740ed271d955...
> Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-out: Connected on session 
> efae740ed271d955
> Aug 21 09:38:10 mysmtp clamsmtpd: 100018: accepted connection from: 127.0.0.1
> Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-in: New session efae740f284c98fc 
> from host localhost [127.0.0.1]
> Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-in: Accepted message d2dd91a7 on 
> session efae740f284c98fc: from=, 
> to=, size=3169, ndest=1, proto=ESMTP
> Aug 21 09:38:10 mysmtp clamsmtpd: 100018: from=personal...@gmail.com, 
> to=i...@mydomain.org, status=CLEAN
> Aug 21 09:38:10 mysmtp smtpd[1986]: relay: Ok for afeec3df2f83edba: 
> session=efae740ed271d955, from=, 
> 

Re: Can't map an address to another one

2016-08-21 Thread Mik J
This is the full debug -vd
smtp-in: Accepted message 3ff99b9d on session 7c7d334d52c5ec39: 
from=, to=, size=2625, ndest=1, 
proto=ESMTP
debug: scheduler: evp:3ff99b9d4918e017 scheduled (mta)
debug: mta: received evp:3ff99b9d4918e017 for 
debug: mta: draining [relay:127.0.0.1,port=10027,mx] refcount=1, ntask=1, 
nconnector=0, nconn=0
debug: mta: querying MX for [relay:127.0.0.1,port=10027,mx]...
debug: mta: [relay:127.0.0.1,port=10027,mx] waiting for MX
debug: MXs for domain 127.0.0.1:
    127.0.0.1 preference -1
debug: mta: ... got mx (0x4326ee92420, 127.0.0.1, 
[relay:127.0.0.1,port=10027,mx])
debug: mta: draining [relay:127.0.0.1,port=10027,mx] refcount=1, ntask=1, 
nconnector=0, nconn=0
debug: mta: querying source for [relay:127.0.0.1,port=10027,mx]...
debug: mta: ... got source for [relay:127.0.0.1,port=10027,mx]: []
debug: mta: new [connector:[]->[relay:127.0.0.1,port=10027,mx],0x1]
debug: mta: connecting with [connector:[]->[relay:127.0.0.1,port=10027,mx],0x0]
debug: mta-routing: searching new route for 
[connector:[]->[relay:127.0.0.1,port=10027,mx],0x0]...
debug: mta-routing: selecting candidate route [] <-> 127.0.0.1
debug: mta-routing: spawning new connection on [] <-> 127.0.0.1
debug: mta: 0x432cc955670: spawned for relay [relay:127.0.0.1,port=10027,mx]
debug: mta: connecting with [connector:[]->[relay:127.0.0.1,port=10027,mx],0x0]
debug: mta: cannot use [relay:127.0.0.1,port=10027,mx] before 2s
debug: mta-routing: no route available for 
[connector:[]->[relay:127.0.0.1,port=10027,mx],0x0]: must wait a bit
debug: mta: retrying to connect on 
[connector:[]->[relay:127.0.0.1,port=10027,mx],0x0] in 2s...
debug: mta: draining [relay:127.0.0.1,port=10027,mx] refcount=3, ntask=1, 
nconnector=1, nconn=1
debug: mta: scheduling relay [relay:127.0.0.1,port=10027,mx] in 1s...
smtp-out: Connecting to smtp://127.0.0.1:10027 (localhost) on session 
7c7d335771506ae9...
smtp-out: Connected on session 7c7d335771506ae9
debug: smtp: new client on listener: 0x432be182000
smtp-in: New session 7c7d33580678232e from host localhost [127.0.0.1]
debug: mta-routing: route [] <-> 127.0.0.1 (localhost) is now valid.
debug: mta: connecting with 
[connector:[]->[relay:127.0.0.1,port=10027,mx],0x2]
debug: mta: cancelling connector timeout
debug: mta: enough connections already
debug: mta: 0x432cc955670: handling next task for relay 
[relay:127.0.0.1,port=10027,mx]
smtp: 0x432e87af000: fd 9 from queue
smtp: 0x432e87af000: fd 11 from filter
debug: smtp: 0x432e87af000: data io done (2927 bytes)
filter: deferring eom query...
filter: running eom query...
debug: 0x432e87af000: end of message, msgflags=0x
smtp-in: Accepted message be9a78f5 on session 7c7d33580678232e: 
from=, to=, size=2927, ndest=1, 
proto=ESMTP
debug: scheduler: evp:be9a78f5243ffd00 scheduled (mta)
relay: Ok for 3ff99b9d4918e017: session=7c7d335771506ae9, 
from=, to=, rcpt=<->, 
source=127.0.0.1, relay=127.0.0.1 (localhost), delay=0s, stat=250 2.0.0: 
be9a78f5 Message accepted for delivery
debug: mta: waiting for 1s before next transaction
debug: mta: received evp:be9a78f5243ffd00 for 
debug: mta: draining [relay:127.0.0.1,port=10023,mx] refcount=1, ntask=1, 
nconnector=0, nconn=0
debug: mta: querying source for [relay:127.0.0.1,port=10023,mx]...
debug: mta: ... got source for [relay:127.0.0.1,port=10023,mx]: []
debug: mta: new [connector:[]->[relay:127.0.0.1,port=10023,mx],0x1]
debug: mta: connecting with [connector:[]->[relay:127.0.0.1,port=10023,mx],0x0]
debug: mta-routing: searching new route for 
[connector:[]->[relay:127.0.0.1,port=10023,mx],0x0]...
debug: mta-routing: skipping route [] <-> 127.0.0.1 (localhost): cannot use 
before 5s (delay after connect)
debug: mta-routing: no route available for 
[connector:[]->[relay:127.0.0.1,port=10023,mx],0x0]: must wait a bit
debug: mta: retrying to connect on 
[connector:[]->[relay:127.0.0.1,port=10023,mx],0x0] in 5s...
debug: mta: draining [relay:127.0.0.1,port=10023,mx] refcount=2, ntask=1, 
nconnector=1, nconn=0
debug: mta: scheduling relay [relay:127.0.0.1,port=10023,mx] in 1s...
debug: mta: flush for 3ff99b9d4918e017 (-> i...@mydomain.org)
smtp-in: Closing session 7c7d334d52c5ec39 

Le Dimanche 21 août 2016 9h54, Mik J  a écrit :
 
 

 Hello,
This is my configuration
table domains file:/etc/mail/domaines
table aliases file:/etc/mail/aliases
table users file:/etc/mail/users
table courriels file:/etc/mail/courriels
table passwords file:/etc/mail/passwords
table clients file:/etc/mail/clients

max-message-size 50M

pki smtp.mydomain.org certificate "/etc/ssl/certs/smtp.mydomain.org.crt"
pki smtp.mydomain.org key "/etc/ssl/private/smtp.mydomain.org.key"

#
# INBOUND MAILS #
#
listen on 127.0.0.1 port 10024 tag CLAM_IN # Inbound Emails Clamav
listen on 127.0.0.1 port 10028 tag 

Re: Can't map an address to another one

2016-08-21 Thread Mik J
Hello,
This is my configuration
table domains file:/etc/mail/domaines
table aliases file:/etc/mail/aliases
table users file:/etc/mail/users
table courriels file:/etc/mail/courriels
table passwords file:/etc/mail/passwords
table clients file:/etc/mail/clients

max-message-size 50M

pki smtp.mydomain.org certificate "/etc/ssl/certs/smtp.mydomain.org.crt"
pki smtp.mydomain.org key "/etc/ssl/private/smtp.mydomain.org.key"

#
# INBOUND MAILS #
#
listen on 127.0.0.1 port 10024 tag CLAM_IN # Inbound Emails Clamav
listen on 127.0.0.1 port 10028 tag DKIM_IN # Inbound Emails dkimproxy

accept tagged CLAM_IN for domain  virtual  deliver to maildir 
"/var/mail/vmail/%{rcpt.domain}/%{rcpt.user}/Maildir"
accept tagged CLAM_IN for local alias  deliver to maildir 
"/var/mail/vmail/%{rcpt.domain}/%{rcpt.user}/Maildir"
accept tagged DKIM_IN for any relay via smtp://127.0.0.1:10023
accept from local for domain  relay via smtp://127.0.0.1:10027
accept from source  for domain  relay via 
smtp://127.0.0.1:10027
accept from any sender ! for domain  relay via 
smtp://127.0.0.1:10027

##
# OUTBOUND MAILS #
##
listen on 127.0.0.1
listen on 127.0.0.1 port 10026 tag CLAM_OUT # Outbound Emails Clamav
listen on 127.0.0.1 port 10030 tag DKIM_OUT # Outbound Emails dkimproxy
listen on 10.255.89.250 port 25 tls pki smtp.mydomain.org auth-optional 

listen on 10.255.89.250 port 587 tls-require pki smtp.mydomain.org auth 


accept tagged CLAM_OUT for any relay via smtp://127.0.0.1:10029
accept tagged DKIM_OUT for any relay
accept from local for any relay via smtp://127.0.0.1:10025
accept from source  for any relay via smtp://127.0.0.1:10025

# cat /etc/mail/courriels
@mydomain.org

# cat /etc/mail/users
i...@mydomain.org u...@mydomain.org
u...@mydomain.org vmail


Logs
Aug 21 09:38:04 mysmtp smtpd[1986]: smtp-in: New session efae73fbac2080c1 from 
host mail-x-x.google.com [x.x.218.49]
Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: Started TLS on session 
efae73fbac2080c1: version=TLSv1.2, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128
Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: Accepted message ab0439bc on 
session efae73fbac2080c1: from=, to=, 
size=2627, ndest=1, proto=ESMTP
Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-out: Connecting to 
smtp://127.0.0.1:10027 (localhost) on session efae7405008428c6...
Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-out: Connected on session 
efae7405008428c6
Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: New session efae74061f50e98f from 
host localhost [127.0.0.1]
Aug 21 09:38:05 mysmtp smtpd[1986]: smtp-in: Closing session efae73fbac2080c1
Aug 21 09:38:06 mysmtp dkimproxy.in[31732]: DKIM verify - pass; 
message-id=,
 signer=<@gmail.com>, from=
Aug 21 09:38:06 mysmtp smtpd[1986]: smtp-in: Accepted message afeec3df on 
session efae74061f50e98f: from=, to=, 
size=2929, ndest=1, proto=ESMTP
Aug 21 09:38:06 mysmtp smtpd[1986]: relay: Ok for ab0439bc92880b67: 
session=efae7405008428c6, from=, to=, 
rcpt=<->, source=127.0.0.1, relay=127.0.0.1 (localhost), delay=1s, stat=250 
2.0.0: afeec3df Message accepted for delivery
Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-out: Connecting to 
smtp://127.0.0.1:10023 (localhost) on session efae740ed271d955...
Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-out: Connected on session 
efae740ed271d955
Aug 21 09:38:10 mysmtp clamsmtpd: 100018: accepted connection from: 127.0.0.1
Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-in: New session efae740f284c98fc from 
host localhost [127.0.0.1]
Aug 21 09:38:10 mysmtp smtpd[1986]: smtp-in: Accepted message d2dd91a7 on 
session efae740f284c98fc: from=, to=, 
size=3169, ndest=1, proto=ESMTP
Aug 21 09:38:10 mysmtp clamsmtpd: 100018: from=personal...@gmail.com, 
to=i...@mydomain.org, status=CLEAN
Aug 21 09:38:10 mysmtp smtpd[1986]: relay: Ok for afeec3df2f83edba: 
session=efae740ed271d955, from=, to=, 
rcpt=<->, source=127.0.0.1, relay=127.0.0.1 (localhost), delay=5s, stat=250 
2.0.0: d2dd91a7 Message accepted for delivery
Aug 21 09:38:10 mysmtp smtpd[1986]: delivery: Ok for d2dd91a7a2457a23: 
from=, to=, rcpt=, 
user=vmail, method=maildir, delay=0s, stat=Delivered
Aug 21 09:38:16 mysmtp smtpd[1986]: smtp-in: Closing session efae74061f50e98f
Aug 21 09:38:16 mysmtp smtpd[1986]: smtp-out: Closing session efae7405008428c6: 
1 message sent.
Aug 21 09:38:20 mysmtp smtpd[1986]: smtp-in: Closing session efae740f284c98fc
Aug 21 09:38:20 mysmtp smtpd[1986]: smtp-out: Closing session efae740ed271d955: 
1 message sent.

In these logs I seeAug 21 09:38:10 mysmtp smtpd[1986]: delivery: Ok for 
d2dd91a7a2457a23: from=, 

Re: Can't map an address to another one

2016-08-20 Thread Edgar Pettijohn
I think you're entire smtpd.conf would be useful as well as logs.

Sent from my iPhone

> On Aug 20, 2016, at 5:57 PM, Mik J  wrote:
> 
> Hello,
> 
> I want to use some kind of alias addresses like mails sent to 
> i...@mydomain.org would arrive in u...@mydomain.org. Both are on my mail 
> server.
> 
> # cat /etc/mail/users
> i...@mydomain.org u...@mydomain.org
> u...@mydomain.org vmail
> 
> In my smtpd.conf
> table users file:/etc/mail/users
> accept tagged CLAM_IN for domain  virtual  deliver to maildir 
> "/var/mail/vmail/%{rcpt.domain}/%{rcpt.user}/Maildir"
> NB: This is the first rule
> 
> When I send a mail to i...@mydomain.org it doesn't arrive in 
> u...@mydomain.org it arrives in its own mailbox.
> 
> I don't really understand why
> 
> Does this configuration seem correct or did I miss something ?


Can't map an address to another one

2016-08-20 Thread Mik J
Hello,
I want to use some kind of alias addresses like mails sent to i...@mydomain.org 
would arrive in u...@mydomain.org. Both are on my mail server.
# cat /etc/mail/usersi...@mydomain.org user@mydomain.orgu...@mydomain.org vmail
In my smtpd.conftable users file:/etc/mail/usersaccept tagged CLAM_IN for 
domain  virtual  deliver to maildir 
"/var/mail/vmail/%{rcpt.domain}/%{rcpt.user}/Maildir"
NB: This is the first rule
When I send a mail to i...@mydomain.org it doesn't arrive in u...@mydomain.org 
it arrives in its own mailbox.
I don't really understand why
Does this configuration seem correct or did I miss something ?