Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a receiving mailbox which has been configured with an uppercase character. This creates problems when sending to gmail, for example, since they convert the address to all lowercase and then the return email is rejected. Conversely, if I config the mailbox in Drupal as lowercase, my domain servers will uppercase internal e-mails and they will be rejected. In mailcomment_mailhandler() I'd like to switch the match logic to:
// If not a catchall, check only for direct matches
if (in_array(strtolower($to), array_filter(mailcomment_mailboxes(), 'strtolower'))) {
$matched = TRUE;
}
// Do host match for catchalls
else if (in_array(strtolower($header->to[0]->host), array_filter($hosts, 'strtolower'))) {
$matched = TRUE;
}
If that looks sensible I will create a patch.
Comment | File | Size | Author |
---|---|---|---|
#6 | case_insensitive_mailbox-907794-6.patch | 813 bytes | deekayen |
#2 | email_case.patch | 1 KB | cYu |
Comments
Comment #1
gregglesThis seems reasonable to me. A patch is easier to actually review, though, so I may have more questions when I see the patch.
Comment #2
cYu CreditAttribution: cYu commentedPatch attached. Thanks.
Comment #3
cYu CreditAttribution: cYu commentedIs drupal_strtolower overkill to use on e-mail addresses and domains?
Comment #4
obrienmd CreditAttribution: obrienmd commentedNot sure about your #3 question, cYu, but patch is working great for me and solves a problem I've run into a number of times (gmail-related, as yours was).
Comment #5
cYu CreditAttribution: cYu commented@obrienmd: Can't tell if you are not sure what my question is or not sure what the answer is, so I'll clarify just in case. In general drupal_strtolower() is preferred over strtolower() for unicode compatibility. I think restrictions for valid e-mail addresses and domains make it unneeded here, but I don't know for certain.
Comment #6
deekayen CreditAttribution: deekayen commentedGit-style patch of #2 attached against 6.x-1.x. I can see the maintainer has moved on, but Open Atrium, and it's large user base, are still using 6.x-1.0.
Comment #7
Dane Powell CreditAttribution: Dane Powell commentedTriggering automated testing.
Comment #8
Dane Powell CreditAttribution: Dane Powell commentedhttp://drupalcode.org/project/mailcomment.git/commit/9e5117c
Now that OA2 is in beta, this will probably be the last commit for Mail Comment 6.x-1.x.