how to get recipient of email

J

jcharth

Hello I noticed that when amavis quarantines a message adds the X-
envelop-to tag to the headers of the email. This header has all the
recipients of the email. Some email files dont have a TO
or have a BCC. Can anyone tell me how to get all recipients in a eml
file? I was looking at the code of amavis-new and it has a few
required modules that might do this but I cant find which one

any ideas?


IO::Handle IO::Wrap IO::Stringy
Digest::MD5 Unix::Syslog File::Basename File::Copy
Mail::Field Mail::Address Mail::Header Mail::Internet
MIME::Base64 MIME::QuotedPrint MIME::Words
MIME::Head MIME::Body MIME::Entity MIME::parser
Net::Cmd Net::SMTP Net::Server Net::Server::preForkSimple
MIME::Decoder::Base64 MIME::Decoder::Binary
MIME::Decoder::Gzip64
MIME::Decoder::NBit MIME::Decoder::QuotedPrint
MIME::Decoder::UU
) );
# with earlier versions of Perl one may need to add additional
modules
# to the list, such as: auto::pOSIX::setgid
auto::pOSIX::setuid ...
fetch_modules('OPTIONAL BASIC MODULES', 0, qw(
 
B

Brian McCauley

Hello I noticed that when amavis quarantines a message adds the X-
envelop-to tag to the headers of the email. This header has all the
recipients of the email. Some email files dont have a TO
or have a BCC. Can anyone tell me how to get all recipients in a eml
file?

No.

The recipients of an e-mail in transit are written on the envelope,
not in the message itself.

When your MUA send a mail the recipients will often get copied from
the headers to the envelope. At this point the BCC (add BC-like)
headers are removed. But addresses can also get on to the envelope in
other ways.

If a mail has multiple recipients it will, in general, be split and
handled many MTAs. The envelope seen by each MTA will only contain the
recipients for which that MTA is handling delivery.

I'm not familiar with Amavis but I assume it's running on an MTA and
is passed the message and the envelope. Presumably it places a copy of
the envelope-to it sees in the X- header. This is bad because it
potentially allows the To: recepient to see the BCC: recepient. If
Amavis is running on the senders MTA this might be the full list. If
it's running on the recepient's MTA it will only see other recpient's
whose inbound mail is also handled by the same MTA.

None of this, of course, has anything to do with Perl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top