0

For my project, I need to generate and register a new email address with my Flask api.

Basically, when the users signup, an email address has to be generated specifically for that user where users can forward his emails and our service will scrape those emails. This is something like what Trello does after creating a board it assigns an email address and when you forward a mail to that address it makes a card out of it.

I am unable to find any resources to do this task. If anyone has any idea how to get this done (if possible not just email but also the tracking service).

A note about tracking service

I can easily make a tracker that would listen to gmail every 3-4seconds and scrape any new mails and this process will run as daemon. But the problem is this approach is not scalable since I cannot run a new daemon for every single user that registers on the platform. If there is more efficient way to do it, please let me know.

But the first point remains that I need to generate email addresses and signup with them through Python.

halfer
  • 19,824
  • 17
  • 99
  • 186
Akshay Gupta
  • 31
  • 2
  • 10
  • Do you have a mailserver? It should provide an API for registering new emails and sending emails, or at the least you should be able to add a new email to the database. If you're trying to make gmails or something you're ... well you're not supposed to do that, that's why there's captchas. – Alex Weavers Sep 28 '18 at 05:44
  • I don't think this is a web scraping problem - if you want to create new email addresses, you need to set up a mail server. Some of them will have APIs that will allow you to create mailboxes programmatically. – halfer Sep 28 '18 at 10:33

1 Answers1

3

You have not specified the who the email provider is but you mention scraping Gmail, if you are wanting to programmatically create Gmail accounts you will not have much luck, see this link for more details Can I create a Google account programmatically?.

If you have an alternate mail provider in mind then provide details.

With regard to creating a new daemon per user, a typical solution would be to create the accounts and grant delegated authority to a master account which can then read each mailbox or register for notifications of events like new mail received, for large numbers of users you may want to partition users across multiple readers or event handlers. Again how you support this would be highly dependent on the mail provider.

An alternate approach if using Gmail, if the email account is purely for receiving email to be scraped by your application e.g. the user will not have credentials and access to this inbox, would be to create a single Gmail account like myapp@gmail.com then for each registered user create a random string of characters like "abc123" then have that user email myapp+abc123@gmail.com, gmail will receive this email into the myapp@gmail.com inbox but keep the To: address as myapp+abc123@gmail.com which you can process on scraping to identify the user.

Daniels
  • 161
  • 4
  • Hey, this is very useful. You have given me a direction. But, regarding the mail provider I would actually like to do it with zohomail because we are using zohomail for business addresses. And also they give API for registering user to a group. Thanks :) – Akshay Gupta Sep 28 '18 at 07:19