Not working if trashemail address is used in BCC field
dcRUSTy opened this issue · 4 comments
Compose a new email with trashemail address in BCC field.
Expected - Should be delivered on telegram.
Actual - Not delivered on telegram.
Reason - SMTP Alias?
I was to complete this flow soon. Thanks for testing and point this out to keep track of it. Actually the reason is not SMTP alias but the way I am parsing the message, I have not included target as cc or bcc. I will work on this quickly.
This bug
is due to https://github.com/r0hi7/Trashemail/blob/6819a7648f917c8b428208560772929d9f6a2d95/src/main/java/io/github/trashemail/Telegram/ForwardMailsToTelegram.java#L25
I missed this out. Actually the mail has to be sent to all the recipients. Try to make this a set instead of the list.
https://docs.oracle.com/javaee/5/api/javax/mail/Message.html#getRecipients(javax.mail.Message.RecipientType) I think it is very possible for email to have TO, CC and BCC field empty I have seen in several SPAM emails and also documentation suggests same "This method returns null if none of the recipient headers are present in this message" I also tried sending email from yahoo to gmail with only BCC field set and observed the BCC field is indeed missing when email was opened on gmail. Not 200% sure but i think it is a possibility. I was referring to this possibility in first comment
I tried to send an email with bcc in it but the java mail parsing library is showing email address in BCC as undisclosed email. It will become difficult for me to get the target email address from that. I am marking this issue closed for now and marking it wontfix. In case you feel you have better suggestion and an alternative approach to parsing, you reopen this with PR :)
Thanks again @dcRUSTy