Coder Social home page Coder Social logo

rosehgal / trashemail Goto Github PK

View Code? Open in Web Editor NEW
538.0 11.0 65.0 5.01 MB

A hosted disposable email telegram bot; Extremely privacy friendly; Proudly hosted for community.

Home Page: https://t.me/trashemail_bot

License: Apache License 2.0

Java 96.55% Dockerfile 0.47% Shell 0.21% Makefile 2.77%
telegram-bot temp-email trash-email disposable-email telegram java spring mailbox reliability java-spring-boot

trashemail's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trashemail's Issues

BYE server shutdown

Describe the bug

javax.mail.FolderClosedException: * BYE Server shutting down.
	at com.sun.mail.imap.IMAPFolder.throwClosedException(IMAPFolder.java:2538)
	at com.sun.mail.imap.IMAPFolder.idle(IMAPFolder.java:2336)
	at com.sun.mail.imap.IMAPFolder.idle(IMAPFolder.java:2252)
	at io.github.trashemail.EmailInteraction.ImapClient$IdleThread.run(ImapClient.java:117)

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version 1.0.0

Cleanify the bot reply messages.

Currently for /start and other help messages, there are really long output that telegram throws back to the user. Make it small and impactful.

HTML version of email link not over HTTPS

Describe the bug
There is button to display "HTML Version" of email. It redirects with an http:// URL and not https://

To Reproduce
Steps to reproduce the behavior:

  1. Send urself an email (with HTML content?)
  2. In bot click on "HTML Verison" button

Expected behavior
URL must begin with https://

Screenshots
notHTTPS

Beautiful public dashbaord.

Is your feature request related to a problem? Please describe.
Right now the admin data is only projected as JSON endpoint. Make beautiful dashboard beautiful.

Message parsing is not working as expected.

Describe the bug
Message parsing is not working as expected. If you send a very basic HTML mail from any mail service. Following parameters a coming out to be true.

MailParser    : Is plain content true
MailParser    : Is HTML content true
MailParser    : Is multipart true
MailParser    : Is plain content Empty false

Due to which, this statement is never reached. https://github.com/r0hi7/Trashemail/blob/b67de8bfface2386071b32b9a9930d90a77d8b20/src/main/java/io/github/trashemail/utils/MailParser.java#L39
Because this is evaluated to false: https://github.com/r0hi7/Trashemail/blob/b67de8bfface2386071b32b9a9930d90a77d8b20/src/main/java/io/github/trashemail/utils/MailParser.java#L38

To Reproduce
Steps to reproduce the behavior:

  1. Send an HTML mail from good with the following content.
**Bold text**
_Italic_

Expected behavior
Since this is multipart mail, the HTML field should be processed. And HTML message should be recorded.

Unauthorized No Body but alias added for Telegram user

Describe the bug
The issue is coming up when the local user is created and the email server while alias creation throws some error. And since the check is not made is the server returned any issue, the email is allocated to the user despite on the server side it was not created.

To Reproduce
Steps to reproduce the behavior:

  1. Add invalid credentials in the config.
  2. Create an email from the telegram

Expected behavior
If the server throws error while email-id creation, the email should not be assigned to the telegram user.

Suggestions ... ?

If you have any suggestions to make for this bot, please use this thread for discussion.

Endpoint for Admins to broadcast message to all the users

Is your feature request related to a problem? Please describe.
Can we have endpoint available for admins to broadcast messages to all the users? This can used by teams who wants to run some sort of ad campaigns.

Describe the solution you'd like
A Web form, only access to admins, make it secure.

Telegram API parsing error

Describe the bug
There are certain messages, which are not getting parsed by telegram API and /sendmessage api is throwing exception in that case. This is due to default parse_mode value set to Markdown in TelegramRequest class.

Messaging Exception : Connection Refused

Describe the bug
The log shows the messaging exception.

javax.mail.MessagingException: Connection refused (Connection refused);
  nested exception is:
	java.net.ConnectException: Connection refused (Connection refused)
	at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
	at javax.mail.Service.connect(Service.java:295)
	at javax.mail.Service.connect(Service.java:176)
	at javax.mail.Service.connect(Service.java:196)
	at io.github.trashemail.EmailInteraction.ImapClient.ensureOpen(ImapClient.java:155)
	at io.github.trashemail.EmailInteraction.ImapClient$IdleThread.run(ImapClient.java:115)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
	at java.base/java.net.Socket.connect(Socket.java:609)
	at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)
	at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:288)
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
	at com.sun.mail.iap.Protocol.<init>(Protocol.java:113)
	at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:110)
	at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:632)

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version 1.0.0

Support for multiple targets for load balancing.

This is feature enhancement for load balancing.
Changes needs to be done:

  • TelegramService: it will randomly pick a target from the list of target email addresses.
  • EmailService: It will have to create separate threads to connect with different accounts.

NULL pointer exception with Email id

Describe the bug
If the email is something of the form Rohit <[email protected]> the email lookup with EmailsToTelegramService is failing and is not delivered to the user.

To Reproduce
Send an email with Name and email id in to field. This happens when the server send mail as contact.

2020-06-16 16:01:51.929 ERROR 10969 --- [Mail-EventQueue] i.g.t.E.ForwardMailsToTelegram           : Unable to find chatId for EmailId: Rohit <[email protected]>
java.lang.NullPointerException
        at io.github.trashemail.EmailsToTelegramService.ForwardMailsToTelegram.getChatIdFromEmailId(ForwardMailsToTelegram.java:57)
        at io.github.trashemail.EmailsToTelegramService.ForwardMailsToTelegram.sendToTelegram(ForwardMailsToTelegram.java:74)
        at io.github.trashemail.EmailsToTelegramService.ImapClient$1.messagesAdded(ImapClient.java:77)
        at javax.mail.event.MessageCountEvent.dispatch(MessageCountEvent.java:150)
        at javax.mail.EventQueue.run(EventQueue.java:134)
        at java.base/java.lang.Thread.run(Thread.java:834)

Dashboard for Admin

Is your feature request related to a problem? Please describe.
Dashboard for admins to see the number of user, number of emails registered. I think good idea would be to leverage spring MVC.

Support to view Entire HTML mail.

Is your feature request related to a problem? Please describe.
Currently the HTML email is converted to textual representation. Offer link so that people can open the HTML version for that.

Jackson bind throws Exception with non TelegramRequest

Describe the bug
When Telegram request was not parsed properly it was throwing exception, which is not handled currently. Due to which the telegram was piling up all the requests and other requests were not even responding.

ERROR 1661 --- [nio-9090-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
	at io.github.trashemail.Telegram.TelegramResource.messageHandler(TelegramResource.java:34) ~[classes!/:1.0.0]
	at jdk.internal.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:109) ~[spring-boot-actuator-2.2.7.RELEASE.jar!/:2.2.7.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.34.jar!/:9.0.34]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

Be more precise on SMTP Alias Creation Requirements

I think SMTP Alias Creation feature is not standard.
It seems you use internally mailinabox
Maybe you should document it in your README, that you expect users to run their admin panel.
More specifically I would mention that:

  • This project is tailored for MailInABox
  • The SMTP Alias Creation is done by sending HTTP Requests to their admin API
  • Optionally document the form of the request to enable people not using mailinabox to reimplement the API
  • Optionally provides a milter/filter for postfix/opensmtpd

Kudos for the project.

Telegram sendMessage imposes a limit of 4096 characters

Describe the bug
Telegram sendMessage API imposes a limit of 4096 characters, so in current scenario, if the server tries to send email of size more than 4096 chars, then server will throw exception due to bad response from telegram.

ERROR 2038 --- [cTaskExecutor-2] .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void io.github.trashemail.Telegram.SendTelegramMessage.sendMessage(java.lang.String,java.lang.String)

org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{"ok":false,"error_code":400,"description":"Bad Request: message is too long"}]
	at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:101) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:170) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:112) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:782) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:740) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.web.client.RestTemplate.postForEntity(RestTemplate.java:449) ~[spring-web-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at io.github.trashemail.Telegram.SendTelegramMessage.sendMessage(SendTelegramMessage.java:40) ~[classes!/:1.0.0]
	at io.github.trashemail.Telegram.SendTelegramMessage$$FastClassBySpringCGLIB$$b8c07fb8.invoke(<generated>) ~[classes!/:1.0.0]
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) ~[spring-aop-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) ~[spring-aop-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.2.6.RELEASE.jar!/:5.2.6.RELEASE]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
	at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

To Reproduce
Steps to reproduce the behavior:
Just send a mail of size more than 4096 bytes/chars.

Expected behavior
A excepted behaviour is to split the message into chunks of size 4096 and then process.

Can't create a new temp email.

Describe the bug

Can't register a new temp email on the bot. It says: "Something bad just happened with me. Stay back till I get fixed"

To Reproduce

Steps to reproduce the behavior:

  1. Install bot.
  2. Create a new email.
  3. See error

Expected behavior

Should create a new email to receive emails.

Screenshots
Screenshot_20200601-145030_Telegram

Smartphone (please complete the following information):

  • Device: Android, Samsung M40
  • OS: Android 10

Delay

Hello,

I discovered your bot on privacytoolsio reddit. Great work!

I came across unexpected behaviour. When I am sending an message to the email created by Trashemail Bot, it comes to my Telegram with significant delay. Delay is about 5-10 minutes, which can kind of annoying when you want to confirm a link quickly.

Could you please investigate?

This bot is simply amazing and I really appreciate your work.

Pushing attachments with incoming mails.

Is your feature request related to a problem? Please describe.
In the current release if the user gets an email with attachments, then the attachments gets ignored.

Describe the solution you'd like
In case incoming mail contains an attachment, it should be forwarded to the telegram client as well.

Describe alternatives you've considered
Can we have attachment scanning with VT APIs?

ImapClient: javax.mail.FolderClosedException

Since the schedular is used to connect to the Imap IDLE server, and the entire implementation of server ImapClient in in multithread mode with restart rate set to 120000, which is causing this exception .

javax.mail.FolderClosedException
	at com.sun.mail.imap.IMAPMessage.getProtocol(IMAPMessage.java:145)
	at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1279)
	at com.sun.mail.imap.IMAPMessage.getContentType(IMAPMessage.java:450)
	at javax.mail.internet.MimeBodyPart.isMimeType(MimeBodyPart.java:1050)
	at javax.mail.internet.MimeMessage.isMimeType(MimeMessage.java:985)
	at io.github.teledot.utils.MailParser.getTextFromMessage(MailParser.java:53)
	at io.github.teledot.utils.MailParser.<init>(MailParser.java:29)
	at io.github.teledot.Telegram.ForwardMailsToTelegram.sendToTelegram(ForwardMailsToTelegram.java:28)
	at io.github.teledot.EmailInteraction.ImapClient$1.messagesAdded(ImapClient.java:81)
	at javax.mail.event.MessageCountEvent.dispatch(MessageCountEvent.java:150)
	at javax.mail.EventQueue.run(EventQueue.java:134)
	at java.base/java.lang.Thread.run(Thread.java:834)

A better way to create emails

/create [email protected]

This is unnessarily long. It should be

/create myemail


Even if you have multiple domains, users shouldn't have to type the full domain.

Step 1: /create myemail

Step 2: [prompt chose one of these domains for your new email]

  1. newtrashemail.in
  2. trashemail.in

Step 3: Congratulations. Your new email is [email protected]

Unsafe content in HTML emails

Describe the bug
JavaScript and external resources are allowed in "HTML version" of email which might lead to tracking and IP address leakage, and other wide range of security issues.

To Reproduce
Steps to reproduce the behavior:

  1. Send urself an HTML with inline javascript." <script>alert(1)</script>
  2. In bot click on "View HTML"

Expected behavior
By default they should be blocked OR at least user should be given control.

Screenshots
JSinHTMLEmails

Emails getting missed/blank emails with subject only.

Describe the bug
In the current state Custom email parser is used, which is written in this application code. The issue with the current implementation is that few of the mails are getting missed out. Since I am not logging content of which such emails are getting missed out, its difficult to look the root of this issue and fix it.

To Reproduce
Steps to reproduce the behaviour:

  1. Try sending any email with image content or html content in it. It might work as well.
  2. Try sending any HTML email from https://putsmail.com/

Can we use this : https://commons.apache.org/proper/commons-email/apidocs/org/apache/commons/mail/util/MimeMessageParser.html for parsing email.

One email delivered twice on telegram

Describe the bug
(Improper Email address parsing)? leads to multiple messages on telegram.

Example

  1. If Recipient is John Doe<[email protected]> here John Doe is name and [email protected] is email
  2. If Recipient is [email protected]<[email protected]> here [email protected] is name and [email protected] is email address.
    Now the Buggy case
  3. Similiarly If Recipient is [email protected]<[email protected]> here [email protected] is name and email address. It should be delivered once. but is delivered twice on telegram.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new trashemail id say [email protected]
  2. Compose an email to [email protected]<[email protected]>

Expected behavior
Email should be received once on Telegram.

Actual behavior
Email is received twice on Telegram.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.