Jump to content

Recommended Posts

To create a new gitlab issue, I'd like to send an Email to the following email address using FormBuilder: 

incoming+account/repository@incoming.gitlab.com

unfortunately, the / in the email gets striped by the sanitizer:

wire('sanitizer')->email(incoming+account/repository@incoming.gitlab.com'); 
// output: incoming+accountrepository@incoming.gitlab.com

Is there any way to configure the sanitizer? Any other Ideas how to send the mail to this address?

 

Ps.: I can not define the email format as it is defined by gitlab. The format is also kind of "common" and known as email-alias in the form of emailaccount+alias@domain.com – gmail uses it to label mails…

https://help.wodify.com/hc/en-us/articles/234441508-How-Do-I-Create-an-Email-Alias-

Share this post


Link to post
Share on other sites

Weird. I've never seen a forward slash in an email address.

If I enter the above address in the TO field in Gmail, it's being converted to incoming@incoming.gitlab.com

https://www.jochentopf.com/email/chars.html says it's "maybe" allowed:

Quote

The forward slash is often used in email addresses used by X.400 gateways. Example: 'PN=Joe/OU=X400/@gateway.com'. Because the slash is used as a directory separator in UNIX and other operating systems, it is probably not a good idea to use it in local parts. If you ever want to save the mail in a mailbox named after the local part, you will have problems.

 

Share this post


Link to post
Share on other sites

As I said, I have no control over that part… It works in my email client and is what gitlab provides for inbound issues… The one end I can change is my implementation of PW 😉

Share this post


Link to post
Share on other sites

Sadly, gitlab has known that the forward slash is problematic for quite a while now but the resolutions keeps being pushed from milestone to milestone. There are a lot of mail servers and webmail clients out there that can't deal with these slashes (MS Exchange and Debian's exim default configurations are such examples), so any solution likely involves moving to more common delimiters in the local part of such gitlab addresses, which in turn means that PHP's built-in email sanitizing filter (which $sanitizer->email uses) will then be sufficient.

To speed things up, it might help to upvote the corresponding gitlab issue.

  • Like 1

Share this post


Link to post
Share on other sites

I've just read this quickly. Maybe for now your options are:

  1. Sanitise separately: i..e, do the email itself bit then append your incoming+account/
  2. Use your own regex to sanitise the email (e.g. using $string = $sanitizer->match(string $value, string $regex);  Docs are here)
  3. Sanitise as you are doing then re-insert your / afterwards using string replace or similar.

Like I said, I read this quickly, so, I might be missing the point 🙂.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By neophron
      Hi,
      I hope, this is the right place for questions about the Formbuilder (I couldn't find in the ProField support a subsection for the Formbuilder).
      A client needs for his website a random generator of a code (as winning numbers). This generator should be placed in a simple form (name and email) and a random generated code should be visible there.
      This code, or winning number, must be stored in the db together with the name and email. And the participant must receive a confirmation email with this code.
      I know, that the Formbuilder can store and send data to the user. But what about a random generated code? Is this a hook job?
      I found this module: http://modules.processwire.com/modules/process-field-generator/ but it's not for PW 3. 
    • By prestoav
      Hi folks.
      I'm building a Formbuilder form to create new advert pages in a marketplace. Formbuilder is ideal for this. I need to add a description field that allows text to be added with line breaks etc. so showing a CKEditor field would be ideal (i.e. exactly like the field I'm typing into right now)!.
      Does anyone know if it's possible to add a CKEditor field to the front end presentation fo a Formbuilder field, maybe via a module or such?
      Many thanks!
    • By ngrmm
      I have a page which sends out an email based on queries in the url
      <?php // event ID $eventID = $input->get('eventID','int'); $event = $pages->get($eventID); // config $adminEmail = "events@test.com"; $fromEmail = "noreply@test.com"; $fromName = "test"; $emailSubject = "Test Email"; // HTML BODY $emailBody = ""; // HOW TO ??? … // send mail $m = new WireMail(); $m->to($adminEmail); $m->from($fromEmail, $fromName); $m->subject($emailSubject); $m->bodyHTML($emailBody); $m->send(); ?> The email body is a bit complex: standard html/css tables and some php (pw variables).
      I put my emailbody (html) in a seperate file emailbody.inc but don't know how to include it?
       
    • By Robin S
      Sanitizer EasySlugger
      Allows the use of the EasySlugger library as Sanitizer methods.
      Installation
      Install the Sanitizer EasySlugger module.
      Usage
      The module adds four new sanitizer methods.
      slugger($string, $options)
      Similar to $sanitizer->pageName() - I'm not sure if there are any advantages over that method. Included because it is one of the methods offered by EasySlugger.
      $slug = $sanitizer->slugger('Lorem Ipsum'); // Result: lorem-ipsum utf8Slugger($string, $options)
      Creates slugs from non-latin alphabets.
      $slug = $sanitizer->utf8Slugger('这个用汉语怎么说'); // Result: zhe-ge-yong-han-yu-zen-me-shuo seoSlugger($string, $options)
      Augments the string before turning it into a slug. The conversions are related to numbers, currencies, email addresses and other common symbols.
      $slug = $sanitizer->seoSlugger('The price is $5.99'); // Result: the-price-is-5-dollars-99-cents See the EasySlugger readme for some more examples.
      seoUtf8Slugger($string, $options)
      A combination of utf8Slugger() and seoSlugger().
      $slug = $sanitizer->seoUtf8Slugger('价钱是 $5.99'); // Result: jia-qian-shi-5-dollars-99-cents $options argument
      Each of the methods can take an $options array as a second argument.
      separator (string): the character that separates words in the slug. Default: - unique (bool): Determines whether a random suffix is added at the end of the slug. Default: false $slug = $sanitizer->utf8Slugger('这个用汉语怎么说', ['separator' => '_', 'unique' => true]); // Result: zhe_ge_yong_han_yu_zen_me_shuo_3ad66c4  
      https://github.com/Toutouwai/SanitizerEasySlugger
      https://modules.processwire.com/modules/sanitizer-easy-slugger/
    • By Peter Knight
      I have a few web forms which require testing on a weekly basis and I don't want the recipients (administrators) to receive these test emails.
      What would be a good way to test approx 15 forms from the front end and have the test delivered a list of secondary administrator recipients?
      I'm thinking that I could have some kind of config file which watches for a trigger word or email and then understands that it's a test and to bypass the normal admins?
      All of the forms ask for an email address so I could setup an email such as 'testform@email.not' etc which my config file (hook?) would watch for.
      Or is there a better way to do this?
      Additionally, I have a few extra requirements...
      Forms should goto an alternative success page. This is because I don't want my test to skew my Google Analytics conversion tracking Forms would need to be tested from the front-end and not the PW admin area Any advice appreciated.
      BTW I realise this should be posted in the proper FormBuilder support forum. I am in the process of renewing my license for access to that support forum.
       
×
×
  • Create New...