Excellent. Sent from my iPhone
> On Jul 27, 2016, at 12:04 AM, Alan Cheng <[email protected]> wrote: > > seems the alias table can do the work, whereas a 'catchall' won't (as it's > not intended to). > > The key part to get it working here is to map each (virtual) user to two > addresses: a system account (vmail, in my case) > to receive emails, andan additional address that you want all incoming mails > be BCC'ed to. > > I need to manually create the alias map for each user, but the number of > accounts is less than 10 so the manual operation > is not an issue for now. > > Thanks all again for responding and inspriing. > > Here is my config files, in case anyone want to take a reference to: > > #=============== my smtpd.conf ========================== > pki mail.example.com certificate "/etc/opensmtpd/mail.example.com.crt" > pki mail.example.com key "/etc/opensmtpd/mail.example.com.key" > table aliases file:/etc/opensmtpd/aliases > table vdomains file:/etc/opensmtpd/vdomains > table passwd file:/etc/opensmtpd/passwd > table virtual_users file:/etc/opensmtpd/virtual_userss > listen on lo > listen on eth1 port 25 tls pki mail.example.com > listen on eth1 port 587 tls-require pki mail.example.com auth <passwd> > accept from local for local alias <aliases> deliver to lmtp > "/var/run/dovecot/lmtp" rcpt-to > > accept from any for domain <vdomains> virtual <virtual_users> deliver to lmtp > "/var/run/dovecot/lmtp" rcpt-to > > accept from local for any relay > > #================ my virtual_users table =========== > # vmail is a system account that all virtual users map to > # as in https://www.opensmtpd.org/faq/example1.html > # admin account here is the address I'd like all incoming mail be BCC'ed to, > in addition to > # their intended recipient > > [email protected] vmail > > [email protected] vmail,[email protected] > [email protected] vmail,[email protected] > > Regards, > Aan > ------------------------------------------------------------------ > From:Alan Cheng <[email protected]> > Time:2016 Jul 26 (Tue) 22:37 > To:misc <[email protected]> > Subject:Re: something similar to always_bcc in postfix? > > > Thanks all for responding. > I'll go through table.5 (as mentioned by Edgar) another time and see if I can > get anything new. > if not, I'll try the approaches mentioned by Denis and Tom. > > Regards, > Alan > > ------------------------------------------------------------------ > From:Tom Smyth <[email protected]> > Time:2016 Jul 26 (Tue) 06:46 > To:Edgar Pettijohn <[email protected]> > Cc:Denis Fondras <[email protected]>; misc <[email protected]> > Subject:Re: something similar to always_bcc in postfix? > > in postifx you can do it in the virtualmaps file ... I had tried doing this > in OpenSMTPD > about 1.5 years ago and ended up using OpenSMTPD as the service that listened > to the outside world and then relay the information to Postfix which would > copy and > forward mail listening on the loopback address, using the virtualmaps in > Postfix > > > edit /etc/postfix/virtual file > [email protected] > [email protected],otheraddress_@_otherdomain.com > > [email protected] > [email protected],root@localhost > @domain.com @domain.com > > repeat each line for each user of the domain > > after editing the the virtual maps file run the command > > postmap /etc/postfix/virtual > > > using the virtualmaps in Postfix > > It worked reliably the only gotcha was trying to copy mails for unknown > addresses, > I was not able to pull this off, as a safety measure wildcard setting at > the bottom > of the file for un-known users and this would forward the mail without > copying > (not to interrupt production mailflow) > > @domain.com @domain.com > > I hope this helps > > > On Mon, Jul 25, 2016 at 11:30 PM, Edgar Pettijohn <[email protected]> > wrote: > > > Sent from my iPhone > > On Jul 25, 2016, at 2:18 PM, Edgar Pettijohn <[email protected]> wrote: > > > > Sent from my iPhone > > On Jul 25, 2016, at 11:33 AM, Denis Fondras <[email protected]> wrote: > > I'd like to bcc all incoming mail to a specified address, but could not > figure out how. Anyone has any pointers? > My current setup is opensmtpd + dovecot with virtual domains. > > I don't know if it is possible with OpenSMTPd. > Alternatively and probably not as efficient but if you use pigeonhole you can > add a global sieve script to copy email to another recipient. > > Denis > > -- > You received this mail because you are subscribed to [email protected] > To unsubscribe, send a mail to: [email protected] > > > I know it's possible with postfix, so I'm sure opensmtpd can do it too. Not > sure how unfortunately. > > -- > You received this mail because you are subscribed to [email protected] > To unsubscribe, send a mail to: [email protected] > > This is an excerpt from table(5) > > In a virtual domain context, the key is either a user part, a full email > address or a catch all, following selection rules described in smtpd.conf(5), > and the value is one or many recipients as described in aliases(5): > > @example.com [email protected] > > > > > > -- > Kindest regards, > Tom Smyth > > Mobile: +353 87 6193172 > --------------------------------- > PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL > This email contains information which may be confidential or privileged. The > information is intended solely for the use of the individual or entity named > above. If you are not the intended recipient, be aware that > any disclosure, copying, distribution or use of the contents of this > information is prohibited. If you have received this electronic transmission > in error, please notify me by telephone or by electronic mail immediately. > Any opinions expressed are those of the author, not the company's .This > email does not constitute either offer or acceptance of any contractually > binding agreement. Such offer or acceptance must be communicated in > writing. You are requested to carry out your own virus check before opening > any attachment. Thomas Smyth accepts no liability for any loss or damage > which may be caused by malicious software or attachments. > >
