"Mailbox size limit exceeded" when sending mails on an empty exchange account with MailKit .Net - vb.net

I am using MimeKit and Mailkit to send emails from my VB.NET application, through my own SMTP server (run on Windows Server 2016, with SmarterMail).
Until then, I was sending emails to info#mywebsite.com which is an alias of infos#mywebsite.com and it worked very well. This email account is a exchange account with more of 49 Gio free.
Since a few days, I've received this error : Mailbox size limit exceeded
When a set a spy on it, this is what I get :
This is the log :
S: 235 Authentication successful
C: MAIL FROM:<info1#mywebsite.com> SIZE=599
S: 250 OK <info1#mywebsite.com> Sender ok
C: RCPT TO:<info#mywebsite.com>
S: 452 <info#mywebsite.com> Mailbox size limit exceeded
C: RSET
S: 250 OK
I don't understand why I get this error while my recipient account is pretty much empty.
When I try to send email from my outlook account to info#mywebsite, I get no error.
When I try to send emails from my code to anothers recipients, I get no error.
My disk space is very large on my mail serveur (almost 2 To).
This is my code :
Dim message As New MimeMessage()
message.From.Add(New MailboxAddress("My website", "info1#mywebsite.com"))
message.To.Add(New MailboxAddress("My website", "info#mywebsite.com"))
message.Subject = "any subject"
Dim builder As New BodyBuilder()
builder.TextBody = textemail
builder.HtmlBody = htmlemail
message.Body = builder.ToMessageBody()
' SERVER SMTP
Using client As New MailKit.Net.Smtp.SmtpClient()
client.ServerCertificateValidationCallback = (Function(sender, certificate, chain, sslPolicyErrors) True)
client.Connect("mail.mysmtpserver.com", 587, MailKit.Security.SecureSocketOptions.None)
client.Authenticate("Mailkit_SMTP_UserName", "Mailkit_SMTP_Password")
client.Send(message)
client.Disconnect(True)
End Using
Thanks a lot for any suggestion (I don't find any related topic on Google)

I've found what was wrong in my SMTP server : Smartermail has it own mailbox size configuration for any mail account, that is limited at 100Mb.
You can change it by going on : your domain > Manage > Account

Related

Failed to get current state: AuthKeyUnregisteredError('The key is not registered in the system')

I am using Telethon to connect to Telegram and pull down some messages to run analytics on. I wrote the original code in 2018 and it worked perfectly. It connected, read from the channel and allowed me to read messages as I expected. Recently I tried running the script again and it now keeps asking me for my phone number and authentication code despite the fact the session file has been created. In the past I only was asked for the phone number and authentication code once, then the session file was created and I did not have to repeat myself. Now I find myself doing it every time I run the program.
I should note that readChannel.session is created in my local directory and has following properties
$ file readChannel.session
readChannel.session: SQLite 3.x database, last written using SQLite version 3021000
I enabled logging and got the following
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168064255177608 to InvokeWithLayerRequest (3601b10)
DEBUG:telethon.network.mtprotolayer:Packed 1 message(s) in 68 bytes for sending
INFO:telethon.network.mtprotosender:Broken authorization key; resetting
DEBUG:telethon.network.mtprotosender:Closing current connection...
DEBUG:telethon.network.mtprotosender:Awaiting for the send loop before reconnecting...
DEBUG:telethon.network.mtprotosender:Awaiting for the receive loop before reconnecting...
DEBUG:telethon.network.mtprotosender:Closing current connection...
INFO:telethon.network.mtprotosender:Connecting to 149.154.167.92:443/TcpFull...
DEBUG:telethon.network.mtprotosender:Connection attempt 1...
DEBUG:telethon.network.mtprotosender:Connection success!
DEBUG:telethon.network.mtprotosender:New auth_key attempt 1...
DEBUG:telethon.network.mtprotosender:Starting send loop
DEBUG:telethon.network.mtprotosender:Starting receive loop
INFO:telethon.network.mtprotosender:Connection to 149.154.167.92:443/TcpFull complete!
DEBUG:telethon.network.mtprotosender:Receiving items from the network...
INFO:telethon.client.updates:Asking for the current state after reconnect...
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168067804342024 to InvokeWithLayerRequest (3601b10)
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168067820286504 to GetStateRequest (3601f50)
DEBUG:telethon.network.mtprotolayer:Packed 2 message(s) in 112 bytes for sending
DEBUG:telethon.network.mtprotosender:Handling bad salt for message 6755168067844913236
DEBUG:telethon.network.mtprotosender:2 message(s) will be resent
DEBUG:telethon.network.mtprotosender:Receiving items from the network...
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168068088576072 to InvokeWithLayerRequest (3601b10)
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168068116633168 to GetStateRequest (3601f50)
DEBUG:telethon.network.mtprotolayer:Packed 2 message(s) in 112 bytes for sending
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168068176325552 to MsgsAck (394c0f0)
DEBUG:telethon.network.mtprotolayer:Packed 1 message(s) in 36 bytes for sending
DEBUG:telethon.network.mtprotosender:Handling container
DEBUG:telethon.network.mtprotosender:Handling new session created
DEBUG:telethon.network.mtprotosender:Handling acknowledge for [6755168068088576072, 6755168068116633168]
DEBUG:telethon.network.mtprotosender:Receiving items from the network...
DEBUG:telethon.network.mtprotosender:Handling RPC result for message 6755168068116633168
DEBUG:telethon.network.mtprotosender:Receiving items from the network...
INFO:telethon.client.updates:Failed to get current state: AuthKeyUnregisteredError('The key is not registered in the system')
DEBUG:telethon.network.mtprotosender:Handling RPC result for message 6755168068088576072
DEBUG:telethon.network.mtprotosender:Receiving items from the network...
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168068470441572 to MsgsAck (3601ed0)
DEBUG:telethon.network.mtprotolayer:Packed 1 message(s) in 36 bytes for sending
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168068486387960 to MsgsAck (3601e10)
DEBUG:telethon.network.mtprotolayer:Assigned msg_id = 6755168068510330908 to GetStateRequest (3601d10)
DEBUG:telethon.network.mtprotolayer:Packed 2 message(s) in 112 bytes for sending
DEBUG:telethon.network.mtprotosender:Handling RPC result for message 6755168068510330908
DEBUG:telethon.network.mtprotosender:Receiving items from the network...
Please enter your phone (or bot token):
It would appear the problem relates to INFO:telethon.client.updates:Failed to get current state: AuthKeyUnregisteredError('The key is not registered in the system')
Here is the code
api_id = xxx
api_hash = xxx
channel_name = xxx
client = TelegramClient('readChannel', api_id, api_hash)
# Connect to telegram
try:
client.connect()
client.start()
except:
print ("Could not connect to telegram")
# Connect to channel and get posts
try:
channel_entity=client.get_entity(channel_name)
posts = client(GetHistoryRequest(
peer=channel_entity,
limit=1000000,
offset_date=0,
offset_id=0,
max_id=0,
min_id=0,
add_offset=0,
hash=0))
except:
print ("Could not connect to channel ", channel_name)
Expected: I expected to be asked phone number and authentication code once and then it would read from the session file thereafter.
Actual: Now I find myself doing it every time I run the program (providing my phone number and authentication code).

Kannel receiving and processing long SMS

Kannel 1.4.3
I need to receive "long" sms (length > 160 symbols) by Kannel. If sms length less than 160 - all is ok. But if it is long sms kannel splits sms to 2 or more sms and send not like one concatened sms but 2 or more different messages.
I tried to use
sms-combine-concatenated-mo = true
in kannel.conf core section but it did not help.
Here is my sms-service config:
# SMS Gateway Reciever
group = sms-service
keyword = default
omit-empty = true
post-url = "http://localhost:22222/recievesms?from=%p&time=%t&smsc=%i&coding=%c&service=%n&charset=%C"
concatenation = true
Can anybody suggest how to resolve this problem.
Problem was resolved by installing new version (daily snapshot) of Kannel.

Postfix DSN success report

I have Postfix.
When I'm trying to send email to unexisting address Postfix generate notification about bounce.
I found Postfix DSN Support: it says "What notifications are sent: success, failure, delay, or none. Normally, Postfix informs the sender only when mail delivery is delayed or when delivery fails."
How can I enable success notifications?
Updated
I found solution (here)
Delivery Status Notification: How does it work?
sendmail 8.7 has no hook to request a DSN from the commandline, it can
be only done in an ESMTP dialogue. This is quite reasonable, since
options (as introduced in sendmail 8.8), are barely flexible enough to
allow for something like this (slightly modified from the RFC):
The key is
RCPT TO: NOTIFY=SUCCESS,DELAY
ORCPT=rfc822;Bob#Big-Bucks.COM
Here is example of SMTP session via telnet:
R: 220 Pure-Heart.ORG SMTP server here
S: EHLO Pure-Heart.ORG
R: 250-Pure-Heart.ORG
R: 250-DSN
R: 250 SIZE
S: MAIL FROM:<Alice#Pure-Heart.ORG> RET=HDRS ENVID=QQ314159
R: 250 <Alice#Pure-Heart.ORG> sender ok
S: RCPT TO:<Bob#Big-Bucks.COM> NOTIFY=SUCCESS,DELAY ORCPT=rfc822;Bob#Big-Bucks.COM
R: 250 <Bob#Big-Bucks.COM> recipient ok
S: RCPT TO:<Carol#Ivory.EDU> NOTIFY=FAILURE ORCPT=rfc822;Carol#Ivory.EDU
R: 250 <Carol#Ivory.EDU> recipient ok
S: RCPT TO:<Dana#Ivory.EDU> NOTIFY=SUCCESS,FAILURE ORCPT=rfc822;Dana#Ivory.EDU
R: 250 <Eric#Bombs.AF.MIL> recipient ok
S: RCPT TO:<Fred#Bombs.AF.MIL> NOTIFY=NEVER
R: 250 <Fred#Bombs.AF.MIL> recipient ok

How to retrieve the number of E-mail messages from mail server using VB.net and IMAP?

I managed to get a successful reply from the mail server (Gmail.com) using IMAP and vb.net with this code in this post
Now, I want to retrieve the number of E-mail messages from Inbox folder, how to do it?!
After you connect to the server, you'll issue a set of commands like this:
A001 LOGIN <username> <password>
A002 SELECT INBOX
In response to the SELECT INBOX, the server will respond with a bunch of responses:
* OK [UIDVALIDITY 38]
* 13 EXISTS
* 0 RECENT
A002 OK Inbox selected.
...
The EXISTS response is the number of messages in the INBOX.

How to sync for the emails which are received after a particular email.

I am working on an application which download Yahoo account emails in the order of down to top using Yahoo Mail API's.
Application sync logic works like below
Lets say Inbox consists of 1000 emails.
1) Initially fetching 100 emails message ID's by using "ListMessages" with parameters startMid = 0 and numMid=100.
2) Processing chunk emails .
3) Now requesting for the next chunk emails by giving the startMid = 100 and numMid=100.
The above logic works fine if user is not deleting any emails during syncing.
Is there any way to retrieve next chunk emails based on the message ID (string unique value) rather than message number.
What is the logic for syncing the emails from the last processed message?
PS:I can not rely on message number (since message number is not meant for unique identifier of a message).
I was looking for the same thing and found "How to get only emails which are arrived from the Client last sync." (http://developer.yahoo.com/forum/Yahoo-Mail-Web-Services-API/How-to-get-only-emails-which/1320329478746-16f18e6a-aadd-40c3-b259-e095ce80a1e6) where some guy reply "This feature is not available right now but we do plan to support this in future." date: 3 Nov 2011 11:24 AM
I think you can query mailTables (with YQL) or ListMessage (Api) and get the complete list of messages id (without any info) eg: SELECT * FROM ymail.messages WHERE numInfo="0"
And then "count" the position of the last message you got and then, get mail from that number. Eg: SELECT * FROM ymail.messages WHERE startMid="3" and numMid="100"
What do you think?
Greetings from Argentina
PS: sorry about my horrible english