As the post says, when someone sends an email through google’s SMTP service, gmail stores it automatically in the ‘Sent’ message’s folder.
I would like to replicate that behaviour exactly, without relaying on the client to connect to the server through IMAP.
Sending a BCC to the remitent’s is also discarded, I find it ugly.
If it’s not possible, then I’ll live with that, no need to reply annoyed.
So far, I understand something similar should be possible using sieve scripts from dovecot and the LMTP service.
I have tried several solutions given by different AIs, but none of them have worked. All of the posted solutions in here are modifications made assuming the latest default configuration of mailcow to date.
#1 Failed Attempt: DeepSeek R1
According to DeepSeek, the following sieve script should be enough, if added to the respective section of the dovecot.conf
file (sieve_default = /path/to/the/below/script/file
), and appending the +vnd.dovecot.environment
}
value to the sieve_global_extensions
plugin’s property.
require ["fileinto", "mailbox", "variables", "environment"];
# Only act on emails sent via authenticated SMTP
if environment :matches "smtp_auth_user" "*" {
set "auth_user" "${1}";
}
# Check if the sender matches the authenticated user (to exclude inbound mail)
if allof (
environment :contains "smtp_from" "${auth_user}",
not environment :contains "smtp_from" "MAILER-DAEMON" # Exclude bounces
) {
fileinto :create "Sent";
stop;
}
In postfix, I had to add these two options to the submission section:
-o smtpd_sasl_auth_enable=yes
-o smtpd_discard_ehlo_keywords=8bitmime
#2 Failed Attempt: MS Windows Copilot
dovecot/conf/sieve_after:
require ["fileinto", "envelope"];
if envelope :matches "from" "*" {
fileinto "Sent";
}
In postfix main.cf
file, append the hash:/path/to/postfix.conf/transport
to transport_maps
and then
echo ${my_user}@${my_domain.com} lmtp:unix:/var/run/dovecot/lmtp > /path/to/postfix.conf/transport