GithubHelp home page GithubHelp logo

o4oren / ad-hoc-email-server Goto Github PK

View Code? Open in Web Editor NEW
375.0 13.0 89.0 6.63 MB

An ad-hoc disposable temporary mail server. Create and use ad hoc disposable mailboxes for testing or any other purpose.

License: Apache License 2.0

TypeScript 37.00% JavaScript 16.78% HTML 21.51% CSS 17.82% Dockerfile 0.09% API Blueprint 4.42% SCSS 2.39%
mail mailbox mailboxes mailserver webmail ahem-server disposable-email temporary-email disposable-emails

ad-hoc-email-server's People

Contributors

dependabot[bot] avatar devanshdalal avatar e2jk avatar gcleaves avatar jetmore avatar neerajkumar161 avatar nmummau avatar o4oren avatar useername avatar

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  avatar  avatar

ad-hoc-email-server's Issues

nodemailer should be a production dependency

On production servers where NODE_ENV=production nodemailer wasn't getting installed.
This presents a problem as the code requires nodemailer for the /api/alive route.

nodemailer is required here in mailTester.js.

mailTester.js itself is required here.

Last but not least, you can see nodemailer is a development dependency here.

Cannot find module app/dist

I am trying to run ahem through docker, the ahem-ssr-1 container is returning this kind of error, does anyone have an idea what I can do to solve it?

ad-hoc-email-server-ahem-ssr-1  | internal/modules/cjs/loader.js:965
ad-hoc-email-server-ahem-ssr-1  |   throw err;
ad-hoc-email-server-ahem-ssr-1  |   ^
ad-hoc-email-server-ahem-ssr-1  |
ad-hoc-email-server-ahem-ssr-1  | Error: Cannot find module '/app/dist'
ad-hoc-email-server-ahem-ssr-1  |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:962:15)
ad-hoc-email-server-ahem-ssr-1  |     at Function.Module._load (internal/modules/cjs/loader.js:838:27)
ad-hoc-email-server-ahem-ssr-1  |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

The app crashes when testing with telnet

Hello,

I managed to follow your steps and install the app on a windows 7 virtual machine. I started the app with node ahem.js and opened another console to test the email functionality (response from API was already received as: {"success":true,"api":true,"smtp":true,"db":true} ) So, going further, in the new console I followed these steps:

  1. Type the following command: telnet <mail server name or IP> 25
  2. Type: EHLO <mail server internet name>
    Replace with your mail server's public fully qualified domain name - for instance, mail.dell.com.
  3. Type: mail from: <[email protected]> and press Enter.
  4. Type: rcpt to: <[email protected]> and press Enter.
  5. Type: data and press Enter.
  6. Type: Subject: <a subject here> and press Enter.
  7. Type: This is a test message sent from telnet. and press Enter.
  8. Type: . and press Enter

In the ahem.js console I can see the telnet connection, but just when finishing everything up and performing step 8, the ahem.js console crashes with this error:

`{"message":"SMTP Connect from myIpV6 ","level":"info"}
{"message":"SMTP MAIL FROM: [email protected]","level":"info"}
{"message":"SMTP RCPT TO: [email protected]","level":"info"}
{"message":"SMTP DATA start","level":"info"}
{"message":"SMTP DATA end","level":"info"}
E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\mongodb\lib\utils.js:132
      throw err;
      ^

TypeError: Cannot read property 'value' of undefined
    at E:\tests\EmailServer\Ad-Hoc-Email-Server\server\app\smtp.js:67:23
    at E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[4mmongodb←[24m\li
b\utils.js:414:17
    at E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[4mmongodb←[24m\li
b\utils.js:401:11
    at ClientSession.endSession (E:\tests\EmailServer\Ad-Hoc-Email-Server\node_m
odules\←[4mmongodb-core←[24m\lib\sessions.js:129:41)
    at executeCallback (E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[
4mmongodb←[24m\lib\utils.js:397:17)
    at E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[4mmongodb←[24m\li
b\operations\collection_ops.js:876:19
    at handleCallback (E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[4
mmongodb←[24m\lib\utils.js:128:55)
    at E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[4mmongodb←[24m\li
b\operations\collection_ops.js:848:5
    at E:\tests\EmailServer\Ad-Hoc-Email-Server\node_modules\←[4mmongodb-core←[2
4m\lib\connection\pool.js:532:18
←[90m    at processTicksAndRejections (internal/process/task_queues.js:75:11)←[3
9m

E:\tests\EmailServer\Ad-Hoc-Email-Server>node ahem.js`

At this point, I'm not really sure how to proceed in testing if everything works. I can see that there are some emails occasionally received from what appears to be an 'alive-test' email box, but that's pretty much it. I don't know if the emails that another app sends, reach this server and I cannot debug it as I don't have access to its logs. Sending an email from outlook won't work because the VM is not accessible from outside, but the other app is within the same network so it will be able to access it. So the only way that I thought of testing was with telnet. Any thoughts?
Looking in mongo, I see that when creating a mailbox from the AHEM UI, nothing happens in the API or in the DB (as in, the mailbox is not created per'say, but it's rather just a redirection). I suppose the mailbox will be created upon receiving the first email?

Thank you,
Feda

securing the service

Hi,

i don't want my self hosted instance to be available to anyone but me.
I tryied adding an http auth in nginx but it keeps asking me for credentials.
Any idea?

Best regards,
lezioul

ways to debug why email is not received

Hi, I've configure the server as follows:

  • ubuntu22.04 ec2 on aws
  • started service on port 3000 and smtp port is 25, allowed origins also configured
  • configured MX and A records for domain
  • api server is working fine
  • opened all ports on ec2 firewall

still not able to get email on mailbox , please suggest things i can check for.

Email Not receiving

I installed Ad-Hoc-Email-Server on my own AWS EC2 instance (Ubuntu 18.04, Nodejs v13.1.0, MongoDB, Nginx).

I also configured the SMTP port as 25 and opened 25 port on Security Groups of my EC2 instance.

And now the backend is working properly.

But when I send an email to [email protected], it doesn't receive anything.

Please guide me how I can resolve this.

Thanks,

Mail Tester causes service crash if failed

If the server is misconfigured the mail tester causes a crash, because result is undefined.

logger.info('Mail tester error!', result.result);


{"level":"info","message":"connecting to db"}
(node:1) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use `node --trace-deprecation ...` to show where the warning was created)
{"message":"Connected successfully to mongodb server","level":"info"}
{"message":"starting smtp on 25","level":"info"}
{"message":"API server listening","level":"info"}
{"message":"::ffff:10.175.153.38 - GET /api/alive HTTP/1.1 200 49 - 9.768 ms -\n","level":"info"}
{"message":"SMTP Connect from 127.0.0.1","level":"info"}
(node:1) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
/app/server/app/mailTester.js:61
      logger.info('Mail tester error!', result.result);
                                        ^
ReferenceError: result is not defined
    at /app/server/app/mailTester.js:61:41
    at /app/node_modules/nodemailer/lib/mailer/index.js:226:21
    at /app/node_modules/nodemailer/lib/smtp-transport/index.js:239:32
    at callback (/app/node_modules/nodemailer/lib/smtp-connection/index.js:435:13)
    at /app/node_modules/nodemailer/lib/smtp-connection/index.js:445:24
    at SMTPConnection._actionMAIL (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1370:20)
    at SMTPConnection.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:857:18)
    at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:764:20)
    at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:570:14)
    at TLSSocket.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:710:55)

Mailbox appears to be deleted sooner than emailDeleteAge

I've noticed that a mailbox has gone missing from MongoDB but the emails which were part of the mailbox remain. Could it be that the mailbox is not taking into account the emailDeleteAge? I've set mine very high: 2592000 / 30 days.

Cheers.

cannot add multiple allowed domains in docker-compose.yml

Hi!

AHEM works properly only with one domain in format in docker-compose.yml

allowedDomains=domain.com

If i try use multiple domains, for example:

allowedDomains=domain1.com,domain2.com

or:

allowedDomains=["domain1.com","domain2.com"]

it doesnt work, i cant select domain.. Can anybody helps?

How to whitelist port 25

we are Running AHEM on the AWS ec2 machine, Working Fine

we Have enabled Guard duty for every 2 days we are getting alerts on port 25 if probed,

Is there any way to white list the port 25? we tried with the NAT gateway but does not worked

SMTP is not working.

Hi,

Thank you for the great work.
Mails are not getting delivered when running locally.
For Example, I have created a mailbox [email protected] and sending mail to this mailbox from Gmail.
It is not working for me.

Domain Expired ?

The domain www.ahem.email possibly expired and instead of the project's website bunch of malware and ads are showing. Please either re-register the domain or update the website. Thanks.

npm install issue | Ubuntu 20.04

After running npm install command:

56 packages are looking for funding
run npm fund for details

found 19 vulnerabilities (18 low, 1 high)
run npm audit fix to fix them, or npm audit for details

npm audit fix - do not help
All prerequisites was installed

Error 404 '{"error":"MAILBOX IS EMPTY!"}' in Postman or IDE, but on ahem email ui interface emai is recieved

Hello:)
what can be the reason for error 404 even if on ui (i mean 'https://www.ahem.email/mailbox/N4CNWF') i get the email list, but if i sent the same info(i mean emailName, Bearer token) in Postman or IDE i get. Moreover if i use your doc tool( this one -> https://www.ahem.email/help/api) with same info i also get error 404
https://monosnap.com/file/iinNdniiaonmwbYs2ZQqVgvJ9Gwbuw
https://monosnap.com/file/58XrVtrnj5QpkFCAj7p97cZ2Yq82Ve
here are screenshots for same email and token.
thanks

Missing folder nodes_modules

Hi, While trying to npm install inside the ahem folder, the cmd is trying to hit a path Ad-Hoc-Email-Server\node_modules which is not available in the git pull. Kindly suggest

Snap -
image

Can't receive email

Hi, o4oren

I have setup the mail server and that works fine via api (api/alive)

But when I send the mail to [email protected], it doesn't work.
It returns "Your message wasn't delivered to [email protected] because the address couldn't be found, or is unable to receive mail."

Any configuration I missed?

Kindly need your help ASAP.

Thank you.

No mails are received for custom domain

Hi there, I did all the procedures to setup AHEM with a custom domain name of me. I added the domain in the list of properties.jsoon and in the docker-compose.yml
Besides that; I pointed the domain's DNS records to the same IP as the server. however; I don't think that's enough for the app to read the mails.
I mean; the app was built on the server and the front end is working fine and I can generate a mail and it takes me to the mailbox ... however, nothing is received

so could you please make It clear of how to set up the domain to make it working said with the backend?

thanks in advance

Programmatic API ?

Hello,

Is there, or could there be, a programmatic API, for this server, so that it can be dynamically used by a parent script to start, receive and stop ?

Thanks

Server stores email sent to random addresses

Hi, I was looking through my MongoDB instance used by AHEM and see emails are being stored even when the recipient address is not in the allowed domains list. Mailboxes are not being created. Is this the expected behavior?

It seems spammers are just looking for mail servers on random IP addresses and stumbled upon my AHEM server.

Use Multiplie Domain

Im' forrmat:
allowedDomains=["my.domain.com", "my.second-domain.com"]
but only show my.domain.com on my web
Please guide me how to use multiplie Domain

Service issue

Hello,

I've been experiencing some service issues with the example app (https://www.ahem.email/) recently. Urls for mailboxes now return 404 when they didn't before (https://www.ahem.email/mailbox/testing) the app does load correctly if I type the username from the homepage but even then it intermittently fails to load emails.

Sorry to post a service issue in this code repo but I wasn't sure where best to direct it. Has this been on your radar at all?

Many thanks!

Unable to receive the email

Hi

I have configured the AHEM server and below are the details of the .env file

serverBaseUri= "http://10.135.10.125:3000"
mongoConnectUrl= "mongodb://10.135.10.125:27017/"
dbName= "ahem"
appListenPort= 3000
smtpPort= 2525
emailDeleteInterval= 3600
emailDeleteAge= 86400
allowAutocomplete= true
allowedDomains= "ahem.email"
jwtSecret= "AH3M 709 S3cR3T"
jwtExpiresIn= 3600
maxAllowedApiCalls= 1000

When I open the application with the following url http://10.135.10.125:2500 it's loading the homepage.

when i sent to email ex: [email protected] from my gmail account I'm not getting the any email.
Can you please let me know is anything wrong with my settings? or do I need to add anything?

Can't receive any email except from my domain

  1. Setup(OK)
  2. Go to the ip:port(OK)
    So, i tried to use it, it store the "tokens" but not the mailboxes(number is always to 0 in the home of the website) and when i try to send an email to [email protected] with gmail i have: 550 5.1.1 [email protected]: Recipient address rejected: User unknown in virtual mailbox table

(mydomain.com is for the example, it's not my domain)

Solved

Feature request: webhooks

Hi. Very useful project, thanks.

I think a webhook feature would be useful where the admin registers a URL and AHEM hits it every time a new message arrives. The body of the call could contain the mailboxName and emailId.

I wish I could do this myself but my node skills are poor, not to mention TypeScript.

Cheers!

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.