o4oren / ad-hoc-email-server Goto Github PK
View Code? Open in Web Editor NEWAn ad-hoc disposable temporary mail server. Create and use ad hoc disposable mailboxes for testing or any other purpose.
License: Apache License 2.0
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
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.
Hello,
The link for api doc is dead :
https://www.ahem.email/help/api
Do you have any solution to get the doc ?
thanks,
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)
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:
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
Kindly add heroku support
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
Hi, I've configure the server as follows:
still not able to get email on mailbox , please suggest things i can check for.
Hi. I just want to alert you that the advertisers on your https://www.ahem.email/ page are showing misleading ads about virus infection.
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,
If the server is misconfigured the mail tester causes a crash, because result is undefined.
{"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)
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.
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?
Hi
I followed this article and followed step by step process but still getting this error in the end
node version v11.5.0
npm version 6.7.0
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
[Previously I wrongly thought this code was from another party. The issue updated as now makes sense].
"Open source" does not mean "source available":
https://opensource.org/osd
https://en.wikipedia.org/wiki/Source-available_software
The FAQ wrongly claims AHES is open source. It is not, it's just source available because open source is about the license as well and the license here is proprietary.
Hi, so I was wondering if you could consider making another version but without the frontend, just the api and the smtp server. Thanks
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.
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.
After running npm install
command:
56 packages are looking for funding
run npm fund
for details
npm audit fix
to fix them, or npm audit
for detailsnpm audit fix
- do not help
All prerequisites was installed
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
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.
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
I followed the readme, using manual install not docker.
I assume this is some sort of deprecation or whaterver. Shoul that module be already present at install step?
Hello,
As per GitHub documentation, trying to get list of mailboxes using POST API call '/api/mailbox/autocomplete'
http://mydomain.com/api/mailbox/autocomplete?prefix=test
However it doesn't give any result, response status is 200 OK. Tried to pass the param 'prefix' in all possible ways but same issue. Please can anyone guide on how to get list of mailboxes.
Thank you !
Hi,
Can you please review all your docs? It seems docs are out of date. For example, these lines are invalid:
git clone https://github.com/o4oren/ahem-server.git
cd ahem-server
Old info is present in README and also in this article: https://www.ahem.email/blog/post/how-to-set-up-your-own-disposable-email-server.
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
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.
@o4oren I need SSL certificates to be configured on AHEM server side. Please can anyone help on how can I achieve this. Thanks!
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
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!
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?
(mydomain.com is for the example, it's not my domain)
Solved
I am struggling to understand how to fetch emails using the API. Could you provide a sample call to /api/mailbox/{mailboxName}/email?
So far I came up with the following:
HEADERS:
Authorization: Bearer ---mytoken---
url: https://www.ahem.email/api/mailbox/[email protected]/email
but it returns an error. Why?
Hello,
Not sure why I am getting this error. The docs state that jwtExpiresIn:-1 will not enforce authentication..not sure what else to do at this point.
While calling https://www.ahem.email/api/mailbox/tester123:
"error": "Error | Cannot find module 'html'"
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!
When i make F5 on a website i get this error
{"error":"Error | Cannot find module 'html'"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.