Read mail (IMAP) but only show messages from certain email address - objective-c

Can I retrieve emails using IMAP server details from a UITextField and show them in a UITableView but only show emails which come from a certain email address (e.g. example#example.com)?
Thanks,
James

SMTP is for sending Mails, not receiving them. If you want to try IMAP for receiving check MailCore, it might help some hassle implementing IMAP.

Related

send email from a Microsoft exchange Imap account from MailCore

Ok, so I am building an app that gets and sends emails from your email account, but I have hit a brick wall, the app worst great for POP3 accounts and IMAP accounts, but if are using a exchange IMAP account from a Microsoft Exchange server then it will let you log in and grab the unread emails, but not send anything, this is what i use to send an email
[CTSMTPConnection sendMessage:outMessage server:[dictData valueForKey:#"SMTPServerName"] username:[dictData valueForKey:#"userEmailAddress"] password:[dictData valueForKey:#"password"] port:[[dictData objectForKey:#"SMTPPort"]intValue] useTLS:NO useAuth:YES];
And yes obviously the "username" is not always the email address. I have tried all different types of combinations of setting for the "useTLS" and "useAuth" part (YES/NO, NO/YES, YES/YES, NO/NO). I keep getting an error message back from mailcore saying the "username or password is invalid." --- this only happens when i try sending an email from that account
It is better (and more stable) to use separate SMTP class based on NSSockets
which does the same work as MailCore SMTP client.
NSSocket-based class will be more readable in locking for server connection errors.
We use MailCore only as IMAP part in our mail project.

Qmail - Forward email without attachment

I have pretty standard Qmail toaster installation. I'm using the dot files to set up mail forwarding for my account, so when I recieve an e-mail, this e-mail stays in my mailbox and is also forwarded to another email address. Easy, you say. And yes, it is, it is working fine ... except ... That this another email adress is actually a cell phone number, so I get an SMS notification about each email I recieve.
But, as our phone provider limits the size of an SMS, if I recieve an email with attachment, Qmail tries to forward it to my mobile phone, but this fails, the error message gets back to original email sender and he thinks the email was not delivered at all.
I haven't found any solution to this, but I came to an idea - if there is a possibility to LIMIT the Qmail, so he doesn't forward the specific type of emails (in my case, emails with attachments) ? Or somehow restrict him from sending back the error messages from these forwards ?
Stripmime
http://www.phred.org/~alex/stripmime.html
.qmail-default:
| /usr/local/bin/stripmime.pl | /home/vpopmail/bin/vdelivermail '' myphone#example.com
or
Demime
http://scifi.squawk.com/demime.html (link not working anymore)
.qmail-default:
|/var/qmail/bin/demime -8 myphone#example.com

Mailsystem Failure Delivery - Custom subject

When a mail is bounced it has a standard subject.
Is it possible to change with a custom subject or the subject which we gave or with a dynamic subject?
I am building a simple system in php to count all send and not sent mails with the help of bounced mails.
So i need to parse the body of the bounced mail to find the email address to which the mail was not sent.
If there could be any other less overhead option then that could be nice. We can reduce the processing time to parse.
You can send a custom x-mail-id header or use the standard Mail-ID header. You store in a table a map of the id to email addresses.
From there it is simple to find out which email bounced by matching the id to the email address in your table.
That subject could be generated by any server along the path your mail message takes, so I'd say no, you can't change that.

detect that an email is sent to a mailing-list

My application sends mails containing an authentication token. The user which receives the mail clicks on a link and is directed to a webpage. The app recognizes him.
The problem is that sometimes the mail is sent to a mailing list instead of a personal address. Then several people come on the page and override each others' actions.
There are 2 ways I think I could solve this :
detect that the email address is a mailing list before I send the mail
include the final recipient address in the link in the email.
Is any of the 2 possible ?
No.
The recipient can tell if the message came from a mailing list (if the list follows the right guidlines), but the sender can't.
There is no way for the sender to modify the body of an email dynamically based on the final recipient.
David's answer is correct. Though, depending on your context you may find the following idea useful:
You might be able to record the number of clicks per email sent out using that token and just specify a threshold. If the number of times the auth token exceeds it, flag the recipient as a mailing list and exclude them from future mailings.

Track bounced back newsletter emails

I've built a newsletter system which tracks:
Openings
Link clicks
Unsubscriptions
However, I need to find a way of tracking which newsletter emails 'bounced back'.
Has anyone done this before and whats the best way of doing it?
When sending the mail via SMTP you supply the FROM command which is sometimes referred to as the 'Sender' or 'Envelope Sender'. This is separate from the From: header in the email itself. What you want to do is to create a 'bounced' mailbox and set that as the 'Sender' for the email. If there is a bounce, then most mail servers will send a (NDR) notification back to this sender.
Then you need to periodically check this mailbox for NDR's and parse them for the original recipient and if it was a hard or soft bounce. There are various libraries that can do this for you such as ListNanny