Redirect emails to default email address for testing purpose - moqui

I am working on email feature in moqui. I am able to configure the EmailServer data and email feature working fine. I would like to know that do we have any way in moqui to redirect all email to an specific address for testing purpose. Like we have "mail.notification.redirectTo" feature in OFBiz?
I am not able to find this kind of feature in moqui. How can we achieve this functionality?
Thanks in advance.

There is not currently a setting like this. The main debug approaches I use are leaving the default EmailServer record as-is so that email sending is disabled and the message text is logged and setting email addresses to one of my own email addresses. Setting my own email address on the john.doe account is easy because I leave my test settings including email server details (un, pw, url, etc) in a data load file that I load when testing things that require this sort of configuration.

Related

Is it possible to launch the user's default email client from a web page (not mailto)?

I'm familiar with mailto:// links; that's not what this is about.
This is more akin to Sniper Links, which are useful to reduce friction in the process of confirming a new user's email address. We've just sent the user an email, and we want to give them a one-click way to go find it.
Sniper Links, as described at the link above, are great for that, but they're limited, in that:
The user must have a web-based email service.
We must be able to determine the mapping between email hostname and email provider (e.g. "some.guy#gmail.com" should go to the Gmail interface).
Those are mostly solved problems. Most people these days do use web-based email, and many who instead choose to use dedicated apps can use a web-based client. This is not universal, of course.
Mapping between hostname and provider is sometimes trivial (like the #gmail.com example above), sometimes not (#somecompany.com -> Google Apps is less obvious). If it's not directly obvious from the hostname, an MX record lookup will reveal the truth in the case of Google Apps and a most of the other big names in corporate email hosting. Services like ZeroBounce offer APIs to do the lookup and translation for you, for a fee.
But there are users whose email addresses do not have web interfaces, or for whom the URL of the web interface is not easily determined. For these users, I'd like to be able to bring up their preferred email client (assuming the browser -- or the underlying OS -- knows what it is).
I know that a mailto:// link will launch the default email client (whether web or app) and start composing a new outgoing message.
From a web page, is there a way to launch the default email client without starting a new outgoing message? I'm assuming this would take the form of a URI scheme, but it could also be a JavaScript API call or something else entirely.
Bonuses:
Also cause it to navigate to the inbox
Navigate, search, or filter such that we're likely to find our specific message (based on sender, date, subject, mailbox, etc)
Navigate to the precise message we just sent
No, that is not possible. Browsers won't open Apps "without" a reason. This could also be a major security risk, if they would do.

How to check for duplicate email address in spartacus storefront?

How can you check that an email address already exists in spartacus? The reference class for this type of query would be UserService. But it does not contain this kind of method or anything simillar.
In the past, we had this functionality built in. But because of security reasons our backend is not sending us any feedback about email/password/account being incorrect/existing/etc anymore. So even if you'd do anything on the frontend, the backend will not help with that.
Here's one of the PRs, where we had to change the register flow - before, it was logging you in automatically once registered successfully, but if your email was already used, it wasn't logging you in - boom, security issue (possibility to check if a given email is used on this specific site)
So, unless you customize your backend (not sure if even possible), you cannot really check if email already exists in Spartacus.

detecting link checkers (spam filter) in incoming HTTP requests

We have a site that uses a "one-time" login process for password resets which are not initiated by the user themselves. (for instance, a password reset that is initiated by an admin or another employee) A URL is sent to the user via email which can then be used to reset their password. The URL can only be visited one time. (there's more to this for security-sake but I'll keep it simple) Recently, some users have complained that when they visit the link, it has already expired. The end result is that they can't reset their passwords using this feature. We discovered that the users in question have a spam filter or "link checker" in their environment that they do not have access to. This device visits the one-time link before the user is able to, to make sure its safe.
I'm trying to solve this issue and was wondering if there's a way I can detect these type of devices on the web server when the request is made? When the spam filter visits the link, is there something in the http request that would stand apart from a regular browser? Maybe they all use a specific custom HTTP header? Or maybe there's a regex I could use on the user agent? I haven't been able to catch one of these yet, so I'm not sure what the request looks like coming from a spam filter.
Anyone know of a way to detect spam filters of any vendor by looking at the http requests? I know it's a long shot but maybe they all use a specific header for reasons such as this?
I got approval to modify the design to remove the one-time aspect of the URL. This solves the issue and saves me the headache. Thanks for the suggestion, #PeeHaa

How to get SMTP details automatically in VB.NET like in thunderbird

I have made a VB.NET application. I have read I tutorials that how to use SMTP to send emails from VB.NET, and finally I got one working.
But I have an issue with it, I don't want to bother the user to input all his details like, SMTP server name and all those stuffs.
I just want that a user input their Usename and Password and all other necessary details gets available for the application. Same like thunderbird, as when I enter my Usename and Password in Mozilla thunderbird it automatically get all the other required data and configures my email account.
Now what I want to accomplish is that, a user should fill in their details i.e. Usename and Password & the email using their Usename and Password should be sent to the email specified in the program.
To explain more about the kind of my project is, when an error occurs I want the user to take a screenshot of it and email me it using this method. So that I can look into the bug.
There is no automatic way of doing this. Each email setup is different and there is no automated configuration specification.
Thunderbird has a built in database that it's developers built and maintain to offer this functionality. See: https://support.mozillamessaging.com/en-US/kb/isp-database
You could do the same using the #domain.tld to enable you to match the users email provider with your database.
Microsoft Exchange does offer an automatic configuration endpoint, but I don't think it would prove useful to you as it isn't guaranteed to include SMTP information.

What are the best practices to prevent staff taking over user accounts by editing the email address?

We are building a CRM type app although this would apply to any application where there are "members" and "staff" e.g. a shopping site, dating site, facebook etc.
In our app, users can change their password the usual way, by resetting it with email confirmation. Users can also have more than one email address associated with their account.
What we are trying to work out is how to prevent staff using the system taking over the accounts. We want staff to be able to edit the email address (because someone may phone in and request a change); the issue then is they can simply change the email to one they control - and request a password re-set as a user.
Are there any recommended best practices for this?
You could require the user to also authenticate the action by other means, such as when the email address is changed the user is sent a confirmation code via text message that they must input somewhere.
Another means would be to only allow access to the account if certain information is inputted correctly. This could be address information or DOB. It is unlikely that this information could be guessed from something like a name or account number.
1) Add one of those silly security questions like "What is your favorite color?" and store the answer, encrypted, in the database. Staff could edit the email to their heart's content, but if they didn't know the answer to the secret question the system wouldn't let them change the password. If you have concerns about staff trustworthiness, then you need to introduce something outside their control that serves as a final gateway before you can change the user account.
I imagine a simple implementation would simply check to see if the user reset their password. If so, on login, it challenges them with the security question to "authenticate" them before allowing them to proceed.
2) Logging, monitoring, and auditing. Record which staff accounts accessed the email address change form, what address(es) they changed, what they changed them too, and when they changed them. Also record the connection information of the people accessing the accounts. If your logs show one IP address accessing 4-5 completely disparate accounts, you might need to look into that. (Yes, I know you can use proxies etc. to mask this. Not perfect but it'd weed out the chaff pretty fast).
3) Hire trustworthy people! #2 should really only need to be used as a "check" against abuse instead of the end all be all to stop it.