29.07.2013 Views

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

Master of Science thesis Fighting Spam

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NotificationHeader header = new NotificationHeader(notificationSignature,<br />

m.c.getSerialNumber(), m.sender, getCertificate());<br />

msg = (MimeMessage)MimeTools.addAttachmentHeader(msg, header);<br />

msg.saveChanges();<br />

msg.setHeader(Config.headerNotificationName," notificationmail");<br />

msg.saveChanges();<br />

// Send the message<br />

Transport.send(msg);<br />

Debugger.debug(getClass(), 1, "Notification mail sent succesfully to: " +<br />

m.sender);<br />

}<br />

catch(Exception ex)<br />

{<br />

Debugger.debug(getClass(), 1, "Collect coin: Could not send notification mail<br />

to: " + m.sender, ex);<br />

}<br />

}<br />

public boolean deleteCoinWithSerial(long serialNumber)<br />

{<br />

return getSafe().deleteCoinWithSerial(serialNumber);<br />

}<br />

public Coin[] getCoinsToSend(int n, Address[] receivers) throws Exception<br />

{<br />

return getSafe().getCoinsToSend(n,receivers);<br />

}<br />

public void saveMail(Coin coin, MimeMessage msg) throws Exception<br />

{<br />

getSafe().addPendingMail(new MailInformation(coin, msg));<br />

gui.updateMailList();<br />

}<br />

public boolean isOnWhitelist(String address) throws AddressException<br />

{<br />

return whitelist.onWhitelist(new InternetAddress(address));<br />

}<br />

public void addToWhitelist(String address) throws Exception<br />

{<br />

whitelist.add(new InternetAddress(address));<br />

}<br />

public void removeFromWhitelist(InternetAddress address) throws AddressException<br />

{<br />

}<br />

massMail(2,address);<br />

whitelist.remove(address);<br />

public Whitelist getWhitelist()<br />

{<br />

return whitelist;<br />

}<br />

public boolean isOnBlackList(Certificate cert)<br />

{<br />

return blacklist.onBlacklist(cert);<br />

}<br />

//-----------------------------------------------------------------------------<br />

//Methods for interacting with the Currency Exchange Server (CES)<br />

//-----------------------------------------------------------------------------<br />

public void withdraw(String username, String password, double amount)<br />

{<br />

String error = "";<br />

Exception ex = null;<br />

203

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!