I think I solve the issue...!!! The problem was really coming from a dual submit using IMAP connections. SASL-Cyrus was activated correctly, but in my /etc/courier-imap/imap config file, the line: OUTBOX=.Sent
Was set, which was doing this: # If OUTBOX is defined, mail can be sent via the IMAP connection by copying # a message to the INBOX.Outbox folder. So when a mail was submitted via IMAP, mail was sent through SMTP, and a copy was sent using Courier-IMAP. Thanks everyone for the help, insight and explanation on how mails were delivered. Daniel -------- >> What user does amavis run as? What you say that Postfix uses "this new >> user", what do you mean by that? > > Amavis is running as user: amavis (uid: 102) and group: amavis (gid: 408). > Maildirs are stored as user imap (uid: 1000) and group imap (gid: 1000). > Postfix is running as postfix (207/207). I added the user imap/imap to > seperate the maildir storage directory from the postfix dir. > >> Come on, there is no basis for this conclusion, indeed the opposite seems >> likely, the extra copy has: > > I've just flashed onto something. Is it possible that when an email is sent, > the client is authenticated with IMAP credentials, and then again with the > SASL-Cyrus? From both header, it seems that one came from IMAP, and the other > from the server, which could explain that...? > >> Are you saying that Postfix adds the "X-IMAP-Sender" header that is not >> in the original SMTP message? The second copy is injected by user 1000, >> what is running as that user now? > > I don't know which email is the original, and which is not... As for the user > 1000, it's the user that stores the mail. There's no process running it, just > those directive in main.cf: > virtual_gid_maps = static:1000 > virtual_uid_maps = static:1000 > >> Don't waste your time looking for Postfix bugs. The unwanted duplication >> will be found in non-Postfix code, unless you find it, you will make >> no progress. Pursue this on the amavis list. > > I didn't say it was a postfix bug, maybe a misconfiguration from my part from > postfix, or one of the other daemon. > >> From your logs, below are shown the ONLY deliveries performed by Postfix. >> No Postfix delivery is via a delivery agent that is capable of calling >> sendmail(1) to fork the message, because lmtp(8) and virtual(8) simply >> don't have code to do this. All deliveries before virtual(8) delivery >> are to amavis, which is presumably still running as the wrong user >> (1000 just like virtual(8) and the IMAP server, instead of a dedicated >> user). Your amavis config forks the message. Don't do that. > > Thanks for the analysis. Look at the top of my mail for the uid/gid usage. > I'm really beginning to think there's a dual authentication somewhere. Or > maybe a misconfiguration in amavis... > > > Daniel