EmailDiscussions.com

EmailDiscussions.com (http://www.emaildiscussions.com/index.php)
-   Email Help Needed! (http://www.emaildiscussions.com/forumdisplay.php?f=7)
-   -   sieve script rejects email w/o message (http://www.emaildiscussions.com/showthread.php?t=74762)

SpokaneDude 2 Dec 2019 04:04 AM

sieve script rejects email w/o message
 
Here is my sieve script that is supposed to reject a reply to my sent email; the rejection works, but the message does't! Would really appreciate some help on this, since I'm a noob (newbee).

require ["fileinto", "reject", "variables"];

if address :is "From" "do-not-reply.validEmailAddress.com" {

reject "Do not attach to this email; attach your article to a NEW email\n";
}

Thanks in advance... SpokaneDude

somdcomputerguy 2 Dec 2019 08:13 AM

Code:

reject "Do not attach to this email; attach your article to a NEW email\n";
You probably need to escape the first semicolon, I'm not even close to a seive expert though.

- Bruce

n5bb 2 Dec 2019 08:47 AM

I don’t know which email system you are using, since you posted in the general “Email Help Needed!” forum. So I’m going to respond with respect to Fastmail (which has a sub-forum here).

There is no reason to escape a semicolon in a string in a Sieve rule. But the backslash character is ignored in your C-style attempt at adding a new line character (which is not needed). So when I use your rule in a Fastmail Sieve script, the automatically generated reply is:
Code:

Your message was automatically rejected by Sieve, a mail
filtering language.

The following reason was given:
Do not attach to this email; attach your article to a NEW emailn

So if you remove the backshash n it works fine for me. The reject message is properly sent as shown to the sender. When you say that the reject message doesn’t work, what exactly did you mean?

Bill

somdcomputerguy 2 Dec 2019 08:23 PM

Quote:

Originally Posted by n5bb (Post 612401)
There is no reason to escape a semicolon in a string in a Sieve rule.

See, SpokaneDude, I told you I was far from a Sieve expert. I couldn't even spell it right. Seems 'i' before 'e' went out the window with me.. :cool:

- Bruce

rmmarsh 2 Dec 2019 11:29 PM

sieve script rejects email w/o message
 
Quote:

Originally Posted by n5bb (Post 612401)
I don’t know which email system you are using, since you posted in the general “Email Help Needed!” forum. So I’m going to respond with respect to Fastmail (which has a sub-forum here).

There is no reason to escape a semicolon in a string in a Sieve rule. But the backslash character is ignored in your C-style attempt at adding a new line character (which is not needed). So when I use your rule in a Fastmail Sieve script, the automatically generated reply is:
Code:

Your message was automatically rejected by Sieve, a mail
filtering language.

The following reason was given:
Do not attach to this email; attach your article to a NEW emailn

So if you remove the backshash n it works fine for me. The reject message is properly sent as shown to the sender. When you say that the reject message doesn’t work, what exactly did you mean?

Bill

Hi Bill... I made the one change you suggested, but still not getting the message... I'm using Fastmail.com as my email provider (Postbox as the email client)... also, should I move this to the Fastmal sub-forum? Added: here's the message I do get tho': 550 No Such User Here"

n5bb 3 Dec 2019 11:56 AM

Troubleshooting SMTP 550 No Such User Here error
 
Since we are already discussing your issue here in this general forum, I would not double-post. Maybe a moderator could move this thread to the Fastmail sub-forum.

Quote:

Originally Posted by rmmarsh (Post 612408)
... I'm using Fastmail.com as my email provider (Postbox as the email client)... also, should I move this to the Fastmal sub-forum? Added: here's the message I do get tho': 550 No Such User Here"

550 is a SMTP error code normally issued by a SMTP MTA (message transfer agent) server.

https://en.wikipedia.org/wiki/Message_transfer_agent
https://en.wikipedia.org/wiki/List_o...r_return_codes
Error 550 is usually returned when the recipient "TO" mailbox can not be reached, for example if the TO address was incorrect or did not exist at the given domain on the receiving email system. But it can also be generated if your email client can't properly submit the message due to some problem (typically authentication of your email client due to an incorrect username or password or server port or SSL/TLS encryption problem).

So to troubleshoot this:
  1. First remove your Sieve rule to stop any confusion it may cause.
  2. Then try sending from that email client to your main Fastmail email address (not an alias).
    • If that fails, then there is probably something wrong with your email client configuration. Do not continue with the steps below.
    • If that works properly with no errors, then your problem must be due to something related to the TO email address, and you can continue troubleshooting.
  3. Next send from that email client in exactly the same way that worked in (2), but change the TO address to the one you have been testing.
    • If this works, then I don't see why you are getting the 550 message. The Sieve commands should not cause this message to be generated.
  4. If this fails, then carefully examine the TO address.
    • Is it your primary Fastmail address?
    • Is it an alias address which is properly enabled to target your Fastmail account?
    • Is it an alias address which instead targets an external non-Fastmail address?
    • Is it a subdomain address which is improperly formed?
My guess is that the message isn't getting properly submitted by your email client for some reason.

Bill

JeremyNicoll 3 Dec 2019 07:29 PM

Right at the start the OP said:

if address :is "From" "do-not-reply.validEmailAddress.com" { ...

so maybe the address is syntactically valid but not recognised by the mail host at that domain?

Maybe not only are you not supposed to reply to it, but it actually does not exist so you cannot reply to it?

Maybe the actual sender's address is something else?

SideshowBob 4 Dec 2019 12:48 AM

I don't understand what's supposed to be happening here. It says you want to "reject a reply to my sent email". In that case I would expect the "do.not.reply" to have been in the "From" in your outgoing mail, so your script should be testing "To" in the reply.

rmmarsh 5 Dec 2019 06:27 AM

What I want to accomplish is when a person tries to respond to the email I have sent them, I want the Fastmail Sieve code to reject their reply with a custom message other than "550 No Such User Here".

I am waiting for the webmaster of the target email system to create the email address "do-not-reply..." which I think will solve the problem. I will get back to this forum as soon as he creates the email address (his wife is in the hospital right now, so I told him "family comes first" and I can wait.

Thanks everybody for the comments; I'm sure it will be resolved relatively soon.

SpokaneDude

n5bb 5 Dec 2019 06:59 AM

Quote:

Originally Posted by rmmarsh (Post 612433)
What I want to accomplish is when a person tries to respond to the email I have sent them, I want the Fastmail Sieve code to reject their reply with a custom message other than "550 No Such User Here"...

If the From address you use at Fastmail when you create the message is a valid Fastmail account or alias, then you won’t get a 550 SMTP error when they reply. The “550 No Such User Here” message is not generated by Fastmail, but as I noted earlier at some other email system. When you send a message to a non-existing address at a Fastmail-owned domain, the sending MTA SMTP server receives the response:
Code:

550 5.1.1 <bad address placed here>: Recipient address rejected: User unknown in virtual mailbox table
The person sending such an email to a non-existing email address will receive a message which is generated by their own email system. It might contain some of the text shown above, or it might be something like the text you quoted.

If you create a From address at Fastmail for only this purpose, you can use a Sieve rule as you described to create a response. But it is a reject message which will contain the initial content as I described in an earlier post.

Bill

JeremyNicoll 5 Dec 2019 05:54 PM

Quote:

Originally Posted by rmmarsh (Post 612433)
What I want to accomplish is when a person tries to respond to the email I have sent them, I want the Fastmail Sieve code to reject their reply with a custom message other than "550 No Such User Here".

I am waiting for the webmaster of the target email system to create the email address "do-not-reply..." which I think will solve the problem. I will get back to this forum as soon as he creates the email address (his wife is in the hospital right now, so I told him "family comes first" and I can wait.

Thanks everybody for the comments; I'm sure it will be resolved relatively soon.

SpokaneDude

Why does the webmaster of the target email system have to create something? And is that "do-not-reply..." meant to be do-not-reply@target.domain?

If the do-not-reply... address IS @target.domain then anyone who does create a reply will send it to the target.domain and you'll never see it so your Sieve code at Fastmail is irrelevant.


More to the point though if your original outbound email is From: your address and a reply is sent back to your address, we're not in 550 territory.

On the other hand if your original mail leaves with a Reply-To address set to do-not-reply@some.fm.domain then a reply sent to that address either gets to you (because do-not-reply@some.fm.domain IS an address you've set up), or doesn't (if you haven't created it). Or, if FM are hosting your entire domain for you, it presumably will get here... and again there's no 550.

I think you need to be clearer about what's going on.
- are you using generic FM domains, or are FM hosting your domain?
- what are you expecting the webmaster at the target site to do?

You are never going to be able to stop someone from sending a reply either to your reply's From address or to its Reply-To address (if you set one) though.


Your short example of Sieve code did not show it, but I'm wondering how you're planning to tell that an incoming mail (a) has an attachment, (b) that it's the kind that matters - 'an article', and (c) that it is arriving as a reply to an earlier message of yours and isn't a 'new' mail in the way you advise such users to send things to you?

rmmarsh 5 Dec 2019 10:27 PM

It works!
 
Morning everybody... the fix was to have the email address (do-not-reply...) as a valid email address on the server... works like a charm!

Thanks to all who gave me their ideas...couldn't have done it without your comments!

SpokaneDude

FredOnline 6 Dec 2019 12:06 AM

Quote:

Originally Posted by rmmarsh (Post 612439)
Morning everybody... the fix was to have the email address (do-not-reply...) as a valid email address on the server... works like a charm!

Thanks to all who gave me their ideas...couldn't have done it without your comments!

SpokaneDude

SpokaneDude & rmmarsh are the same person? :confused:


All times are GMT +9. The time now is 10:49 AM.


Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy